diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-06-14 16:06:21 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-06-14 16:06:21 +0400 |
commit | 8ff0c2e10720bd6e583a6b133b75e7bdff27a5f8 (patch) | |
tree | 9c7e15d27d1b53af6ee9f428c9db7d855f013807 /source/blender/makesrna/intern | |
parent | 7272bb643c379986c7332a994ce9e576d3b8a748 (diff) | |
parent | 23e2bfed239256994a6daf2ca5a08298e7029681 (diff) |
Merge with trunk r37475.
Diffstat (limited to 'source/blender/makesrna/intern')
18 files changed, 202 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index cc18d8d9d0d..91f88a26987 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -755,6 +755,11 @@ int RNA_property_flag(PropertyRNA *prop) return rna_ensure_property(prop)->flag; } +void *RNA_property_py_data_get(PropertyRNA *prop) +{ + return prop->py_data; +} + int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop) { return rna_ensure_property_array_length(ptr, prop); @@ -1344,7 +1349,14 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR /* ideally no context would be needed for update, but there's some parts of the code that need it still, so we have this exception */ if(prop->flag & PROP_CONTEXT_UPDATE) { - if(C) ((ContextUpdateFunc)prop->update)(C, ptr); + if(C) { + if(prop->flag & PROP_CONTEXT_PROPERTY_UPDATE) { + ((ContextPropUpdateFunc)prop->update)(C, ptr, prop); + } + else { + ((ContextUpdateFunc)prop->update)(C, ptr); + } + } } else prop->update(bmain, scene, ptr); diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 656dbc53656..75c884a5fbb 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -927,6 +927,13 @@ static void rna_def_camera_actuator(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Max", ""); RNA_def_property_update(prop, NC_LOGIC, NULL); + prop= RNA_def_property(srna, "damping", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "damping"); + RNA_def_property_range(prop, 0, 10.0); + RNA_def_property_ui_range(prop, 0, 5.0, 1, 2); + RNA_def_property_ui_text(prop, "Damping", "Specify the strength of the constraint that drive the camera behind the target"); + RNA_def_property_update(prop, NC_LOGIC, NULL); + /* x/y */ prop= RNA_def_property(srna, "axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axis"); diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 1705e2e5376..37912f810fc 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -133,7 +133,7 @@ void RNA_def_camera(BlenderRNA *brna) prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ortho_scale"); - RNA_def_property_range(prop, 0.01f, 1000.0f); + RNA_def_property_range(prop, 0.01f, 4000.0f); RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index 92c762098c7..db5409bf7ef 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -87,6 +87,20 @@ static void rna_Controller_type_set(struct PointerRNA *ptr, int value) } } +static void rna_Controller_mode_set(struct PointerRNA *ptr, int value) +{ + bController *cont= (bController *)ptr->data; + bPythonCont *pycon= (bPythonCont *)cont->data; + + // if mode changed and previous mode were Script + if (value != pycon->mode && pycon->mode == CONT_PY_SCRIPT) + { + // clear script to avoid it to get linked with the controller + pycon->text = NULL; + } + pycon->mode = value; +} + static int rna_Controller_state_number_get(struct PointerRNA *ptr) { bController *cont= (bController *)ptr->data; @@ -222,6 +236,7 @@ void RNA_def_controller(BlenderRNA *brna) prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, python_controller_modes); + RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL); RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)"); RNA_def_property_update(prop, NC_LOGIC, NULL); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 66d1036ec44..8e9c7e287d6 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -1839,6 +1839,11 @@ void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func) prop->update= (UpdateFunc)func; } +void RNA_def_property_update_runtime(PropertyRNA *prop, void *func) +{ + prop->update= func; +} + void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getlength) { if(!DefRNA.preprocess) { @@ -2057,6 +2062,11 @@ void RNA_def_property_srna(PropertyRNA *prop, const char *type) prop->srna= (StructRNA*)type; } +void RNA_def_py_data(PropertyRNA *prop, void *py_data) +{ + prop->py_data= py_data; +} + /* Compact definitions */ PropertyRNA *RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, int default_value, const char *ui_name, const char *ui_description) @@ -2822,6 +2832,7 @@ void RNA_def_property_free_pointers(PropertyRNA *prop) if(prop->identifier) MEM_freeN((void*)prop->identifier); if(prop->name) MEM_freeN((void*)prop->name); if(prop->description) MEM_freeN((void*)prop->description); + if(prop->py_data) MEM_freeN(prop->py_data); switch(prop->type) { case PROP_BOOLEAN: { diff --git a/source/blender/makesrna/intern/rna_fluidsim.c b/source/blender/makesrna/intern/rna_fluidsim.c index 7c93ae4168b..1ba2e32502f 100644 --- a/source/blender/makesrna/intern/rna_fluidsim.c +++ b/source/blender/makesrna/intern/rna_fluidsim.c @@ -312,7 +312,7 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) /* advanced settings */ prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); - RNA_def_property_float_sdna(prop, NULL, "gravx"); + RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -1000.1, 1000.1); RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction"); @@ -384,6 +384,12 @@ static void rna_def_fluidsim_domain(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur"); + /* no collision object surface */ + prop= RNA_def_property(srna, "surface_noobs", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSSG_NOOBS); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); + RNA_def_property_ui_text(prop, "Hide fluid surface", ""); + /* particles */ prop= RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_group.c b/source/blender/makesrna/intern/rna_group.c index a5097cc8b41..5d71d204a72 100644 --- a/source/blender/makesrna/intern/rna_group.c +++ b/source/blender/makesrna/intern/rna_group.c @@ -95,7 +95,7 @@ static void rna_def_group_objects(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_ui_description(func, "Add this object to a group"); /* object to add */ parm= RNA_def_pointer(func, "object", "Object", "", "Object to add."); - RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); /* remove object */ func= RNA_def_function(srna, "unlink", "rna_Group_objects_unlink"); diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 771d2afcd96..249833ae94b 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -62,6 +62,7 @@ struct Scene; /* Function Callbacks */ typedef void (*UpdateFunc)(struct Main *main, struct Scene *scene, struct PointerRNA *ptr); +typedef void (*ContextPropUpdateFunc)(struct bContext *C, struct PointerRNA *ptr, struct PropertyRNA *prop); typedef void (*ContextUpdateFunc)(struct bContext *C, struct PointerRNA *ptr); typedef int (*EditableFunc)(struct PointerRNA *ptr); typedef int (*ItemEditableFunc)(struct PointerRNA *ptr, int index); @@ -177,6 +178,10 @@ struct PropertyRNA { * any property can have this but should only be used for collections and arrays * since python will convert int/bool/pointer's */ struct StructRNA *srna; /* attributes attached directly to this collection */ + + /* python handle to hold all callbacks + * (in a pointer array at the moment, may later be a tuple) */ + void *py_data; }; /* Property Types */ diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 2d3c3fe7a3a..479e449958b 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -40,6 +40,9 @@ #include "WM_types.h" +#include "BLI_math_base.h" +#include "BLI_math_rotation.h" + #ifdef RNA_RUNTIME #include "DNA_scene_types.h" @@ -912,6 +915,20 @@ static void rna_TextureFace_image_set(PointerRNA *ptr, PointerRNA value) tf->tpage= (struct Image*)id; } +static void rna_Mesh_auto_smooth_angle_set(PointerRNA *ptr, float value) +{ + Mesh *me= (Mesh*)ptr->id.data; + value= RAD2DEGF(value); + CLAMP(value, 1.0f, 80.0f); + me->smoothresh= (int)value; +} + +static float rna_Mesh_auto_smooth_angle_get(PointerRNA *ptr) +{ + Mesh *me= (Mesh*)ptr->id.data; + return DEG2RADF((float)me->smoothresh); +} + static int rna_MeshFace_verts_get_length(PointerRNA *ptr, int length[RNA_MAX_ARRAY_DIMENSION]) { MFace *face= (MFace*)ptr->data; @@ -1913,9 +1930,15 @@ static void rna_def_mesh(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", ME_AUTOSMOOTH); RNA_def_property_ui_text(prop, "Auto Smooth", "Treats all set-smoothed faces with angles less than the specified angle as 'smooth' during render"); +#if 1 /* expose as radians */ + prop= RNA_def_property(srna, "auto_smooth_angle", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_funcs(prop, "rna_Mesh_auto_smooth_angle_get", "rna_Mesh_auto_smooth_angle_set", NULL); + RNA_def_property_ui_range(prop, DEG2RAD(1.0), DEG2RAD(80), 1.0, 1); +#else prop= RNA_def_property(srna, "auto_smooth_angle", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "smoothresh"); RNA_def_property_range(prop, 1, 80); +#endif RNA_def_property_ui_text(prop, "Auto Smooth Angle", "Defines maximum angle between face normals that 'Auto Smooth' will operate on"); prop= RNA_def_property(srna, "show_double_sided", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 75f3f1ef238..ff277b6d9b0 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -578,6 +578,34 @@ static void rna_UVProjectModifier_num_projectors_set(PointerRNA *ptr, int value) md->projectors[a]= NULL; } +static float rna_EdgeSplitModifier_split_angle_get(PointerRNA *ptr) +{ + EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data; + return DEG2RADF(md->split_angle); +} + +static void rna_EdgeSplitModifier_split_angle_set(PointerRNA *ptr, float value) +{ + EdgeSplitModifierData *md= (EdgeSplitModifierData*)ptr->data; + value= RAD2DEGF(value); + CLAMP(value, 0.0f, 180.0f); + md->split_angle= (int)value; +} + +static float rna_BevelModifier_angle_limit_get(PointerRNA *ptr) +{ + BevelModifierData *md= (BevelModifierData*)ptr->data; + return DEG2RADF(md->bevel_angle); +} + +static void rna_BevelModifier_angle_limit_set(PointerRNA *ptr, float value) +{ + BevelModifierData *md= (BevelModifierData*)ptr->data; + value= RAD2DEGF(value); + CLAMP(value, 0.0f, 180.0f); + md->bevel_angle= (int)value; +} + #else static void rna_def_property_subdivision_common(StructRNA *srna, const char type[]) @@ -1365,10 +1393,16 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna) RNA_def_struct_sdna(srna, "EdgeSplitModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT); - // XXX, convert to radians. +#if 1 /* expose as radians */ + prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_funcs(prop, "rna_EdgeSplitModifier_split_angle_get", "rna_EdgeSplitModifier_split_angle_set", NULL); + RNA_def_property_range(prop, 0, DEG2RAD(180)); + RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2); +#else prop= RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0, 180); RNA_def_property_ui_range(prop, 0, 180, 100, 2); +#endif RNA_def_property_ui_text(prop, "Split Angle", "Angle above which to split edges"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); @@ -1965,10 +1999,17 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Edge Weight Method", "What edge weight to use for weighting a vertex"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); +#if 1 /* expose as radians */ + prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_funcs(prop, "rna_BevelModifier_angle_limit_get", "rna_BevelModifier_angle_limit_set", NULL); + RNA_def_property_range(prop, 0, DEG2RAD(180)); + RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2); +#else prop= RNA_def_property(srna, "angle_limit", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bevel_angle"); RNA_def_property_range(prop, 0, 180); RNA_def_property_ui_range(prop, 0, 180, 100, 2); +#endif RNA_def_property_ui_text(prop, "Angle", "Angle above which to bevel edges"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index d0b60c7f153..7fd6a9dacfe 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2221,6 +2221,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "gamma"); RNA_def_property_array(prop, 3); RNA_def_property_float_array_default(prop, default_1); + RNA_def_property_range(prop, 0.f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Power", "Correction for Midtones"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); @@ -2229,6 +2230,7 @@ static void def_cmp_colorbalance(StructRNA *srna) RNA_def_property_float_sdna(prop, NULL, "gain"); RNA_def_property_array(prop, 3); RNA_def_property_float_array_default(prop, default_1); + RNA_def_property_range(prop, 0.f, FLT_MAX); RNA_def_property_ui_range(prop, 0, 2, 0.1, 3); RNA_def_property_ui_text(prop, "Slope", "Correction for Highlights"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 9305380d06c..8ee8652e2e5 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -454,6 +454,14 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value) BKE_report(NULL, RPT_ERROR, "Cannot set dupli-group as object belongs in group being instanced thus causing a cycle"); } +void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value) +{ + Object *ob= (Object *)ptr->id.data; + bDeformGroup *dg= (bDeformGroup *)ptr->data; + BLI_strncpy(dg->name, value, sizeof(dg->name)); + defgroup_unique_name(dg, ob); +} + static int rna_VertexGroup_index_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; @@ -1236,6 +1244,7 @@ static void rna_def_vertex_group(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Vertex group name"); RNA_def_struct_name_property(srna, prop); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set"); RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 84bb624b546..b4da3a02442 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -493,6 +493,13 @@ static int rna_Property_is_hidden_get(PointerRNA *ptr) return prop->flag & PROP_HIDDEN ? 1:0; } +static int rna_Property_is_skip_save_get(PointerRNA *ptr) +{ + PropertyRNA *prop= (PropertyRNA*)ptr->data; + return prop->flag & PROP_SKIP_SAVE ? 1:0; +} + + static int rna_Property_is_enum_flag_get(PointerRNA *ptr) { PropertyRNA *prop= (PropertyRNA*)ptr->data; @@ -1037,6 +1044,11 @@ static void rna_def_property(BlenderRNA *brna) RNA_def_property_boolean_funcs(prop, "rna_Property_is_hidden_get", NULL); RNA_def_property_ui_text(prop, "Hidden", "True when the property is hidden"); + prop= RNA_def_property(srna, "is_skip_save", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_boolean_funcs(prop, "rna_Property_is_skip_save_get", NULL); + RNA_def_property_ui_text(prop, "Skip Save", "True when the property is not saved in presets"); + prop= RNA_def_property(srna, "is_output", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Property_use_output_get", NULL); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 72ec09a61fe..145a58ecf0f 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2812,6 +2812,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 1000.0); RNA_def_property_ui_text(prop, "Bias", "Bias towards faces further away from the object (in blender units)"); + prop= RNA_def_property(srna, "use_bake_multires", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_MULTIRES); + RNA_def_property_ui_text(prop, "Bake from Multires", "Bake directly from multires object"); + + prop= RNA_def_property(srna, "use_bake_lores_mesh", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "bake_flag", R_BAKE_LORES_MESH); + RNA_def_property_ui_text(prop, "Low Resolution Mesh", "Calculate heights against unsubdivided low resolution mesh"); + /* stamp */ prop= RNA_def_property(srna, "use_stamp_time", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 4171189d928..8c4e4d9e736 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -680,6 +680,23 @@ static void rna_SequenceEditor_overlay_frame_set(PointerRNA *ptr, int value) ed->over_ofs= value; } + +static void rna_WipeSequence_angle_set(PointerRNA *ptr, float value) +{ + Sequence *seq= (Sequence *)(ptr->data); + value= RAD2DEGF(value); + CLAMP(value, -90.0f, 90.0f); + ((WipeVars *)seq->effectdata)->angle= value; +} + +static float rna_WipeSequence_angle_get(PointerRNA *ptr) +{ + Sequence *seq= (Sequence *)(ptr->data); + + return DEG2RADF(((WipeVars *)seq->effectdata)->angle); +} + + #else static void rna_def_strip_element(BlenderRNA *brna) @@ -1460,10 +1477,16 @@ static void rna_def_wipe(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Blur Width", "Width of the blur edge, in percentage relative to the image size"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); - + +#if 1 /* expose as radians */ + prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_funcs(prop, "rna_WipeSequence_angle_get", "rna_WipeSequence_angle_set", NULL); + RNA_def_property_range(prop, DEG2RAD(-90.0f), DEG2RAD(90.0f)); +#else prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "angle"); RNA_def_property_range(prop, -90.0f, 90.0f); +#endif RNA_def_property_ui_text(prop, "Angle", "Edge angle"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 3a80207ba15..9e3a31ddb2e 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -135,6 +135,7 @@ static void rna_Texture_update(Main *bmain, Scene *scene, PointerRNA *ptr) DAG_id_tag_update(&tex->id, 0); WM_main_add_notifier(NC_TEXTURE, tex); + WM_main_add_notifier(NC_MATERIAL|ND_SHADING_DRAW, NULL); } static void rna_Texture_voxeldata_update(Main *bmain, Scene *scene, PointerRNA *ptr) diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 12df0b5dbd7..cb50b99c05d 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -69,6 +69,13 @@ static void rna_userdef_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Pointe WM_main_add_notifier(NC_WINDOW, NULL); } +static void rna_userdef_dpi_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + U.widget_unit = (U.dpi * 20 + 36)/72; + WM_main_add_notifier(NC_WINDOW, NULL); /* full redraw */ + WM_main_add_notifier(NC_SCREEN|NA_EDITED, NULL); /* refresh region sizes */ +} + static void rna_userdef_show_manipulator_update(Main *bmain, Scene *scene, PointerRNA *ptr) { UserDef *userdef = (UserDef *)ptr->data; @@ -238,6 +245,13 @@ static void rna_UserDef_weight_color_update(Main *bmain, Scene *scene, PointerRN static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, PointerRNA *ptr) { + /* if all lights are off gpu_draw resets them all, [#27627] + * so disallow them all to be disabled */ + if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0) { + SolidLight *light= ptr->data; + light->flag |= 1; + } + WM_main_add_notifier(NC_SPACE|ND_SPACE_VIEW3D|NS_VIEW3D_GPU, NULL); rna_userdef_update(bmain, scene, ptr); } @@ -2444,7 +2458,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "dpi"); RNA_def_property_range(prop, 48, 128); RNA_def_property_ui_text(prop, "DPI", "Font size and resolution for display"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); + RNA_def_property_update(prop, 0, "rna_userdef_dpi_update"); prop= RNA_def_property(srna, "scrollback", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "scrollback"); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 406ee6b3f3e..7ea4701dec3 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -272,10 +272,11 @@ EnumPropertyItem keymap_modifiers_items[] = { EnumPropertyItem operator_flag_items[] = { {OPTYPE_REGISTER, "REGISTER", 0, "Register", ""}, {OPTYPE_UNDO, "UNDO", 0, "Undo", ""}, - {OPTYPE_BLOCKING, "BLOCKING", 0, "Finished", ""}, + {OPTYPE_BLOCKING, "BLOCKING", 0, "Blocking", ""}, {OPTYPE_MACRO, "MACRO", 0, "Macro", ""}, {OPTYPE_GRAB_POINTER, "GRAB_POINTER", 0, "Grab Pointer", ""}, {OPTYPE_PRESET, "PRESET", 0, "Preset", ""}, + {OPTYPE_INTERNAL, "INTERNAL", 0, "Internal", ""}, {0, NULL, 0, NULL, NULL}}; EnumPropertyItem operator_return_items[] = { @@ -1047,6 +1048,7 @@ static StructRNA* rna_MacroOperator_refine(PointerRNA *opr) static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) { // wmWindowManager *wm = CTX_wm_manager(C); + char idname_bl[OP_MAX_TYPENAME]; int modifier= 0; /* only on non-modal maps */ @@ -1055,6 +1057,8 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons return NULL; } + WM_operator_bl_idname(idname_bl, idname); + if(shift) modifier |= KM_SHIFT; if(ctrl) modifier |= KM_CTRL; if(alt) modifier |= KM_ALT; @@ -1062,7 +1066,7 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons if(any) modifier = KM_ANY; - return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier); + return WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier); } static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) |