Commit Graph

3838 Commits

Author SHA1 Message Date
41bfb62b0f was trying to make py import follow pythons own code more but broke py32 compat. this should fix 2012-11-06 13:29:00 +00:00
92bb31c10e fix for imp.reload() with Python3.3, function was recursively calling its self. 2012-11-06 11:43:19 +00:00
ea61c74262 hopefully fixes building on msvc, also some minor header edits 2012-11-05 14:58:12 +00:00
004f8d78ed default to Python3.3 on Linux for SCons and CMake, warn when building with python 3.2x or older.
also remove casts to keep Python3.2 warning quiet.
2012-11-05 13:48:42 +00:00
fae6c35ca7 code cleanup: quiet -Wdouble-promotion, disabled this warnings for a few files since its done throughout the code in some places. 2012-11-04 07:18:29 +00:00
9b948717b0 code cleanup: float <> double conversion. 2012-11-03 18:23:30 +00:00
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
47cd3cf225 BPY/RNA: determine callback functions that are allowed to write data by a flag
on the function instead of checking the name.
2012-11-03 14:31:38 +00:00
9a82b47b4f all library data now gets the PointerRNA's invalidated on removal. 2012-11-01 17:16:24 +00:00
f4e5404e4a fix for long standing problem with blender 2.5x py api.
Removing data then accessing would allow invalid memory access and often crash.

Example:
  import bpy
  image = bpy.data.images.new(name="a", width=5, height=5)
  bpy.data.images.remove(image)
  print(image.name)

Now access to the removed data raises an error:
  ReferenceError: StructRNA of type Image has been removed

