diff options
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_key.c | 59 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_lattice.c | 115 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 35 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 22 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object_force.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_particle.c | 75 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 25 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequence.c | 30 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 21 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 48 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_world.c | 2 |
17 files changed, 390 insertions, 71 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index 85a148be2e2..69f5b5adc37 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -81,6 +81,7 @@ PropertyRNA *RNA_def_string_file_path(StructOrFunctionRNA *cont, const char *ide PropertyRNA *RNA_def_string_dir_path(StructOrFunctionRNA *cont, const char *identifier, const char *default_value, int maxlen, const char *ui_name, const char *ui_description); PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description); +void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc); PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); PropertyRNA *RNA_def_float_vector(StructOrFunctionRNA *cont, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax); diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 923191cba78..98646acd727 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -149,8 +149,6 @@ typedef struct RawArray { int stride; } RawArray; -/* Iterator Utility */ - typedef struct EnumPropertyItem { int value; const char *identifier; @@ -159,6 +157,8 @@ typedef struct EnumPropertyItem { const char *description; } EnumPropertyItem; +typedef EnumPropertyItem *(*EnumPropertyItemFunc)(PointerRNA *ptr); + typedef struct PropertyRNA PropertyRNA; /* Parameter List */ diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 4098ca70356..fe4a809c638 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1568,22 +1568,20 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr int i, defaultfound= 0; if(eprop->item) { - fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {", srna->identifier, strnest, prop->identifier, eprop->totitem); + fprintf(f, "static EnumPropertyItem rna_%s%s_%s_items[%d] = {", srna->identifier, strnest, prop->identifier, eprop->totitem+1); for(i=0; i<eprop->totitem; i++) { fprintf(f, "{%d, ", eprop->item[i].value); rna_print_c_string(f, eprop->item[i].identifier); fprintf(f, ", "); fprintf(f, "%d, ", eprop->item[i].icon); rna_print_c_string(f, eprop->item[i].name); fprintf(f, ", "); - rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}"); - if(i != eprop->totitem-1) - fprintf(f, ", "); + rna_print_c_string(f, eprop->item[i].description); fprintf(f, "}, "); if(eprop->defaultvalue == eprop->item[i].value) defaultfound= 1; } - fprintf(f, "};\n\n"); + fprintf(f, "{0, NULL, 0, NULL, NULL}};\n\n"); if(!defaultfound) { fprintf(stderr, "rna_generate_structs: %s%s.%s, enum default is not in items.\n", srna->identifier, errnest, prop->identifier); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 715f03bb3f1..2916c1bcb6e 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1960,6 +1960,12 @@ PropertyRNA *RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, co return prop; } +void RNA_def_enum_funcs(PropertyRNA *prop, EnumPropertyItemFunc itemfunc) +{ + EnumPropertyRNA *eprop= (EnumPropertyRNA*)prop; + eprop->itemf= itemfunc; +} + PropertyRNA *RNA_def_float(StructOrFunctionRNA *cont_, const char *identifier, float default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax) { diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 71e424bbd69..0a7e989a93a 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -37,6 +37,16 @@ #ifdef RNA_RUNTIME +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "BKE_depsgraph.h" +#include "BKE_key.h" +#include "BKE_main.h" + +#include "WM_api.h" +#include "WM_types.h" + static Key *rna_ShapeKey_find_key(ID *id) { switch(GS(id->name)) { @@ -62,6 +72,18 @@ static PointerRNA rna_ShapeKey_relative_key_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, NULL, NULL); } +static void rna_ShapeKey_relative_key_set(PointerRNA *ptr, PointerRNA value) +{ + Key *key= rna_ShapeKey_find_key(ptr->id.data); + KeyBlock *kb= (KeyBlock*)ptr->data, *kbrel; + int a; + + if(key) + for(a=0, kbrel=key->block.first; kbrel; kbrel=kbrel->next, a++) + if(kbrel == value.data) + kb->relative= a; +} + static void rna_ShapeKeyPoint_co_get(PointerRNA *ptr, float *values) { float *vec= (float*)ptr->data; @@ -220,6 +242,21 @@ static PointerRNA rna_ShapeKey_data_get(CollectionPropertyIterator *iter) return rna_pointer_inherit_refine(&iter->parent, type, rna_iterator_array_get(iter)); } +static void rna_Key_update_data(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); + Key *key= ptr->id.data; + Object *ob; + + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob_get_key(ob) == key) { + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } +} + #else static void rna_def_keydata(BlenderRNA *brna) @@ -234,6 +271,7 @@ static void rna_def_keydata(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); srna= RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves."); @@ -242,10 +280,12 @@ static void rna_def_keydata(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ShapeKeyCurvePoint_tilt_get", "rna_ShapeKeyCurvePoint_tilt_set", NULL); RNA_def_property_ui_text(prop, "Tilt", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); srna= RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for bezier curves."); @@ -254,21 +294,25 @@ static void rna_def_keydata(BlenderRNA *brna) RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "handle_1_co", PROP_FLOAT, PROP_VECTOR); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL); RNA_def_property_ui_text(prop, "Handle 1 Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "handle_2_co", PROP_FLOAT, PROP_VECTOR); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL); RNA_def_property_ui_text(prop, "Handle 2 Location", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); /* appears to be unused currently prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_tilt_get", "rna_ShapeKeyBezierPoint_tilt_set", NULL); - RNA_def_property_ui_text(prop, "Tilt", "");*/ + RNA_def_property_ui_text(prop, "Tilt", ""); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); */ } static void rna_def_keyblock(BlenderRNA *brna) @@ -296,30 +340,37 @@ static void rna_def_keyblock(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); /* for now, this is editable directly, as users can set this even if they're not animating them (to test results) */ prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "curval"); RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "ShapeKey"); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL); RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key."); - RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", NULL, NULL); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE); RNA_def_property_ui_text(prop, "Mute", "Mute this shape key."); + RNA_def_property_ui_icon(prop, ICON_MUTE_IPO_OFF, 1); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "slidermin"); @@ -366,11 +417,13 @@ static void rna_def_key(BlenderRNA *brna) prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", KEY_RELATIVE); RNA_def_property_ui_text(prop, "Relative", "Makes shape keys relative."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "slurph", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "slurph"); RNA_def_property_range(prop, -500, 500); RNA_def_property_ui_text(prop, "Slurph", "Creates a delay in amount of frames in applying keypositions, first vertex goes first."); + RNA_def_property_update(prop, 0, "rna_Key_update_data"); } void RNA_def_key(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index f67267ce0d0..c685e5b6912 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -36,6 +36,16 @@ #ifdef RNA_RUNTIME +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "BKE_depsgraph.h" +#include "BKE_lattice.h" +#include "BKE_main.h" + +#include "WM_api.h" +#include "WM_types.h" + static void rna_LatticePoint_co_get(PointerRNA *ptr, float *values) { Lattice *lt= (Lattice*)ptr->id.data; @@ -67,15 +77,96 @@ static void rna_LatticePoint_groups_begin(CollectionPropertyIterator *iter, Poin static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Lattice *lt= (Lattice*)ptr->data; + int tot= lt->pntsu*lt->pntsv*lt->pntsw; - if(lt->def) { - int tot= lt->pntsu*lt->pntsv*lt->pntsw; + if(lt->editlatt && lt->editlatt->def) + rna_iterator_array_begin(iter, (void*)lt->editlatt->def, sizeof(BPoint), tot, NULL); + else if(lt->def) rna_iterator_array_begin(iter, (void*)lt->def, sizeof(BPoint), tot, NULL); - } else rna_iterator_array_begin(iter, NULL, 0, 0, NULL); } +static void rna_Lattice_update_data(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Scene *scene= CTX_data_scene(C); + Lattice *lt= ptr->id.data; + Object *ob; + + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob->data == lt) { + /* XXX this will loop over all objects again (slow) */ + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); + WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, ob); + } + } +} + +static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr) +{ + Main *bmain= CTX_data_main(C); + Lattice *lt= ptr->id.data; + Object *ob; + int newu, newv, neww; + + /* we don't modify the actual pnts, but go through opnts instead */ + newu= (lt->opntsu > 0)? lt->opntsu: lt->pntsu; + newv= (lt->opntsv > 0)? lt->opntsv: lt->pntsv; + neww= (lt->opntsw > 0)? lt->opntsw: lt->pntsw; + + /* resizelattice needs an object, any object will have the same result */ + for(ob=bmain->object.first; ob; ob= ob->id.next) { + if(ob->data == lt) { + resizelattice(lt, newu, newv, neww, ob); + if(lt->editlatt) + resizelattice(lt->editlatt, newu, newv, neww, ob); + break; + } + } + + /* otherwise without, means old points are not repositioned */ + if(!ob) { + resizelattice(lt, newu, newv, neww, NULL); + if(lt->editlatt) + resizelattice(lt->editlatt, newu, newv, neww, NULL); + } + + rna_Lattice_update_data(C, ptr); +} + +static void rna_Lattice_outside_set(PointerRNA *ptr, int value) +{ + Lattice *lt= ptr->data; + + if(value) lt->flag |= LT_OUTSIDE; + else lt->flag &= ~LT_OUTSIDE; + + outside_lattice(lt); + + if(lt->editlatt) { + if(value) lt->editlatt->flag |= LT_OUTSIDE; + else lt->editlatt->flag &= ~LT_OUTSIDE; + + outside_lattice(lt->editlatt); + } +} + +static void rna_Lattice_points_u_set(PointerRNA *ptr, int value) +{ + ((Lattice*)ptr->data)->opntsu= CLAMPIS(value, 1, 64); +} + +static void rna_Lattice_points_v_set(PointerRNA *ptr, int value) +{ + ((Lattice*)ptr->data)->opntsv= CLAMPIS(value, 1, 64); +} + +static void rna_Lattice_points_w_set(PointerRNA *ptr, int value) +{ + ((Lattice*)ptr->data)->opntsw= CLAMPIS(value, 1, 64); +} + #else static void rna_def_latticepoint(BlenderRNA *brna) @@ -97,6 +188,7 @@ static void rna_def_latticepoint(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Deformed Location", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, 0, 0, 0, 0); @@ -121,37 +213,48 @@ static void rna_def_lattice(BlenderRNA *brna) prop= RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsu"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL); + RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, "U", "Points in U direction."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); prop= RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsv"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL); + RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, "V", "Points in V direction."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); prop= RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsw"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL); + RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_text(prop, "W", "Points in W direction."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); prop= RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typeu"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type U", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typev"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type V", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typew"); RNA_def_property_enum_items(prop, prop_keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type W", ""); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "outside", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE); + RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_outside_set"); RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices."); + RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "key"); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 69d5c203abf..a789f9065e3 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1300,6 +1300,13 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; + static EnumPropertyItem particleinstance_axis[] = { + {0, "X", 0, "X", ""}, + {1, "Y", 0, "Y", ""}, + {2, "Z", 0, "Z", ""}, + {0, NULL, 0, NULL, NULL} + }; + srna= RNA_def_struct(brna, "ParticleInstanceModifier", "Modifier"); RNA_def_struct_ui_text(srna, "ParticleInstance Modifier", "Particle system instancing modifier."); RNA_def_struct_sdna(srna, "ParticleInstanceModifierData"); @@ -1316,6 +1323,12 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Particle System Number", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "axis"); + RNA_def_property_enum_items(prop, particleinstance_axis); + RNA_def_property_ui_text(prop, "Axis", "Pole axis for rotation"); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); prop= RNA_def_property(srna, "normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Parents); @@ -1346,6 +1359,28 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_Dead); RNA_def_property_ui_text(prop, "Dead", "Show instances when particles are dead."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "keep_shape", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_KeepShape); + RNA_def_property_ui_text(prop, "Keep Shape", "Don't stretch the object."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "size", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", eParticleInstanceFlag_UseSize); + RNA_def_property_ui_text(prop, "Size", "Use particle size to scale the instances."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "position"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "Position", "Position along path."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "random_position", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "random_position"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "Random Position", "Randomize position along path."); + RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Modifier_update"); } static void rna_def_modifier_explode(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index b33c5e480b5..092d15de96e 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -25,6 +25,7 @@ #include <stdio.h> #include <stdlib.h> +#include "RNA_access.h" #include "RNA_define.h" #include "RNA_types.h" @@ -447,6 +448,21 @@ static void rna_Object_active_shape_key_index_set(PointerRNA *ptr, int value) ob->shapeflag |= OB_SHAPE_TEMPLOCK; } +static PointerRNA rna_Object_active_shape_key_get(PointerRNA *ptr) +{ + Object *ob= (Object*)ptr->id.data; + Key *key= ob_get_key(ob); + KeyBlock *kb; + PointerRNA keyptr; + + if(key==NULL) + return PointerRNA_NULL; + + kb= BLI_findlink(&key->block, ob->shapenr-1); + RNA_pointer_create(&key->id, &RNA_ShapeKey, kb, &keyptr); + return keyptr; +} + static void rna_Object_shape_key_lock_set(PointerRNA *ptr, int value) { Object *ob= (Object*)ptr->id.data; @@ -1254,8 +1270,14 @@ static void rna_def_object(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "shapeflag", OB_SHAPE_LOCK); RNA_def_property_boolean_funcs(prop, NULL, "rna_Object_shape_key_lock_set"); RNA_def_property_ui_text(prop, "Shape Key Lock", "Always show the current Shape for this Object."); + RNA_def_property_ui_icon(prop, ICON_UNPINNED, 1); RNA_def_property_update(prop, NC_OBJECT|ND_GEOM_DATA, "rna_Object_update_data"); + prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "ShapeKey"); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL); + RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key."); + prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "shapenr"); RNA_def_property_int_funcs(prop, "rna_Object_active_shape_key_index_get", "rna_Object_active_shape_key_index_set", "rna_Object_active_shape_key_index_range"); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 45a9dc44875..269437a8fae 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -107,7 +107,7 @@ static void rna_Cache_idname_change(bContext *C, PointerRNA *ptr) { Object *ob = CTX_data_active_object(C); PointCache *cache = (PointCache*)ptr->data; - PTCacheID *pid = NULL, *pid2; + PTCacheID *pid = NULL, *pid2= NULL; ListBase pidlist; int new_name = 1; char name[80]; diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index ba331efada1..4e095cb74a3 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -151,6 +151,20 @@ static void rna_particle_settings_set(PointerRNA *ptr, PointerRNA value) if(psys->part) psys->part->id.us++; } +static void rna_Particle_abspathtime_update(bContext *C, PointerRNA *ptr) +{ + ParticleSettings *settings = (ParticleSettings*)ptr->data; + float delta = settings->end + settings->lifetime - settings->sta; + if(settings->draw & PART_ABS_PATH_TIME) { + settings->path_start = settings->sta + settings->path_start * delta; + settings->path_end = settings->sta + settings->path_end * delta; + } + else { + settings->path_start = (settings->path_start - settings->sta)/delta; + settings->path_end = (settings->path_end - settings->sta)/delta; + } + rna_Particle_redo(C, ptr); +} static void rna_PartSettings_start_set(struct PointerRNA *ptr, float value) { ParticleSettings *settings = (ParticleSettings*)ptr->data; @@ -189,7 +203,19 @@ static float rna_PartSetting_linelentail_get(struct PointerRNA *ptr) ParticleSettings *settings = (ParticleSettings*)ptr->data; return settings->draw_line[0]; } +static void rna_PartSetting_pathstartend_range(PointerRNA *ptr, float *min, float *max) +{ + ParticleSettings *settings = (ParticleSettings*)ptr->data; + if(settings->type==PART_HAIR) { + *min = 0.0f; + *max = (settings->draw & PART_ABS_PATH_TIME) ? 100.0f : 1.0; + } + else { + *min = (settings->draw & PART_ABS_PATH_TIME) ? settings->sta : 0.0f; + *max= (settings->draw & PART_ABS_PATH_TIME) ? MAXFRAMEF : 1.0f; + } +} static void rna_PartSetting_linelenhead_set(struct PointerRNA *ptr, float value) { ParticleSettings *settings = (ParticleSettings*)ptr->data; @@ -702,15 +728,15 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Abs Length", "Use maximum length for children"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - prop= RNA_def_property(srna, "absolute_time", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_TIME); - RNA_def_property_ui_text(prop, "Absolute Time", "Set all ipos that work on particles to be calculated in absolute/relative time."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + //prop= RNA_def_property(srna, "absolute_time", PROP_BOOLEAN, PROP_NONE); + //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_ABS_TIME); + //RNA_def_property_ui_text(prop, "Absolute Time", "Set all ipos that work on particles to be calculated in absolute/relative time."); + //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); - prop= RNA_def_property(srna, "global_time", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GLOB_TIME); - RNA_def_property_ui_text(prop, "Global Time", "Set all ipos that work on particles to be calculated in global/object time."); - RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); + //prop= RNA_def_property(srna, "global_time", PROP_BOOLEAN, PROP_NONE); + //RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_GLOB_TIME); + //RNA_def_property_ui_text(prop, "Global Time", "Set all ipos that work on particles to be calculated in global/object time."); + //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "boids_2d", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PART_BOIDS_2D); @@ -836,15 +862,10 @@ static void rna_def_particle_settings(BlenderRNA *brna) //RNA_def_property_ui_text(prop, "Health", "Draw boid health"); //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - //prop= RNA_def_property(srna, "timed_path", PROP_BOOLEAN, PROP_NONE); - //RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_TIMED_PATH); - //RNA_def_property_ui_text(prop, "Clip with time", "Clip path based on time"); - //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); - - //prop= RNA_def_property(srna, "draw_cached_path", PROP_BOOLEAN, PROP_NONE); - //RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_CACHED_PATH); - //RNA_def_property_ui_text(prop, "Path", "Draw particle path if the path is baked"); - //RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + prop= RNA_def_property(srna, "abs_path_time", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_ABS_PATH_TIME); + RNA_def_property_ui_text(prop, "Absolute Path Time", "Path timing is in absolute frames"); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_abspathtime_update"); prop= RNA_def_property(srna, "billboard_lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "draw", PART_DRAW_BB_LOCK); @@ -1228,7 +1249,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "acc"); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -200.0f, 200.0f); - RNA_def_property_ui_text(prop, "Accelaration", "Constant acceleration"); + RNA_def_property_ui_text(prop, "Acceleration", "Constant acceleration"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_reset"); prop= RNA_def_property(srna, "drag_factor", PROP_FLOAT, PROP_NONE); @@ -1410,6 +1431,24 @@ static void rna_def_particle_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Head", "Length of the line's head"); RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + prop= RNA_def_property(srna, "path_start", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "path_start"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); + RNA_def_property_ui_text(prop, "Path Start", "Starting time of drawn path."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + + prop= RNA_def_property(srna, "path_end", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "path_end"); + RNA_def_property_float_funcs(prop, NULL, NULL, "rna_PartSetting_pathstartend_range"); + RNA_def_property_ui_text(prop, "Path End", "End time of drawn path."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + + prop= RNA_def_property(srna, "trail_count", PROP_INT, PROP_NONE); + RNA_def_property_int_sdna(prop, NULL, "trail_count"); + RNA_def_property_range(prop, 1.0f, 100.0f); + RNA_def_property_ui_text(prop, "Trail Count", "Number of trail particles."); + RNA_def_property_update(prop, NC_OBJECT|ND_PARTICLE, "rna_Particle_redo"); + /* boids */ prop= RNA_def_property(srna, "max_velocity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_vel"); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 14db8ea3377..557d472afef 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -547,6 +547,26 @@ static int rna_EnumPropertyItem_name_length(PointerRNA *ptr) return strlen(((EnumPropertyItem*)ptr->data)->name); } +static void rna_EnumPropertyItem_description_get(PointerRNA *ptr, char *value) +{ + EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data; + + if(eprop->description) + strcpy(value, eprop->description); + else + value[0]= '\0'; +} + +static int rna_EnumPropertyItem_description_length(PointerRNA *ptr) +{ + EnumPropertyItem *eprop= (EnumPropertyItem*)ptr->data; + + if(eprop->description) + return strlen(eprop->description); + else + return 0; +} + static int rna_EnumPropertyItem_value_get(PointerRNA *ptr) { return ((EnumPropertyItem*)ptr->data)->value; @@ -861,6 +881,11 @@ static void rna_def_enum_property(BlenderRNA *brna, StructRNA *srna) RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_name_get", "rna_EnumPropertyItem_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Human readable name."); + prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_description_get", "rna_EnumPropertyItem_description_length", NULL); + RNA_def_property_ui_text(prop, "Description", "Description of the item's purpose."); + prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_EnumPropertyItem_identifier_get", "rna_EnumPropertyItem_identifier_length", NULL); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 2ad4a20f9a0..8946530a372 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -199,6 +199,10 @@ void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); + prop= RNA_def_property(srna, "automerge_editing", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0); + RNA_def_property_ui_text(prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location."); + prop= RNA_def_property(srna, "snap", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP); RNA_def_property_ui_text(prop, "Snap", "Snap while Ctrl is held during transform."); diff --git a/source/blender/makesrna/intern/rna_sequence.c b/source/blender/makesrna/intern/rna_sequence.c index 055e67fb135..8ca023dc57c 100644 --- a/source/blender/makesrna/intern/rna_sequence.c +++ b/source/blender/makesrna/intern/rna_sequence.c @@ -38,9 +38,9 @@ #include "MEM_guardedalloc.h" -#ifdef RNA_RUNTIME +#include "WM_types.h" -#include "MEM_guardedalloc.h" +#ifdef RNA_RUNTIME static int rna_SequenceEditor_name_length(PointerRNA *ptr) { @@ -429,10 +429,12 @@ static void rna_def_sequence(BlenderRNA *brna) prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MUTE); RNA_def_property_ui_text(prop, "Mute", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "frame_locked", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_IPO_FRAME_LOCKED); RNA_def_property_ui_text(prop, "Frame Locked", "Lock the animation curve to the global frame counter."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_LOCK); @@ -450,45 +452,53 @@ static void rna_def_sequence(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "start"); RNA_def_property_ui_text(prop, "Start Frame", ""); RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_start_frame_set",NULL); // overlap tests and calc_seq_disp + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "start_offset", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "startofs"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_ui_text(prop, "Start Offset", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "end_offset", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "endofs"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_ui_text(prop, "End offset", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "start_still", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "startstill"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "Start Still", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "end_still", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "endstill"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); // overlap tests RNA_def_property_range(prop, 0, MAXFRAME); RNA_def_property_ui_text(prop, "End Still", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "channel", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "machine"); RNA_def_property_ui_text(prop, "Channel", "Y position of the sequence strip."); RNA_def_property_int_funcs(prop, NULL, "rna_SequenceEditor_channel_set",NULL); // overlap test + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); /* blending */ prop= RNA_def_property(srna, "blend_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, blend_mode_items); RNA_def_property_ui_text(prop, "Blend Mode", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "blend_opacity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Blend Opacity", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); - /* funcsions */ + /* functions */ func= RNA_def_function(srna, "getStripElem", "give_stripelem"); RNA_def_function_ui_description(func, "Return the strip element from a given frame or None."); prop= RNA_def_int(func, "frame", 0, INT_MIN, INT_MAX, "Frame", "The frame to get the strip element from", INT_MIN, INT_MAX); @@ -539,58 +549,71 @@ static void rna_def_filter_video(StructRNA *srna) prop= RNA_def_property(srna, "premultiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_PREMUL); RNA_def_property_ui_text(prop, "Premultiply", "Convert RGB from key alpha to premultiplied alpha."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "flip_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPX); RNA_def_property_ui_text(prop, "Flip X", "Flip on the X axis."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "flip_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_FLIPY); RNA_def_property_ui_text(prop, "Flip Y", "Flip on the Y axis."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "convert_float", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MAKE_FLOAT); RNA_def_property_ui_text(prop, "Convert Float", "Convert input to float data."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "reverse_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_REVERSE_FRAMES); RNA_def_property_ui_text(prop, "Flip Time", "Reverse frame order."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "multiply_colors", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "mul"); RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_ui_text(prop, "Multiply Colors", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "strobe", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 1.0f, 30.0f); RNA_def_property_ui_text(prop, "Strobe", "Only display every nth frame."); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_color_balance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_COLOR_BALANCE); RNA_def_property_ui_text(prop, "Use Color Balance", "(3-Way color correction) on input."); RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_color_balance_set"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "color_balance", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->color_balance"); RNA_def_property_ui_text(prop, "Color Balance", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_translation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_TRANSFORM); RNA_def_property_ui_text(prop, "Use Translation", "Translate image before processing."); RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_translation_set"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "transform", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->transform"); RNA_def_property_ui_text(prop, "Transform", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "use_crop", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_CROP); RNA_def_property_ui_text(prop, "Use Crop", "Crop image before processing."); RNA_def_property_boolean_funcs(prop, NULL, "rna_SequenceEditor_use_crop_set"); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); prop= RNA_def_property(srna, "crop", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "strip->crop"); RNA_def_property_ui_text(prop, "Crop", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_filter_sound(StructRNA *srna) @@ -960,6 +983,7 @@ static void rna_def_solid_color(BlenderRNA *brna) prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "col"); RNA_def_property_ui_text(prop, "Color", ""); + RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, NULL); } static void rna_def_speed_control(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index b29186513f8..ded954bf563 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -547,23 +547,28 @@ static void rna_def_space_3dview(BlenderRNA *brna) prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR); RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "manipulator_translate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_TRANSLATE); RNA_def_property_ui_text(prop, "Manipulator Translate", "Use the manipulator for movement transformations."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "manipulator_rotate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_ROTATE); RNA_def_property_ui_text(prop, "Manipulator Rotate", "Use the manipulator for rotation transformations."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "manipulator_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twtype", V3D_MANIP_SCALE); RNA_def_property_ui_text(prop, "Manipulator Scale", "Use the manipulator for scale transformations."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); prop= RNA_def_property(srna, "transform_orientation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "twmode"); RNA_def_property_enum_items(prop, transform_orientation_items); RNA_def_property_ui_text(prop, "Transform Orientation", "The alignment of manipulator handles."); + RNA_def_property_update(prop, NC_OBJECT|ND_TRANSFORM, NULL); } @@ -729,13 +734,13 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "mainb"); RNA_def_property_enum_items(prop, display_mode_items); RNA_def_property_ui_text(prop, "Display Mode", "The view mode to use for displaying sequencer output."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); /* flag's */ prop= RNA_def_property(srna, "draw_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAWFRAMES); RNA_def_property_ui_text(prop, "Draw Frames", "Draw frames rather then seconds."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "transform_markers", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_MARKER_TRANS); @@ -743,18 +748,18 @@ static void rna_def_space_sequencer(BlenderRNA *brna) prop= RNA_def_property(srna, "seperate_color_preview", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_COLOR_SEPERATED); - RNA_def_property_ui_text(prop, "Transform Markers", "Seperate color channels in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_ui_text(prop, "Seperate Colors", "Seperate color channels in preview."); + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "draw_safe_margin", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_SAFE_MARGINS); RNA_def_property_ui_text(prop, "Safe Margin", "Draw title safe margins in preview."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "use_grease_pencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_DRAW_GPENCIL); RNA_def_property_ui_text(prop, "Use Grease Pencil", "Display and edit the grease pencil freehand annotations overlay."); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); /* grease pencil */ prop= RNA_def_property(srna, "grease_pencil", PROP_POINTER, PROP_NONE); @@ -766,13 +771,13 @@ static void rna_def_space_sequencer(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "chanshown"); RNA_def_property_ui_text(prop, "Display Channel", "The channel number shown in the image preview. 0 is the result of all strips combined."); RNA_def_property_range(prop, 0, 32); // MAXSEQ --- todo, move from BKE_sequence.h - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); prop= RNA_def_property(srna, "draw_overexposed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "zebra"); RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes."); RNA_def_property_range(prop, 0, 110); - RNA_def_property_update(prop, ND_SEQUENCER|ND_DISPLAY, NULL); // review notifier + RNA_def_property_update(prop, ND_SEQUENCER|NC_WINDOW, NULL); /* not sure we need rna access to these but adding anyway */ diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index eef221e45a4..9da8c8b2df3 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -607,6 +607,10 @@ static void rna_def_panel(BlenderRNA *brna) prop= RNA_def_property(srna, "default_closed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED); RNA_def_property_flag(prop, PROP_REGISTER); + + prop= RNA_def_property(srna, "no_header", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_NO_HEADER); + RNA_def_property_flag(prop, PROP_REGISTER); } static void rna_def_header(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index f8ab3a86744..9c9c256e819 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -69,23 +69,23 @@ EnumPropertyItem event_type_items[] = { {YKEY, "Y", 0, "Y", ""}, {ZKEY, "Z", 0, "Z", ""}, - {ZEROKEY, "ZERO", 0, "Zero Key", ""}, - {ONEKEY, "ONE", 0, "One Key", ""}, - {TWOKEY, "TWO", 0, "Two Key", ""}, - {THREEKEY, "THREE", 0, "Three Key", ""}, - {FOURKEY, "FOUR", 0, "Four Key", ""}, - {FIVEKEY, "FIVE", 0, "Five Key", ""}, - {SIXKEY, "SIX", 0, "Six Key", ""}, - {SEVENKEY, "SEVEN", 0, "Seven Key", ""}, - {EIGHTKEY, "EIGHT", 0, "Eight Key", ""}, - {NINEKEY, "NINE", 0, "Nine Key", ""}, + {ZEROKEY, "ZERO", 0, "0", ""}, + {ONEKEY, "ONE", 0, "1", ""}, + {TWOKEY, "TWO", 0, "2", ""}, + {THREEKEY, "THREE", 0, "3", ""}, + {FOURKEY, "FOUR", 0, "4", ""}, + {FIVEKEY, "FIVE", 0, "5", ""}, + {SIXKEY, "SIX", 0, "6", ""}, + {SEVENKEY, "SEVEN", 0, "7", ""}, + {EIGHTKEY, "EIGHT", 0, "8", ""}, + {NINEKEY, "NINE", 0, "9", ""}, {LEFTCTRLKEY, "LEFT_CTRL", 0, "Left Ctrl", ""}, {LEFTALTKEY, "LEFT_ALT", 0, "Left Alt", ""}, + {LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Left Shift", ""}, {RIGHTALTKEY, "RIGHT_ALT", 0, "Right Alt", ""}, - {RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Rightctrl", ""}, - {RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Rightshift", ""}, - {LEFTSHIFTKEY, "LEFT_SHIFT", 0, "Leftshift", ""}, + {RIGHTCTRLKEY, "RIGHT_CTRL", 0, "Right Ctrl", ""}, + {RIGHTSHIFTKEY, "RIGHT_SHIFT", 0, "Right Shift", ""}, {ESCKEY, "ESC", 0, "Esc", ""}, {TABKEY, "TAB", 0, "Tab", ""}, @@ -94,17 +94,17 @@ EnumPropertyItem event_type_items[] = { {LINEFEEDKEY, "LINE_FEED", 0, "Line Feed", ""}, {BACKSPACEKEY, "BACK_SPACE", 0, "Back Space", ""}, {DELKEY, "DEL", 0, "Delete", ""}, - {SEMICOLONKEY, "SEMI_COLON", 0, "Semicolon", ""}, - {PERIODKEY, "PERIOD", 0, "Period", ""}, - {COMMAKEY, "COMMA", 0, "Comma", ""}, - {QUOTEKEY, "QUOTE", 0, "Quote", ""}, - {ACCENTGRAVEKEY, "ACCENT_GRAVE", 0, "Accentgrave", ""}, - {MINUSKEY, "MINUS", 0, "Minus", ""}, - {SLASHKEY, "SLASH", 0, "Slash", ""}, - {BACKSLASHKEY, "BACK_SLASH", 0, "Backslash", ""}, - {EQUALKEY, "EQUAL", 0, "Equal", ""}, - {LEFTBRACKETKEY, "LEFT_BRACKET", 0, "Leftbracket", ""}, - {RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "Rightbracket", ""}, + {SEMICOLONKEY, "SEMI_COLON", 0, ";", ""}, + {PERIODKEY, "PERIOD", 0, ".", ""}, + {COMMAKEY, "COMMA", 0, ",", ""}, + {QUOTEKEY, "QUOTE", 0, "\"", ""}, + {ACCENTGRAVEKEY, "ACCENT_GRAVE", 0, "`", ""}, + {MINUSKEY, "MINUS", 0, "-", ""}, + {SLASHKEY, "SLASH", 0, "/", ""}, + {BACKSLASHKEY, "BACK_SLASH", 0, "\\", ""}, + {EQUALKEY, "EQUAL", 0, "=", ""}, + {LEFTBRACKETKEY, "LEFT_BRACKET", 0, "]", ""}, + {RIGHTBRACKETKEY, "RIGHT_BRACKET", 0, "[", ""}, {LEFTARROWKEY, "LEFT_ARROW", 0, "Left Arrow", ""}, {DOWNARROWKEY, "DOWN_ARROW", 0, "Down Arrow", ""}, {RIGHTARROWKEY, "RIGHT_ARROW", 0, "Right Arrow", ""}, diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index f5eb81e3cea..67328455a77 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -377,7 +377,7 @@ void RNA_def_world(BlenderRNA *brna) prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_range(prop, 0.2, 5.0); - RNA_def_property_ui_text(prop, "Range", "The color rage that will be mapped to 0-1"); + RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1."); /* sky type */ prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE); |