diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-24 02:17:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-24 02:17:23 +0300 |
commit | e968017951f8b38d4c33aac4225758687ba1e7d3 (patch) | |
tree | b6f4bcd50b7cc24ce39fdedca0feb75c590ee41c /source/blender/makesrna | |
parent | b7d717cead9000c4600d71ed15fc10ebc103c591 (diff) |
- new pyrna api functions srna & prop path_to_id(), useful when setting driver target paths.
This means you can have a pose bone for eg and get the path...
pose.bones["Bone"]
uses rna internal functions, so will work for sequence strips etc.
- StructRNA.get(), used for getting ID props without exceptions...
val = C.object["someKey"]
or..
val = C.object.get("someKey", "defaultValue") # wont raise an error
- change rna property for testing if rna props are editable, test the flag rather then calling the function since the function depends on blenders state.
- fix a python exception with the ID-Property popup UI (when editing in more then 1 step)
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_fcurve.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 67d562da23b..10a4a9f5fbd 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -649,7 +649,7 @@ static void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable"); RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_DriverTarget_id_typef"); - RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from"); + RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from (id_type property must be set first)"); //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 4218724d7df..f8adb1a79d8 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -428,7 +428,12 @@ static int rna_Property_unit_get(PointerRNA *ptr) static int rna_Property_editable_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; - return RNA_property_editable(ptr, prop); + + /* dont use this becaure it will call functions that check the internal + * data for introspection we only need to know if it can be edited so the + * flag is better for this */ +// return RNA_property_editable(ptr, prop); + return prop->flag & PROP_EDITABLE ? 1:0; } static int rna_Property_use_return_get(PointerRNA *ptr) |