Commit Graph

559 Commits

Author SHA1 Message Date
e9d73dbba5 use -FLT_MAX where FLT_MIN was misused 2012-08-07 19:49:38 +00:00
Lukas Toenne
dee1d86e65 Fix for RNA struct registration: the bpy_class_validate function would only check the immediate functions/properties of the pointer struct type, but not potential base structs. Now it first validates the base struct recursively before the actual properties of the registered class.
Does not have any effect for current registerable types (Operator, Menu, Panel, etc.), since none of those actually have a base struct, but will be required for future types with an actual hierarchy (custom nodes).
2012-07-24 12:00:02 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
84bf3e48c0 style cleanup: use c style comments in C code 2012-07-06 23:56:59 +00:00
314a275850 fix (actually nasty workaround), for groups incorrectly drawing in the object panel when the blend file has naming collisions with library data.
also minor style cleanup in bpy_rna.c
2012-07-03 10:32:10 +00:00
f6e21881f5 change RNA_struct_find_function to accept a type rather then a PointerRNA, add a check duplicate functions are not defined. 2012-06-10 13:34:59 +00:00
1931aac1f7 style cleanup: (indentation) 2012-06-06 14:48:39 +00:00
032d83ecc4 style cleanup: defines with braces 2012-05-27 20:13:59 +00:00
dab1d8e487 style cleanup 2012-05-22 22:03:41 +00:00
3896ad4cbb code cleanup: spelling 2012-05-20 21:23:26 +00:00
c0bd076bfd style cleanup: and add missing files to cmake 2012-05-17 23:12:15 +00:00
ed33320e3f Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.

GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);

Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
2012-05-16 00:51:36 +00:00
b667f29a84 no need to clamp python values twice when assigning. 2012-05-11 10:25:12 +00:00
d9ce1cda94 Python/context: python could get invalid bpy.data in scene update handler after
undo.