This is the same level of error checking that was done in blender 2.4x but was made difficult by RNA functions not having access to the PyObject's.
2012-11-01 15:56:42 +00:00
1bcadda46b fix [#30910] Problems: Add Shortcut(s) for "Ctrl Tab" menu
comparing keymaps was too sloppy or too strict, now sloppy keymap comparison works by setting all the operator
properties to their default values if they are not already set, then compare this with the keymap item (ignoring values missing from either one).

... this way any non default keymap setting wont match with an operator menu item which doesnt set this operator at all (a problem sighted in this bug report).


developer notes:
- IDP_EqualsProperties_ex() function adds an argument to treat missing members of either group to act as if there is a match.
- WM_operator_properties_default() function to reset RNA values to their defaults.
- add IDP_spit(), debug only function to print out ID properties.
2012-10-31 20:29:32 +00:00
c7fbeded4c add IDP_MergeGroup(dst, src, overwrite) function,
like PyDict_Merge()
2012-10-31 19:07:25 +00:00
e8a70d4b90 fix for crash in python matrix utility functions .inverted/adjugated/transposed if the matrix has a read callback and fails.
also replace DM_get_poly_data_layer with dm->getPolyDataArray() since this is the convention in subsurf code and the functions now added.
2012-10-31 03:21:13 +00:00
f4dea6d829 when an invalid subtype is passed to a property, a list of valid subtypes is now included in the exception message.
from bug report [#33018], this avoids common mistakes.
2012-10-30 12:45:42 +00:00
900fa1bfb9 rename subtype FILENAME --> FILE_NAME to match FILE_PATH, DIR_PATH 2012-10-30 12:36:54 +00:00
8c9e1b3c16 Disallow collection add/remove/clear/move when drawing. - similar to how writing to attributes is disabled. 2012-10-30 03:05:45 +00:00
dbb40e805d py api: add mathutils.Matrix adjugate(d) methods, also add adjoint_m2_m2() to BLI_math_matrix 2012-10-29 03:36:55 +00:00
c9e5b1e6ee add --debug-handlers so --debug-events isnt so noisy. 2012-10-27 15:05:12 +00:00
9fc95bd7ee use min/max inline functions where MIN2/MAX2 were doing type conversion. 2012-10-27 11:18:54 +00:00
818710f082 * Windows compile fix for __func__ (r51642) 2012-10-26 18:06:14 +00:00
c9dade4fe0 Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()... 2012-10-26 17:32:50 +00:00
2821f822c5 * New string property subtype: PASSWORD
When this new subtypes is used, then string of property is hidden using
asterisks, e.g.: mysecretpassword -> ****************

This code was reviewed and modified by Brecht. Thanks very much:
 - https://codereview.appspot.com/6713044/

This new subtype of string property is intended mostly for Add-on developers
writing Add-on which communicates with some server (http, sql, ftp, verse,
etc.). When this server requires user authentication and user has to type
username and password, then current API didn't allow to type 'hidden' password,
e.g. when you want to demonstrate this script, then everybody can see this
security password. Some examples of Add-on which could use this new subtype:
 - On-line database of textures
 - Integration of render farm
 - Integration of Verse

Security Notes:
 - You can copy paste hiddent string of property from text input using (Ctrl-C, Ctrl-V),
but you can do this in other GUI toolkits too (this behavior it is widely used).
 - Text of string property is stored in plain text, but it is widely used in other
GUI toolkits (Qt, Gtk, etc.).

Simple examples:
 - https://dl.dropbox.com/u/369894/draw_op_passwd.py
 - https://dl.dropbox.com/u/369894/blender-password.png
2012-10-26 12:58:54 +00:00
0e3de1df4b fix [#31661] Custom properties do no respect min/max values
also renamed function added prev commit
2012-10-26 10:54:02 +00:00
0e6f8e3e25 fix for crash when a python operator or render engine was freed in the C code and then referenced from python.
now further access in python gives an exception at the line when the freed data is accessed.
2012-10-26 10:33:57 +00:00
0e494b74c4 style cleanup 2012-10-26 04:14:10 +00:00
2223ca1c20 Fix #32973: crash adding python property with update=None parameter passed. 2012-10-25 22:37:05 +00:00
fec81d9b56 use min_ max_ functions in more places.
also fix minor error in MOD decimate when the modifier did nothing the reported face count would be wrong.
2012-10-23 16:21:55 +00:00
d599b643b7 style cleanup: bge, switch statements mostly.
also left bmesh decimator on in previous commit.
2012-10-21 07:58:38 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
7deb8d8a26 code cleanup: spelling 2012-10-20 20:36:51 +00:00
c56a911cd9 style cleanup: comments 2012-10-20 20:20:02 +00:00
536d9fec80 code cleanup:
- move object_iterators.c --> view3d_iterators. (ED_object.h had to include ED_view3d.h which isn't so nice)
- move projection functions from view3d_view.c --> view3d_project.c (view3d_view was becoming a mishmash of utility functions and operators).
- some some cmake includes as system-includes.
2012-10-17 04:13:03 +00:00
92862f96dc code cleanup: use float sizes for function args. 2012-10-15 23:11:59 +00:00
da9394f596 code cleanup: define sizes of vectors for function args and use C style comments 2012-10-15 09:11:17 +00:00
b7f4c69ef7 More UI messages and BKE_reportf->BKE_report fixes... 2012-10-14 15:29:09 +00:00
8437980b81 optimization for PyObject -> ID-property sequence conversion, use PySequence_Fast. 2012-10-12 03:59:50 +00:00
f97dfdf227 quiet clang static checker warning by returning an error for invalid situation getting an IDProp mapping from a PyObject.
also print the path installed to when installing an addon.
2012-10-12 03:24:47 +00:00
40186a8c11 remove BLI_noise from BLI_blenlib.h, not that many files need this. 2012-10-12 00:18:32 +00:00
97d4fb4161 code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
7614428c09 style cleanup: pep8 2012-10-08 10:03:01 +00:00
b26ccf0aff toggle cut through in the knife tool now refreshes (before you had to wave the mouse about to see the result).
also remove print from last commit.
2012-10-06 03:34:52 +00:00
6a164c7f72 fix [#32779] Bmesh module: assigning to bm.select_mode crashes Blender if bmesh is empty
was missing set typecheck
2012-10-06 03:33:11 +00:00
75fff05348 revert fix for [#31555] Username with special chars in Windows 7
this breaks and causes bug: [#32720], where sys.stdout becomes invalid and print() does nothing.

On investigation - python is not getting the environment variable from blender (aparently because its a DLL?) so this should be resolved rather then overwriting sys.stdout.
2012-10-02 13:24:28 +00:00
35ae7dae9e fix for own bug in bmesh api, setting a byte string customdata layer assumed the input data was 256 length, assigning smaller values would read past the buffer. 2012-10-01 15:39:29 +00:00
b04b8fd0e8 fix for crash found when attempting to setup testing environment to find crashes :)
scripts that have `Register` enabled and load another blend file would crash blender.
2012-10-01 14:14:21 +00:00
c9c76a9a68 add compiler hints that failing to create a bmesh face is unlikely. 2012-10-01 11:12:49 +00:00
ed1cda9a6c style cleanup 2012-09-30 06:12:47 +00:00
9fccfd313c correct addon example, it used both __doc__ and bl_description 2012-09-29 11:51:18 +00:00
79d8367974 add warning that RNA update callbacks dont have checks for infinite recursion. 2012-09-28 09:35:32 +00:00
589ada7f0c code cleanup: correct spelling 2012-09-28 06:45:20 +00:00