The way this got updated from the context is a bit unreliable, and for handlers
the update couldn't happen because there is no context passed in. Now it's
updated from setup_app_data, which is where the change actually happens. I left
in the other updates to be sure but they should not be needed anymore.
2012-05-08 22:07:06 +00:00
9fe1fe0aa8 bmesh py api:
add mtexpoly image access
2012-05-01 06:50:43 +00:00
a5af5e8f50 style cleanup: re - http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Braces_with_Macros 2012-04-30 16:22:40 +00:00
ef054e165c style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros. 2012-04-28 15:14:16 +00:00
1add07821b fix [#30925] successful import of keyconfig dependant on current object context?
revert r34885,

The hack was to fix poselib UI but is REALLY BAD - don't modify properties when accessing them.

This bug must be fixed some other way.
2012-04-13 09:25:50 +00:00
9e663017d8 py rna/api: fix for error running RNA_property_collection_type_get on non collection property types. 2012-04-11 10:35:09 +00:00
63e2763842 Fix #30698: python console nodetree paths were not accurate, now show ... like
in some other cases to at least show these are not accurate.
2012-04-10 16:37:05 +00:00
8fa17c5362 code cleanup: no functional changes
- memset(..., -1) is used incorrectly even though it worked: MOD_solidify.c - thanks Halley from IRC for noticing this. use fill_vn_i() instead.
- quiet warnings in editmesh_slide.c
- cleanup comments in bmesh and some other minor comment additions.
2012-04-07 12:37:15 +00:00
c563eb71b7 wrap RNA's RNA_property_collection_clear from python. 2012-04-02 11:28:26 +00:00
5b88712ff9 move debug flag into its own global var (G.debug), split up debug options.
--debug
  --debug-ffmpeg
  --debug-python
  --debug-events
  --debug-wm

This makes debug output easier to read - event debug prints would flood output too much before.

For convenience:
  --debug-all turns all debug flags on (works as --debug did before).

also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.
2012-03-31 00:59:17 +00:00
abf551b1a5 style cleanup: py api 2012-03-26 20:41:54 +00:00
5a90ea77bc style cleanup: follow style guide for formatting of if/for/while loops, and else if's 2012-03-24 06:24:53 +00:00
3b9b53d876 fix [#30589] RNA function descriptions not showing in Python console on autocomplete
show rna function description and arguments now.
2012-03-20 07:41:47 +00:00
b163e19b8d py api:
fix for collection functions not showing up in __dir__,

eg, console autocomplete didnt show up bpy.data.libraries.load

also fix refcounting leak with returning attributes from collections.
2012-03-20 03:13:25 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
02f707e9da minor mathutils code cleanup - use mathutils callbacks as unsigned chars everywhere. 2012-03-17 10:46:02 +00:00
70d3d1aca6 style cleanup: py/capi 2012-03-16 21:39:56 +00:00
ebec111618 bmesh py api:
Wrap customdata, so far you can access the data layers in a pythonic way but not manipulate the customdata yet.

provides dictionary like access to customdata layers, eg:
  texpoly = bm.faces.tex["UVMap"]
  print(bm.verts.shape.keys())  # un-intended pun, keys() works on all layers.
  print("MyInt" in bm.edges.int)  # __contains__
  layer = bm.faces.get("CheckForLayer")
2012-03-16 05:03:13 +00:00
2fbb5ce833 bmesh py api: more comprehensive intro page, also fix some spelling errors. 2012-03-13 06:22:43 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
79d97ca509 style cleanup - spelling. 2012-03-08 04:12:11 +00:00
3590076193 style cleanup - comment formatting 2012-03-03 20:36:09 +00:00
95bba22af0 fix for error report in property registration, it wasnt printing the error. 2012-03-03 00:20:05 +00:00
ea13ec1699 Spelling Cleanup 2012-03-01 12:20:18 +00:00
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
74e9563b8a * bmesh py api BMEdge.verts was using 2 v1's
* bmesh pu api __repr__ functions for mesh data.
* correct py hash defines.
2012-02-26 17:20:36 +00:00
3fc2fbc333 style cleanup, use { on newline after function definition.
spelling 'impliment' -> 'implement'
2012-02-25 16:49:59 +00:00
38f546a614 swap arg order for BM_edge_split(), makes sense to have edge as first
arg.
2012-02-23 05:17:07 +00:00
1f40f01435 correct exception - was using a TypeError when should be a ValueError. 2012-02-22 09:13:29 +00:00
4acab3eb33 Code Cleanup: line length and use Py_ssize_t for PyC_AsArray utility function. 2012-02-05 02:04:26 +00:00
697e77a494 fix [#29666] Duplicate entries in bpy.types
Python operator subclasses and operator types each get their own SRNA, causing double ups for bpy.types.__dir__()

From the operator type - these share names.
* ot->ext.srna
* ot->srna

Note that this conflict is still there, this only disables 'ot->ext.srna' from being included in dir(bpy.types).
2012-02-02 04:43:35 +00:00
57ad3b85d8 fix [#27589] Random crash with python UI
This script was defining an operator within the panels draw function, while its possible to support this its really asking for trouble.

the fix is to raise an error when this happens.

also fix crash passing non classes to register_class/unregister_class
2012-01-18 19:50:44 +00:00
8c9c018c90 note on compating RNA pointers and compare RNA types for RNA-Properties too. 2012-01-15 12:35:40 +00:00
0f34ce27cf fix for error comparing py-struct members
if 2 pyrna structs used the same pointer they could incorrectly compare as true, this caused an error in theme saving because an item could match its parent and stop writing (to prevent recursive writing of same data).

eg:
  context.user_preferences.themes[0].user_interface.wcol_regular == context.user_preferences.themes[0].user_interface
2012-01-13 11:36:32 +00:00
02560d748f add RNA_property_is_set function, use for WM_menu_invoke to avoid double lookup and py api to de-duplicate some checks 2012-01-11 16:48:22 +00:00
f66f33cefc rename RNA_property_is_set() --> RNA_struct_property_is_set() in preperation to add a second version of the function which takes the property rather then its name. 2012-01-11 16:32:12 +00:00
e039a631a9 add bpy collection method .find(key), so you can get the index of an item in a collection, -1 if not found.
use this to replace bge text ui py function.
2012-01-05 06:05:45 +00:00