From 99aec11acf7fc2b84559fa7903e023f677d312d6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 16 Apr 2011 10:19:34 +0000 Subject: changing the gl texture limit wasn't updating the displayed sizes. --- source/blender/makesrna/intern/rna_userdef.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 50a52858d93..84a6725807a 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -110,6 +110,12 @@ static void rna_userdef_mipmap_update(Main *bmain, Scene *scene, PointerRNA *ptr rna_userdef_update(bmain, scene, ptr); } +static void rna_userdef_gl_texture_limit_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + GPU_free_images(); + rna_userdef_update(bmain, scene, ptr); +} + static void rna_userdef_select_mouse_set(PointerRNA *ptr,int value) { UserDef *userdef = (UserDef*)ptr->data; @@ -2549,7 +2555,7 @@ static void rna_def_userdef_system(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "glreslimit"); RNA_def_property_enum_items(prop, gl_texture_clamp_items); RNA_def_property_ui_text(prop, "GL Texture Limit", "Limit the texture size to save graphics memory"); - RNA_def_property_update(prop, 0, "rna_userdef_mipmap_update"); + RNA_def_property_update(prop, 0, "rna_userdef_gl_texture_limit_update"); prop= RNA_def_property(srna, "texture_time_out", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "textimeout"); -- cgit v1.2.3 From 69f9104ea79e629119821ad6526c8e4293ac1f66 Mon Sep 17 00:00:00 2001 From: "M.G. Kishalmi" Date: Sun, 17 Apr 2011 08:38:27 +0000 Subject: fix #26957 spotlights halo and intensity tooltip had "(buffer shadow)" in there, while it works just fine with no-shadow and ray-shadow. the volumetric "step" property is only visible with buffershadows anyways. --- source/blender/makesrna/intern/rna_lamp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index dbb068c9cf0..d1679a19d8c 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -607,13 +607,13 @@ static void rna_def_spot_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_HALO); - RNA_def_property_ui_text(prop, "Halo", "Renders spotlight with a volumetric halo (Buffer Shadows)"); + RNA_def_property_ui_text(prop, "Halo", "Renders spotlight with a volumetric halo"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "halo_intensity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "haint"); RNA_def_property_ui_range(prop, 0, 5.0, 0.1, 3); - RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone (Buffer Shadows)"); + RNA_def_property_ui_text(prop, "Halo Intensity", "Brightness of the spotlight's halo cone"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop= RNA_def_property(srna, "halo_step", PROP_INT, PROP_NONE); -- cgit v1.2.3 From d00f664ee0c042569900110db21d567c21c391db Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 17 Apr 2011 12:13:02 +0000 Subject: Fix #26989: Smooth tangent Iteration field in Curve panel not responding. Not sure what's the uint of step argument for RNA_def_property_ui_range, but i just set the same values as in other cases used (like Camera.draw_size) --- source/blender/makesrna/intern/rna_curve.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 03314bca6a3..ec0f9277653 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1355,7 +1355,7 @@ static void rna_def_curve(BlenderRNA *brna) // XXX - would be nice to have a better way to do this, only add for testing. prop= RNA_def_property(srna, "twist_smooth", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "twist_smooth"); - RNA_def_property_ui_range(prop, 0, 100.0, 0.1, 0); + RNA_def_property_ui_range(prop, 0, 100.0, 1, 2); RNA_def_property_ui_text(prop, "Twist Smooth", "Smoothing iteration for tangents"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); -- cgit v1.2.3 From d95e572227418c3119a7dc91a605dcc2c10c5237 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Apr 2011 01:40:45 +0000 Subject: fix [#26995] Crash on bpy.context.object.collision use object.collision rather then object.modifiers[...].settings --- source/blender/makesrna/intern/rna_object_force.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 9aedcab1301..13fac68bf9f 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -322,10 +322,21 @@ static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max) static char *rna_CollisionSettings_path(PointerRNA *ptr) { + /* both methods work ok, but return the shorter path */ +#if 0 Object *ob= (Object*)ptr->id.data; ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Collision); - - return BLI_sprintfN("modifiers[\"%s\"].settings", md->name); + + if(md) { + return BLI_sprintfN("modifiers[\"%s\"].settings", md->name); + } + else { + return BLI_strdup(""); + } +#else + /* more reliable */ + return BLI_strdup("collision"); +#endif } static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr) -- cgit v1.2.3 From 66bf6487dfc624c1423053cd570bbe720ae20cf2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Apr 2011 01:45:28 +0000 Subject: object.collision was allocating on access for all object types - camera could get collision data for eg. now check for mesh types only. any other type will return None. --- source/blender/makesrna/intern/rna_object.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index babc413e274..a30b5d4eb05 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1059,6 +1059,9 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; + if(ob->type != OB_MESH) + return PointerRNA_NULL; + /* weak */ if(!ob->pd) ob->pd= object_add_collision_fields(0); -- cgit v1.2.3 From 5b920bc2ff1e78767842b13f6997298b7e438204 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 19 Apr 2011 06:59:49 +0000 Subject: Some strings to store ID names were too small, could cause stack corruption. corrected these and replaced 'sizeof(((ID *)NULL)->name)-2' with 'MAX_ID_NAME-2'. --- source/blender/makesrna/intern/rna_ID.c | 2 +- source/blender/makesrna/intern/rna_curve.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index ae62ef55c01..bde7c99c7df 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -443,7 +443,7 @@ static void rna_def_ID(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Unique datablock ID name"); RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set"); - RNA_def_property_string_maxlength(prop, sizeof(((ID*)NULL)->name)-2); + RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); RNA_def_property_editable_func(prop, "rna_ID_name_editable"); RNA_def_property_update(prop, NC_ID|NA_RENAME, NULL); RNA_def_struct_name_property(srna, prop); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index ec0f9277653..ec640531fa0 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -947,7 +947,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) /* strings */ prop= RNA_def_property(srna, "family", PROP_STRING, PROP_NONE); - RNA_def_property_string_maxlength(prop, (sizeof((ID *)NULL)->name)-2); + RNA_def_property_string_maxlength(prop, MAX_ID_NAME-2); RNA_def_property_ui_text(prop, "Object Font", "Use Blender Objects as font characters. Give font objects a common name followed by the character it represents, eg. familya, familyb etc, and turn on Verts Duplication"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); -- cgit v1.2.3 From 94b99b5d4a7c20cf2f4488b599e74619a7c860a6 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 19 Apr 2011 13:01:50 +0000 Subject: Bugfix [#25960] Action/NLA Editor issues with animdata context Actions now get tagged with an ID-code, which is used to determine what ID-blocks they can be assigned to. This ensures that material actions cannot be assigned to the object-level for example. * Action lists in general will now show only the actions that can be set for that particular slot. This prevents selection of invalid actions, and helps cut down the list of actions. ** An exception here is the Add Action Clip in NLA Editor, which will show all actions but will only add where appropriate. This is because it's not easy/possible to tell in advance which blocktypes to filter for when building this list. (TODO?) * The "Action Editor" is now strictly for object-level action editing+setting now. This avoids repeateded confusion by people who try using this to view their shapekey actions, which should go to the Shape Key Editor instead! ** A context switcher for the legitimate times where this capability might come in handy is still being investigated. * "Floating" actions (i.e. actions in some action_library.blend) are NOT able to be automatically tagged until they are assigned to some datablocks (i.e. loaded onto the rig + played back once). It is possible to write scripts that check for certain RNA-paths and "guess" what datablocks they work on, but it is recommended that you load up the Datablocks Viewer, and go through such actions by hand, setting the "ID Root Type" property as appropriate per action. --- source/blender/makesrna/intern/rna_action.c | 72 +++++++++++++++++++++++--- source/blender/makesrna/intern/rna_animation.c | 36 +++++++++++++ source/blender/makesrna/intern/rna_internal.h | 3 ++ source/blender/makesrna/intern/rna_nla.c | 1 + source/blender/makesrna/intern/rna_space.c | 29 ++++++++++- 5 files changed, 133 insertions(+), 8 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index 418451801ca..7fdb96fda6e 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -30,6 +30,7 @@ #include #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -194,6 +195,56 @@ static void rna_Action_frame_range_get(PointerRNA *ptr,float *values) calc_action_range(ptr->id.data, values, values+1, 1); } + +/* used to check if an action (value pointer) is suitable to be assigned to the ID-block that is ptr */ +int rna_Action_id_poll(PointerRNA *ptr, PointerRNA value) +{ + ID *srcId = (ID *)ptr->id.data; + bAction *act = (bAction *)value.id.data; + + if (act) { + /* there can still be actions that will have undefined id-root + * (i.e. floating "action-library" members) which we will not + * be able to resolve an idroot for automatically, so let these through + */ + if (act->idroot == 0) + return 1; + else if (srcId) + return GS(srcId->name) == act->idroot; + } + + return 0; +} + +/* used to check if an action (value pointer) can be assigned to Action Editor given current mode */ +int rna_Action_actedit_assign_poll(PointerRNA *ptr, PointerRNA value) +{ + SpaceAction *saction = (SpaceAction *)ptr->data; + bAction *act = (bAction *)value.id.data; + + if (act) { + /* there can still be actions that will have undefined id-root + * (i.e. floating "action-library" members) which we will not + * be able to resolve an idroot for automatically, so let these through + */ + if (act->idroot == 0) + return 1; + + if (saction) { + if (saction->mode == SACTCONT_ACTION) { + /* this is only Object-level for now... */ + return act->idroot == ID_OB; + } + else if (saction->mode == SACTCONT_SHAPEKEY) { + /* obviously shapekeys only */ + return act->idroot == ID_KE; + } + } + } + + return 0; +} + #else static void rna_def_dopesheet(BlenderRNA *brna) @@ -515,34 +566,43 @@ static void rna_def_action(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; - + srna= RNA_def_struct(brna, "Action", "ID"); RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_ui_text(srna, "Action", "A collection of F-Curves for animation"); RNA_def_struct_ui_icon(srna, ICON_ACTION); - + + /* collections */ prop= RNA_def_property(srna, "fcurves", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "curves", NULL); RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "F-Curves", "The individual F-Curves that make up the Action"); rna_def_action_fcurves(brna, prop); - + prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "groups", NULL); RNA_def_property_struct_type(prop, "ActionGroup"); RNA_def_property_ui_text(prop, "Groups", "Convenient groupings of F-Curves"); rna_def_action_groups(brna, prop); - + prop= RNA_def_property(srna, "pose_markers", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "markers", NULL); RNA_def_property_struct_type(prop, "TimelineMarker"); RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses"); rna_def_action_pose_markers(brna, prop); - + + /* properties */ prop= RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all fcurves within this action" , 0 , 0); RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get" , NULL, NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - + + /* special "type" limiter - should not really be edited in general, but is still available/editable in 'emergencies' */ + prop= RNA_def_property(srna, "id_root", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "idroot"); + RNA_def_property_enum_items(prop, id_type_items); + RNA_def_property_ui_text(prop, "ID Root Type", "Type of ID-block that action can be used on. DO NOT CHANGE UNLESS YOU KNOW WHAT YOU'RE DOING"); + + /* API calls */ RNA_api_action(srna); } diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 17d2e27c462..8e210a7a4cb 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -70,6 +70,41 @@ static int rna_AnimData_action_editable(PointerRNA *ptr) return 1; } +static void rna_AnimData_action_set(PointerRNA *ptr, PointerRNA value) +{ + ID *ownerId = (ID *)ptr->id.data; + AnimData *adt = (AnimData *)ptr->data; + + /* assume that AnimData's action can in fact be edited... */ + if ((value.data) && (ownerId)) { + bAction *act = (bAction *)value.data; + + /* action must have same type as owner */ + if (ownerId) { + if (ELEM(act->idroot, 0, GS(ownerId->name))) { + /* can set */ + adt->action = act; + } + else { + /* cannot set */ + printf("ERROR: Couldn't set Action '%s' onto ID '%s', as it doesn't have suitably rooted paths for this purpose\n", + act->id.name+2, ownerId->name); + } + } + else { + /* cannot tell if we can set, so let's just be generous... */ + printf("Warning: Set Action '%s' onto AnimData block with an unknown ID-owner. May have attached invalid data\n", + act->id.name+2); + + adt->action = act; + } + } + else { + /* just clearing the action... */ + adt->action = NULL; + } +} + /* ****************************** */ /* wrapper for poll callback */ @@ -739,6 +774,7 @@ void rna_def_animdata(BlenderRNA *brna) /* Active Action */ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */ + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll"); RNA_def_property_editable_func(prop, "rna_AnimData_action_editable"); RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock"); RNA_def_property_update(prop, NC_ANIMATION, NULL); /* this will do? */ diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 4dc98ceb0a4..1d060c8a362 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -222,6 +222,9 @@ int rna_Curve_object_poll(struct PointerRNA *ptr, struct PointerRNA value); int rna_Lattice_object_poll(struct PointerRNA *ptr, struct PointerRNA value); int rna_Mesh_object_poll(struct PointerRNA *ptr, struct PointerRNA value); +/* basic poll functions for actions (to prevent actions getting set in wrong places) */ +int rna_Action_id_poll(struct PointerRNA *ptr, struct PointerRNA value); +int rna_Action_actedit_assign_poll(struct PointerRNA *ptr, struct PointerRNA value); char *rna_TextureSlot_path(struct PointerRNA *ptr); diff --git a/source/blender/makesrna/intern/rna_nla.c b/source/blender/makesrna/intern/rna_nla.c index 09837579949..9bf5f53f8b7 100644 --- a/source/blender/makesrna/intern/rna_nla.c +++ b/source/blender/makesrna/intern/rna_nla.c @@ -426,6 +426,7 @@ static void rna_def_nlastrip(BlenderRNA *brna) /* Action */ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "act"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Action", "Action referenced by this strip"); RNA_def_property_update(prop, NC_ANIMATION|ND_NLA, NULL); /* this will do? */ diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 3d9d8a8e9f4..52fae14a023 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -644,7 +644,32 @@ static void rna_ConsoleLine_cursor_index_range(PointerRNA *ptr, int *min, int *m static void rna_SpaceDopeSheetEditor_action_set(PointerRNA *ptr, PointerRNA value) { SpaceAction *saction= (SpaceAction*)(ptr->data); - saction->action= value.data; + bAction *act = (bAction*)value.data; + + if ((act == NULL) || (act->idroot == 0)) { + /* just set if we're clearing the action or if the action is "amorphous" still */ + saction->action= act; + } + else { + /* action to set must strictly meet the mode criteria... */ + if (saction->mode == SACTCONT_ACTION) { + /* currently, this is "object-level" only, until we have some way of specifying this */ + if (act->idroot == ID_OB) + saction->action = act; + else + printf("ERROR: cannot assign Action '%s' to Action Editor, as action is not object-level animation\n", act->id.name+2); + } + else if (saction->mode == SACTCONT_SHAPEKEY) { + /* as the name says, "shapekey-level" only... */ + if (act->idroot == ID_KE) + saction->action = act; + else + printf("ERROR: cannot assign Action '%s' to Shape Key Editor, as action doesn't animate Shape Keys\n", act->id.name+2); + } + else { + printf("ACK: who's trying to set an action while not in a mode displaying a single Action only?\n"); + } + } } static void rna_SpaceDopeSheetEditor_action_update(Main *bmain, Scene *scene, PointerRNA *ptr) @@ -1771,7 +1796,7 @@ static void rna_def_space_dopesheet(BlenderRNA *brna) /* data */ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, "rna_Action_actedit_assign_poll"); RNA_def_property_ui_text(prop, "Action", "Action displayed and edited in this space"); RNA_def_property_update(prop, NC_ANIMATION|ND_KEYFRAME|NA_EDITED, "rna_SpaceDopeSheetEditor_action_update"); -- cgit v1.2.3 From aa00bbe484f832f5001883f24fa5dee262baa888 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 19 Apr 2011 13:02:49 +0000 Subject: Whitespace/typos --- source/blender/makesrna/intern/rna_gpencil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 228b00e7937..423b4e4f76b 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -309,7 +309,7 @@ static void rna_def_gpencil_data(BlenderRNA *brna) static EnumPropertyItem draw_mode_items[] = { {GP_DATA_VIEWALIGN, "CURSOR", 0, "Cursor", "Draw stroke at the 3D cursor"}, - {0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weired, GP_DATA_VIEWALIGN is inverted */ + {0, "VIEW", 0, "View", "Stick stroke to the view "}, /* weird, GP_DATA_VIEWALIGN is inverted */ {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_VIEW, "SURFACE", 0, "Surface", "Stick stroke to surfaces"}, {GP_DATA_VIEWALIGN|GP_DATA_DEPTH_STROKE, "STROKE", 0, "Stroke", "Stick stroke to other strokes"}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From e0a81dd1a836f9191685889b72ab01d12d5619c2 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Wed, 20 Apr 2011 09:41:44 +0000 Subject: This was causing too many problems. Better to just not enable this for now. There are really many good uses for this anyway. --- source/blender/makesrna/intern/rna_scene.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 0ac310d233b..acb0ffa3be2 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -3201,6 +3201,7 @@ void RNA_def_scene(BlenderRNA *brna) /* Layers */ prop= RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); // this seems to be too much trouble with depsgraph updates/etc. currently (20110420) RNA_def_property_boolean_sdna(prop, NULL, "lay", 1); RNA_def_property_array(prop, 20); RNA_def_property_boolean_funcs(prop, NULL, "rna_Scene_layer_set"); -- cgit v1.2.3 From 831cc31482aa3dc7293ea131d3ba0434bdd08d0d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 Apr 2011 23:21:26 +0000 Subject: fix [#27083] Crash on setting Voxel resolution below -3 in 8bit raw texture settings --- source/blender/makesrna/intern/rna_texture.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 82eb5d1d0c9..0bab914d3d0 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1638,6 +1638,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resol"); + RNA_def_property_range(prop, 1, INT_MAX); RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); -- cgit v1.2.3 From 26916206f80bb55d1ea71ef8108336109cebd90b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Apr 2011 00:28:05 +0000 Subject: fix [#27084] Crash when chosing non-voxel data file in voxel data texture input also found loading voxel textures wasn't closing files it opened. --- source/blender/makesrna/intern/rna_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 0bab914d3d0..d8eec152831 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1638,7 +1638,7 @@ static void rna_def_texture_voxeldata(BlenderRNA *brna) prop= RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resol"); - RNA_def_property_range(prop, 1, INT_MAX); + RNA_def_property_range(prop, 1, 100000); RNA_def_property_ui_text(prop, "Resolution", "Resolution of the voxel grid"); RNA_def_property_update(prop, 0, "rna_Texture_voxeldata_update"); -- cgit v1.2.3 From 6bb626f2532757873ff2ea9f6d2571cc5f344201 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Apr 2011 05:49:47 +0000 Subject: minor changes - remove some warnings - fix typos - cmake allow in-source build (when WITH_IN_SOURCE_BUILD is defined) - cmake, use an explicit list of rna files (don't glob) --- source/blender/makesrna/intern/CMakeLists.txt | 85 +++++++++++++++++++++++++-- 1 file changed, 80 insertions(+), 5 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 9f44c0acad3..9cafca3532f 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -30,11 +30,86 @@ remove_strict_flags() # message(STATUS "Configuring makesrna") -file(GLOB DEFSRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*.c") -file(GLOB APISRC RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*_api.c") -list(REMOVE_ITEM DEFSRC rna_access.c rna_define.c makesrna.c) -list(REMOVE_ITEM DEFSRC ${APISRC}) - +# files rna_access.c rna_define.c makesrna.c intentionally excluded. +set(DEFSRC + rna_ID.c + rna_action.c + rna_actuator.c + rna_animation.c + rna_animviz.c + rna_armature.c + rna_boid.c + rna_brush.c + rna_camera.c + rna_cloth.c + rna_color.c + rna_constraint.c + rna_context.c + rna_controller.c + rna_curve.c + rna_fcurve.c + rna_fluidsim.c + rna_gpencil.c + rna_group.c + rna_image.c + rna_key.c + rna_lamp.c + rna_lattice.c + rna_main.c + rna_material.c + rna_mesh.c + rna_meta.c + rna_modifier.c + rna_nla.c + rna_nodetree.c + rna_object.c + rna_object_force.c + rna_packedfile.c + rna_particle.c + rna_pose.c + rna_property.c + rna_render.c + rna_rna.c + rna_scene.c + rna_screen.c + rna_sculpt_paint.c + rna_sensor.c + rna_sequencer.c + rna_smoke.c + rna_sound.c + rna_space.c + rna_test.c + rna_text.c + rna_texture.c + rna_timeline.c + rna_ui.c + rna_userdef.c + rna_vfont.c + rna_wm.c + rna_world.c +) + +set(APISRC + rna_action_api.c + rna_actuator_api.c + rna_animation_api.c + rna_armature_api.c + rna_controller_api.c + rna_fcurve_api.c + rna_image_api.c + rna_main_api.c + rna_material_api.c + rna_mesh_api.c + rna_object_api.c + rna_pose_api.c + rna_scene_api.c + rna_sensor_api.c + rna_sequencer_api.c + rna_text_api.c + rna_ui_api.c + rna_wm_api.c +) + string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}") set_source_files_properties(GENSRC PROPERTIES GENERATED true) -- cgit v1.2.3 From 210ee1ade4b4ec5b6f2d3710986171a21a4b8604 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Apr 2011 13:11:51 +0000 Subject: whitespace only, no functional change mixed tabs/spaces --> tabs. --- source/blender/makesrna/intern/rna_actuator.c | 20 ++++++++++---------- source/blender/makesrna/intern/rna_constraint.c | 3 +-- source/blender/makesrna/intern/rna_fcurve.c | 6 +++--- source/blender/makesrna/intern/rna_object.c | 2 +- source/blender/makesrna/intern/rna_object_force.c | 2 +- source/blender/makesrna/intern/rna_sensor.c | 6 +++--- source/blender/makesrna/intern/rna_space.c | 8 ++++---- source/blender/makesrna/intern/rna_userdef.c | 2 +- source/blender/makesrna/intern/rna_wm.c | 2 +- 9 files changed, 25 insertions(+), 26 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 863c30f8ef2..2afba954be3 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -497,18 +497,18 @@ static void rna_Actuator_Armature_update(Main *bmain, Scene *scene, PointerRNA * /* note: the following set functions exists only to avoid id refcounting */ static void rna_Actuator_editobject_mesh_set(PointerRNA *ptr, PointerRNA value) { - bActuator *act = (bActuator *)ptr->data; - bEditObjectActuator *eoa = (bEditObjectActuator *) act->data; + bActuator *act = (bActuator *)ptr->data; + bEditObjectActuator *eoa = (bEditObjectActuator *) act->data; - eoa->me = value.data; + eoa->me = value.data; } static void rna_Actuator_action_action_set(PointerRNA *ptr, PointerRNA value) { - bActuator *act = (bActuator *)ptr->data; - bActionActuator *aa = (bActionActuator *) act->data; + bActuator *act = (bActuator *)ptr->data; + bActionActuator *aa = (bActionActuator *) act->data; - aa->act = value.data; + aa->act = value.data; } #else @@ -579,8 +579,8 @@ static void rna_def_action_actuator(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Action"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Action", ""); - /* note: custom set function is ONLY to avoid rna setting a user for this. */ - RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL); + /* note: custom set function is ONLY to avoid rna setting a user for this. */ + RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE); @@ -1811,8 +1811,8 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Action"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Action", ""); - /* note: custom set function is ONLY to avoid rna setting a user for this. */ - RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL); + /* note: custom set function is ONLY to avoid rna setting a user for this. */ + RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_action_action_set", NULL, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "use_continue_last_frame", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index d8f0abfd7e2..e57491dc36d 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1329,7 +1329,7 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", 4); RNA_def_property_ui_text(prop, "Limit Z", "Use minimum/maximum z limit"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - + prop= RNA_def_property(srna, "use_angular_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", 8); RNA_def_property_ui_text(prop, "Angular X Limit", "Use minimum/maximum x angular limit"); @@ -1344,7 +1344,6 @@ static void rna_def_constraint_rigid_body_joint(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", 32); RNA_def_property_ui_text(prop, "Angular Z Limit", "Use minimum/maximum z angular limit"); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_update"); - } static void rna_def_constraint_clamp_to(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index efb5bf0244c..1b18f88efcc 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -164,8 +164,8 @@ static void rna_DriverTarget_update_name(Main *bmain, Scene *scene, PointerRNA * /* note: this function exists only to avoid id refcounting */ static void rna_DriverTarget_id_set(PointerRNA *ptr, PointerRNA value) { - DriverTarget *dtar= (DriverTarget*)ptr->data; - dtar->id= value.data; + DriverTarget *dtar= (DriverTarget*)ptr->data; + dtar->id= value.data; } static StructRNA *rna_DriverTarget_id_typef(PointerRNA *ptr) @@ -1044,7 +1044,7 @@ static void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ID"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable"); - /* note: custom set function is ONLY to avoid rna setting a user for this. */ + /* note: custom set function is ONLY to avoid rna setting a user for this. */ RNA_def_property_pointer_funcs(prop, NULL, "rna_DriverTarget_id_set", "rna_DriverTarget_id_typef", NULL); 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_DriverTarget_update_data"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index a30b5d4eb05..436418324e2 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -101,7 +101,7 @@ EnumPropertyItem metaelem_type_items[] = { #define OBTYPE_CU_CURVE {OB_CURVE, "CURVE", 0, "Curve", ""} #define OBTYPE_CU_SURF {OB_SURF, "SURFACE", 0, "Surface", ""} #define OBTYPE_CU_FONT {OB_FONT, "FONT", 0, "Font", ""} - + EnumPropertyItem object_type_items[] = { {OB_MESH, "MESH", 0, "Mesh", ""}, OBTYPE_CU_CURVE, diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 13fac68bf9f..0619f5e19b6 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -820,7 +820,7 @@ static void rna_def_pointcache(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_EXTERNAL); RNA_def_property_ui_text(prop, "External", "Read cache from an external location"); RNA_def_property_update(prop, NC_OBJECT, "rna_Cache_idname_change"); - + prop= RNA_def_property(srna, "use_library_path", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", PTCACHE_IGNORE_LIBPATH); RNA_def_property_ui_text(prop, "Library Path", "Use this files path when library linked into another file."); diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index e19816a42f6..5bf398ae3a7 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -243,10 +243,10 @@ static void rna_Sensor_Armature_update(Main *bmain, Scene *scene, PointerRNA *pt /* note: the following set functions exists only to avoid id refcounting */ static void rna_Sensor_touch_material_set(PointerRNA *ptr, PointerRNA value) { - bSensor *sens = (bSensor *)ptr->data; - bTouchSensor *ts = (bTouchSensor *) sens->data; + bSensor *sens = (bSensor *)ptr->data; + bTouchSensor *ts = (bTouchSensor *) sens->data; - ts->ma = value.data; + ts->ma = value.data; } #else diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 52fae14a023..2e947039c16 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -544,8 +544,8 @@ static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) /* note: this function exists only to avoid id refcounting */ static void rna_SpaceProperties_pin_id_set(PointerRNA *ptr, PointerRNA value) { - SpaceButs *sbuts= (SpaceButs*)(ptr->data); - sbuts->pinid= value.data; + SpaceButs *sbuts= (SpaceButs*)(ptr->data); + sbuts->pinid= value.data; } static StructRNA *rna_SpaceProperties_pin_id_typef(PointerRNA *ptr) @@ -1443,7 +1443,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) prop= RNA_def_property(srna, "pin_id", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pinid"); RNA_def_property_struct_type(prop, "ID"); - /* note: custom set function is ONLY to avoid rna setting a user for this. */ + /* note: custom set function is ONLY to avoid rna setting a user for this. */ RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_PROPERTIES, "rna_SpaceProperties_pin_id_update"); @@ -2380,7 +2380,7 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_float_sdna(prop, NULL, "zoom"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0.01f, FLT_MAX); - RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); + RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); RNA_def_property_ui_text(prop, "Backdrop Zoom", "Backdrop zoom factor"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 84a6725807a..c21feead18f 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -1988,7 +1988,7 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_SHOW_VIEWPORTNAME); RNA_def_property_ui_text(prop, "Show View Name", "Show the name of the view's direction in each 3D View"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - + prop= RNA_def_property(srna, "show_splash", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "uiflag", USER_SPLASH_DISABLE); RNA_def_property_ui_text(prop, "Show Splash", "Display splash screen on startup"); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index a6b6ae26ca5..4c79c27e0de 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1232,7 +1232,7 @@ static void rna_def_macro_operator(BlenderRNA *brna) #ifdef WITH_PYTHON RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister"); #endif - + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL); -- cgit v1.2.3 From f9f771cd01b626be30a85a533ea622bcedd981f5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 21 Apr 2011 15:53:30 +0000 Subject: converted more mixed tab/space indentations to tabs. only whitespace changes. --- source/blender/makesrna/intern/rna_brush.c | 2 +- source/blender/makesrna/intern/rna_controller.c | 36 ++++---- source/blender/makesrna/intern/rna_image_api.c | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 60 ++++++------- source/blender/makesrna/intern/rna_object_api.c | 20 ++--- source/blender/makesrna/intern/rna_particle.c | 108 ++++++++++++------------ 6 files changed, 114 insertions(+), 114 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 74857115bc5..f3f79cde617 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -111,7 +111,7 @@ static void rna_Brush_reset_icon(Brush *br, const char *UNUSED(type)) if(id->icon_id >= BIFICONID_LAST) { BKE_icon_delete(id); BKE_previewimg_free_id(id); - } + } id->icon_id = 0; } diff --git a/source/blender/makesrna/intern/rna_controller.c b/source/blender/makesrna/intern/rna_controller.c index 12d27bc80c2..92c762098c7 100644 --- a/source/blender/makesrna/intern/rna_controller.c +++ b/source/blender/makesrna/intern/rna_controller.c @@ -56,24 +56,24 @@ static struct StructRNA* rna_Controller_refine(struct PointerRNA *ptr) bController *controller= (bController*)ptr->data; switch(controller->type) { - case CONT_LOGIC_AND: - return &RNA_AndController; - case CONT_LOGIC_OR: - return &RNA_OrController; - case CONT_LOGIC_NAND: - return &RNA_NandController; - case CONT_LOGIC_NOR: - return &RNA_NorController; - case CONT_LOGIC_XOR: - return &RNA_XorController; - case CONT_LOGIC_XNOR: - return &RNA_XnorController; - case CONT_EXPRESSION: - return &RNA_ExpressionController; - case CONT_PYTHON: - return &RNA_PythonController; - default: - return &RNA_Controller; + case CONT_LOGIC_AND: + return &RNA_AndController; + case CONT_LOGIC_OR: + return &RNA_OrController; + case CONT_LOGIC_NAND: + return &RNA_NandController; + case CONT_LOGIC_NOR: + return &RNA_NorController; + case CONT_LOGIC_XOR: + return &RNA_XorController; + case CONT_LOGIC_XNOR: + return &RNA_XnorController; + case CONT_EXPRESSION: + return &RNA_ExpressionController; + case CONT_PYTHON: + return &RNA_PythonController; + default: + return &RNA_Controller; } } diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 091ec073f61..2d5c26199d6 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -155,7 +155,7 @@ static int rna_Image_gl_load(Image *image, ReportList *reports, int filter, int ibuf= BKE_image_get_ibuf(image, NULL); - if(ibuf == NULL || ibuf->rect == NULL ) { + if(ibuf == NULL || ibuf->rect == NULL ) { BKE_reportf(reports, RPT_ERROR, "Image \"%s\" does not have any image data", image->id.name+2); return (int)GL_INVALID_OPERATION; } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0dd536b64c2..b6d0f77c5a5 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -462,7 +462,7 @@ static bNode *rna_NodeTree_node_new(bNodeTree *ntree, bContext *C, ReportList *r node = nodeAddNodeType(ntree, type, group, NULL); if (node == NULL) { - BKE_reportf(reports, RPT_ERROR, "Unable to create node"); + BKE_reportf(reports, RPT_ERROR, "Unable to create node"); } else { nodeGroupVerify(ntree); /* update group node socket links*/ @@ -1668,8 +1668,8 @@ static void def_cmp_channel_matte(StructRNA *srna) prop = RNA_def_property(srna, "limit_channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "channel"); - RNA_def_property_enum_items(prop, prop_tri_channel_items); - RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf"); + RNA_def_property_enum_items(prop, prop_tri_channel_items); + RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_channel_itemf"); RNA_def_property_ui_text(prop, "Limit Channel", "Limit by this channels value"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); @@ -1843,10 +1843,10 @@ static void def_cmp_crop(StructRNA *srna) RNA_def_property_ui_text(prop, "Crop Image Size", "Whether to crop the size of the input image"); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1); - RNA_def_property_ui_text(prop, "Relative", "Use relative values to crop image"); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + prop = RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "custom2", 1); + RNA_def_property_ui_text(prop, "Relative", "Use relative values to crop image"); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); RNA_def_struct_sdna_from(srna, "NodeTwoXYs", "storage"); @@ -1874,29 +1874,29 @@ static void def_cmp_crop(StructRNA *srna) RNA_def_property_ui_text(prop, "Y2", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - prop = RNA_def_property(srna, "rel_min_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fac_x1"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "X1", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "rel_max_x", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fac_x2"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "X2", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "rel_min_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fac_y1"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Y1", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); - - prop = RNA_def_property(srna, "rel_max_y", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "fac_y2"); - RNA_def_property_range(prop, 0.0, 1.0); - RNA_def_property_ui_text(prop, "Y2", ""); - RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + prop = RNA_def_property(srna, "rel_min_x", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "fac_x1"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "X1", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "rel_max_x", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "fac_x2"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "X2", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "rel_min_y", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "fac_y1"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "Y1", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); + + prop = RNA_def_property(srna, "rel_max_y", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "fac_y2"); + RNA_def_property_range(prop, 0.0, 1.0); + RNA_def_property_ui_text(prop, "Y2", ""); + RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); } static void def_cmp_dblur(StructRNA *srna) diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 2a369ba9044..d6af04f2475 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -87,10 +87,10 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int int cage = !apply_modifiers; /* perform the mesh extraction based on type */ - switch (ob->type) { - case OB_FONT: - case OB_CURVE: - case OB_SURF: + switch (ob->type) { + case OB_FONT: + case OB_CURVE: + case OB_SURF: /* copies object and modifiers (but not the data) */ tmpobj= copy_object(ob); @@ -130,7 +130,7 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int free_libblock_us( &G.main->object, tmpobj ); break; - case OB_MBALL: + case OB_MBALL: /* metaballs don't have modifiers, so just convert to mesh */ ob = find_basis_mball( sce, ob ); /* todo, re-generatre for render-res */ @@ -138,9 +138,9 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int tmpmesh = add_mesh("Mesh"); mball_to_mesh( &ob->disp, tmpmesh ); - break; + break; - case OB_MESH: + case OB_MESH: /* copies object and modifiers (but not the data) */ if (cage) { /* copies the data */ @@ -165,10 +165,10 @@ static Mesh *rna_Object_to_mesh(Object *ob, ReportList *reports, Scene *sce, int } break; - default: + default: BKE_report(reports, RPT_ERROR, "Object does not have geometry data"); - return NULL; - } + return NULL; + } /* Copy materials to new mesh */ switch (ob->type) { diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index fe164cbd3c1..9fd5fafc712 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1092,24 +1092,24 @@ static void rna_def_fluid_settings(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "SPH Fluid Settings", "Settings for particle fluids physics"); /* Fluid settings */ - prop= RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE); + prop= RNA_def_property(srna, "spring_force", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "spring_k"); - RNA_def_property_range(prop, 0.0f, 100.0f); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); - RNA_def_property_ui_text(prop, "Spring Force", "Spring force"); + RNA_def_property_ui_text(prop, "Spring Force", "Spring force"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - - prop= RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "radius"); - RNA_def_property_range(prop, 0.0f, 20.0f); + + prop= RNA_def_property(srna, "fluid_radius", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "radius"); + RNA_def_property_range(prop, 0.0f, 20.0f); RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3); RNA_def_property_ui_text(prop, "Interaction Radius", "Fluid interaction radius"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); - prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.0f, 2.0f); + prop= RNA_def_property(srna, "rest_length", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "Rest Length", "Spring rest length (factor of particle radius)"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); prop= RNA_def_property(srna, "use_viscoelastic_springs", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_VISCOELASTIC_SPRINGS); @@ -1121,70 +1121,70 @@ static void rna_def_fluid_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Initial Rest Length", "Use the initial length as spring rest length instead of 2 * particle size"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - prop= RNA_def_property(srna, "plasticity", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "plasticity_constant"); - RNA_def_property_range(prop, 0.0f, 100.0f); - RNA_def_property_ui_text(prop, "Plasticity", "How much the spring rest length can change after the elastic limit is crossed"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); + prop= RNA_def_property(srna, "plasticity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "plasticity_constant"); + RNA_def_property_range(prop, 0.0f, 100.0f); + RNA_def_property_ui_text(prop, "Plasticity", "How much the spring rest length can change after the elastic limit is crossed"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); + + prop= RNA_def_property(srna, "yield_ratio", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "yield_ratio"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Elastic Limit", "How much the spring has to be stretched/compressed in order to change it's rest length"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); - prop= RNA_def_property(srna, "yield_ratio", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "yield_ratio"); - RNA_def_property_range(prop, 0.0f, 1.0f); - RNA_def_property_ui_text(prop, "Elastic Limit", "How much the spring has to be stretched/compressed in order to change it's rest length"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); + prop= RNA_def_property(srna, "spring_frames", PROP_INT, PROP_NONE); + RNA_def_property_range(prop, 0.0f, 100.0f); + RNA_def_property_ui_text(prop, "Spring Frames", "Create springs for this number of frames since particles birth (0 is always)"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); - prop= RNA_def_property(srna, "spring_frames", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0.0f, 100.0f); - RNA_def_property_ui_text(prop, "Spring Frames", "Create springs for this number of frames since particles birth (0 is always)"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); - - /* Viscosity */ - prop= RNA_def_property(srna, "linear_viscosity", PROP_FLOAT, PROP_NONE); + /* Viscosity */ + prop= RNA_def_property(srna, "linear_viscosity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "viscosity_omega"); - RNA_def_property_range(prop, 0.0f, 100.0f); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); - RNA_def_property_ui_text(prop, "Viscosity", "Linear viscosity"); + RNA_def_property_ui_text(prop, "Viscosity", "Linear viscosity"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - - prop= RNA_def_property(srna, "stiff_viscosity", PROP_FLOAT, PROP_NONE); + + prop= RNA_def_property(srna, "stiff_viscosity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "viscosity_beta"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3); - RNA_def_property_ui_text(prop, "Stiff viscosity", "Creates viscosity for expanding fluid)"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); + RNA_def_property_ui_text(prop, "Stiff viscosity", "Creates viscosity for expanding fluid)"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* Double density relaxation */ - prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "stiffness_k"); - RNA_def_property_range(prop, 0.0f, 100.0f); + prop= RNA_def_property(srna, "stiffness", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "stiffness_k"); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); - RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is"); + RNA_def_property_ui_text(prop, "Stiffness", "How incompressible the fluid is"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - - prop= RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "stiffness_knear"); + + prop= RNA_def_property(srna, "repulsion", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "stiffness_knear"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3); - RNA_def_property_ui_text(prop, "Repulsion Factor", "How strongly the fluid tries to keep from clustering (factor of stiffness)"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); - - prop= RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_text(prop, "Repulsion Factor", "How strongly the fluid tries to keep from clustering (factor of stiffness)"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); + + prop= RNA_def_property(srna, "rest_density", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rest_density"); - RNA_def_property_range(prop, 0.0f, 100.0f); + RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_range(prop, 0.0f, 2.0f, 1, 3); - RNA_def_property_ui_text(prop, "Rest Density", "Fluid rest density"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); - + RNA_def_property_ui_text(prop, "Rest Density", "Fluid rest density"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); + /* Buoyancy */ prop= RNA_def_property(srna, "buoyancy", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "buoyancy"); - RNA_def_property_range(prop, 0.0f, 10.0f); + RNA_def_property_float_sdna(prop, NULL, "buoyancy"); + RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 1, 3); - RNA_def_property_ui_text(prop, "Buoyancy", "Artificial buoyancy force in negative gravity direction based on pressure differences inside the fluid"); - RNA_def_property_update(prop, 0, "rna_Particle_reset"); + RNA_def_property_ui_text(prop, "Buoyancy", "Artificial buoyancy force in negative gravity direction based on pressure differences inside the fluid"); + RNA_def_property_update(prop, 0, "rna_Particle_reset"); /* Factor flags */ - + prop= RNA_def_property(srna, "factor_repulsion", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SPH_FAC_REPULSION); RNA_def_property_ui_text(prop, "Factor Repulsion", "Repulsion is a factor of stiffness"); -- cgit v1.2.3 From ee9ea98e48d6dd1c7447baa049d15739588fe6de Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Apr 2011 14:47:35 +0000 Subject: zoom operator. - continue zoom now uses the same options as dolly (hoz/vert & invert). - remove event mouse coord hack to bypass touchpad zoom invert, instead pass invert as an argument. --- source/blender/makesrna/intern/rna_userdef.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index c21feead18f..a914d875490 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2651,8 +2651,8 @@ static void rna_def_userdef_input(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem view_zoom_axes[] = { - {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"}, - {USER_ZOOM_DOLLY_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"}, + {0, "VERTICAL", 0, "Vertical", "Zooms in and out based on vertical mouse movement"}, + {USER_ZOOM_HORIZ, "HORIZONTAL", 0, "Horizontal", "Zooms in and out based on horizontal mouse movement"}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "UserPreferencesInput", NULL); @@ -2676,7 +2676,7 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_enum_items(prop, view_zoom_axes); RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on"); - prop= RNA_def_property(srna, "invert_mouse_wheel_zoom", PROP_BOOLEAN, PROP_NONE); + prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT); RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming"); -- cgit v1.2.3 From 8ca9dc3cfe8fbe53ba8cd2ac2af5df9b9ff0f104 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sat, 23 Apr 2011 08:52:27 +0000 Subject: Send NA_EDITED notifier when changing tab width in text space properties Now text editor refresh correct and there's no more glitches with messed up syntax highlighting. --- source/blender/makesrna/intern/rna_space.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 2e947039c16..b5b980aca5b 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -539,6 +539,15 @@ static void rna_SpaceTextEditor_text_set(PointerRNA *ptr, PointerRNA value) st->top= 0; } +static void rna_SpaceTextEditor_updateEdited(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + SpaceText *st= (SpaceText*)ptr->data; + + if(st->text) + WM_main_add_notifier(NC_TEXT|NA_EDITED, st->text); +} + + /* Space Properties */ /* note: this function exists only to avoid id refcounting */ @@ -1724,7 +1733,7 @@ static void rna_def_space_text(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "tabnumber"); RNA_def_property_range(prop, 2, 8); RNA_def_property_ui_text(prop, "Tab Width", "Number of spaces to display tabs with"); - RNA_def_property_update(prop, NC_TEXT|NA_EDITED, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, "rna_SpaceTextEditor_updateEdited"); prop= RNA_def_property(srna, "font_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "lheight"); -- cgit v1.2.3 From 2060a261391499f64a372fb38dce0c977300d742 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Sat, 23 Apr 2011 11:13:36 +0000 Subject: Bugfix [#27134] Minor bug in the name: property Constraint.is_valid has label "Disabled" "is_valid" RNA property for constraints had the property name inverted, but the displayed name and tooltips were not inverted too --- source/blender/makesrna/intern/rna_constraint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index e57491dc36d..966e679f0fe 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -2043,7 +2043,7 @@ void RNA_def_constraint(BlenderRNA *brna) prop= RNA_def_property(srna, "is_valid", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CONSTRAINT_DISABLE); - RNA_def_property_ui_text(prop, "Disabled", "Constraint has invalid settings and will not be evaluated"); + RNA_def_property_ui_text(prop, "Valid", "Constraint has valid settings and can be evaluated"); // TODO: setting this to true must ensure that all others in stack are turned off too... prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3 From bdbf0abe600b6e2608d93b6c27ec7ff9d474b743 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Apr 2011 03:02:26 +0000 Subject: rna api - allow RegionView3D.view_matrix to be set. - RegionView3D.view_rotation was inverted. - add C function view3d_settings_from_mat() note, intentionally removed NULL checks, double checked this is ok with callers. --- source/blender/makesrna/intern/rna_space.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index b5b980aca5b..6fad664943d 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -384,6 +384,25 @@ static void rna_RegionView3D_view_location_set(PointerRNA *ptr, const float *val negate_v3_v3(rv3d->ofs, values); } +static void rna_RegionView3D_view_rotation_get(PointerRNA *ptr, float *values) +{ + RegionView3D *rv3d= (RegionView3D *)(ptr->data); + invert_qt_qt(values, rv3d->viewquat); +} + +static void rna_RegionView3D_view_rotation_set(PointerRNA *ptr, const float *values) +{ + RegionView3D *rv3d= (RegionView3D *)(ptr->data); + invert_qt_qt(rv3d->viewquat, values); +} + +static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *values) +{ + RegionView3D *rv3d= (RegionView3D *)(ptr->data); + negate_v3_v3(rv3d->ofs, values); + view3d_settings_from_mat((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); +} + /* Space Image Editor */ static PointerRNA rna_SpaceImageEditor_uvedit_get(PointerRNA *ptr) @@ -1361,9 +1380,10 @@ static void rna_def_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "view_matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "viewmat"); - RNA_def_property_clear_flag(prop, PROP_EDITABLE); // XXX: for now, it's too risky for users to do this RNA_def_property_multi_array(prop, 2, matrix_dimsize); + RNA_def_property_float_funcs(prop, NULL, "rna_RegionView3D_view_matrix_set", NULL); RNA_def_property_ui_text(prop, "View Matrix", "Current view matrix of the 3D region"); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); prop= RNA_def_property(srna, "view_perspective", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "persp"); @@ -1382,8 +1402,13 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, 4); RNA_def_property_update(prop, NC_WINDOW, NULL); - prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); + prop= RNA_def_property(srna, "view_rotation", PROP_FLOAT, PROP_QUATERNION); // cant use because its inverted +#if 0 RNA_def_property_float_sdna(prop, NULL, "viewquat"); +#else + RNA_def_property_array(prop, 4); + RNA_def_property_float_funcs(prop, "rna_RegionView3D_view_rotation_get", "rna_RegionView3D_view_rotation_set", NULL); +#endif RNA_def_property_ui_text(prop, "View Rotation", "Rotation in quaternions (keep normalized)"); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); -- cgit v1.2.3 From d6e03d2c56840f9f671ea66654f934cde7bab635 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Mon, 25 Apr 2011 13:47:15 +0000 Subject: 2.5 Interface: * Implemented a new operator "WM_OT_properties_context_change" to switch to a different tab inside the properties window. * This is used now inside the Modifier tab for Simulation Modifiers. Based on a mockup by Janne Karhu: http://www.pasteall.org/pic/11261 http://www.pasteall.org/pic/11262 Rather than having a delete button there anymore, the button changes the context to Physics/Particles, where you can edit the settings and delete the actual simulation. --- source/blender/makesrna/intern/rna_space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 6fad664943d..ba33fc7feda 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1436,7 +1436,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) {BCONTEXT_BONE_CONSTRAINT, "BONE_CONSTRAINT", ICON_CONSTRAINT, "Bone Constraints", "Bone Constraints"}, {BCONTEXT_MATERIAL, "MATERIAL", ICON_MATERIAL, "Material", "Material"}, {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"}, - {BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"}, + {BCONTEXT_PARTICLE, "PARTICLES", ICON_PARTICLES, "Particles", "Particle"}, {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From b12d46f73e448ef2bdefe854a32bcb1f8cb0e74e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Apr 2011 10:38:18 +0000 Subject: - fix for player linking - added notes to release todo's. - renamed view3d view transform matching functions. - added assert in edge split modifier to make a certain bug easier to spot. --- source/blender/makesrna/intern/rna_space.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index ba33fc7feda..5e261fa2d18 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -400,7 +400,7 @@ static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *value { RegionView3D *rv3d= (RegionView3D *)(ptr->data); negate_v3_v3(rv3d->ofs, values); - view3d_settings_from_mat((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); + view3d_apply_mat4((float (*)[4])values, rv3d->ofs, rv3d->viewquat, &rv3d->dist); } /* Space Image Editor */ -- cgit v1.2.3 From 64a37fadf09e32772520272a831034a9fe790fc8 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Tue, 26 Apr 2011 13:49:40 +0000 Subject: Adding support for adding copies of existing drivers to other animdata blocks via PyAPI/RNA For example: ob = bpy.context.active_object # assumes default cube has some drivers added already before running script dst = bpy.data.objects["Camera"] adt = dst.animation_data_create() for driver in ob.animation_data.drivers: new_driver = adt.drivers.from_existing(driver) --- source/blender/makesrna/intern/rna_animation.c | 47 ++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index 8e210a7a4cb..fb23e5ac63d 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -55,6 +55,7 @@ EnumPropertyItem keyingset_path_grouping_items[] = { #ifdef RNA_RUNTIME #include "BKE_animsys.h" +#include "BKE_fcurve.h" #include "BKE_nla.h" #include "WM_api.h" @@ -457,6 +458,24 @@ static void rna_NlaTrack_active_set(PointerRNA *ptr, PointerRNA value) BKE_nlatrack_set_active(&adt->nla_tracks, track); } + +static FCurve *rna_Driver_from_existing(AnimData *adt, bContext *C, FCurve *src_driver) +{ + /* verify that we've got a driver to duplicate */ + if (ELEM(NULL, src_driver, src_driver->driver)) { + BKE_reportf(CTX_wm_reports(C), RPT_ERROR, "No valid driver data to create copy of"); + return NULL; + } + else { + /* just make a copy of the existing one and add to self */ + FCurve *new_fcu = copy_fcurve(src_driver); + + // XXX: if we impose any ordering on these someday, this will be problematic + BLI_addtail(&adt->drivers, new_fcu); + return new_fcu; + } +} + #else /* helper function for Keying Set -> keying settings */ @@ -724,7 +743,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "new", "rna_NlaTrack_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); - RNA_def_function_ui_description(func, "Add a new NLA Tracks"); + RNA_def_function_ui_description(func, "Add a new NLA Track"); RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after."); /* return type */ parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track."); @@ -745,6 +764,28 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_update(prop, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL); } +static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + PropertyRNA *parm; + FunctionRNA *func; + + PropertyRNA *prop; + + RNA_def_property_srna(cprop, "AnimDataDrivers"); + srna= RNA_def_struct(brna, "AnimDataDrivers", NULL); + RNA_def_struct_sdna(srna, "AnimData"); + RNA_def_struct_ui_text(srna, "Drivers", "Collection of Driver F-Curves"); + + func = RNA_def_function(srna, "from_existing", "rna_Driver_from_existing"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); + RNA_def_function_ui_description(func, "Add a new driver given an existing one"); + RNA_def_pointer(func, "src_driver", "FCurve", "", "Existing Driver F-Curve to use as template for a new one"); + /* return type */ + parm = RNA_def_pointer(func, "driver", "FCurve", "", "New Driver F-Curve."); + RNA_def_function_return(func, parm); +} + void rna_def_animdata_common(StructRNA *srna) { PropertyRNA *prop; @@ -774,7 +815,7 @@ void rna_def_animdata(BlenderRNA *brna) /* Active Action */ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); /* this flag as well as the dynamic test must be defined for this to be editable... */ - RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Action_id_poll"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, "rna_Action_id_poll"); RNA_def_property_editable_func(prop, "rna_AnimData_action_editable"); RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock"); RNA_def_property_update(prop, NC_ANIMATION, NULL); /* this will do? */ @@ -805,6 +846,8 @@ void rna_def_animdata(BlenderRNA *brna) RNA_def_property_struct_type(prop, "FCurve"); RNA_def_property_ui_text(prop, "Drivers", "The Drivers/Expressions for this datablock"); + rna_api_animdata_drivers(brna, prop); + /* General Settings */ prop= RNA_def_property(srna, "use_nla", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ADT_NLA_EVAL_OFF); -- cgit v1.2.3 From fca91f550bdd301850eeae0c936e0df83006742c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 Apr 2011 05:15:47 +0000 Subject: rename duplicate header defines & remove unused var. --- source/blender/makesrna/intern/rna_animation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index fb23e5ac63d..106c51865fd 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -770,7 +770,7 @@ static void rna_api_animdata_drivers(BlenderRNA *brna, PropertyRNA *cprop) PropertyRNA *parm; FunctionRNA *func; - PropertyRNA *prop; + // PropertyRNA *prop; RNA_def_property_srna(cprop, "AnimDataDrivers"); srna= RNA_def_struct(brna, "AnimDataDrivers", NULL); -- cgit v1.2.3 From e6604d77f5c456e4dacc6b224ce28e4023f52ada Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Thu, 28 Apr 2011 12:43:28 +0000 Subject: Twitter report fix :) More clear naming for image "source" type. "Single Image" and "Image Sequence" and "Movie File". Thanks @hjalti for poking! --- source/blender/makesrna/intern/rna_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index df5bd9f27f3..5872542d10a 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -44,9 +44,9 @@ #include "WM_types.h" static EnumPropertyItem image_source_items[]= { - {IMA_SRC_FILE, "FILE", 0, "File", "Single image file"}, - {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Sequence", "Multiple image files, as a sequence"}, - {IMA_SRC_MOVIE, "MOVIE", 0, "Movie", "Movie file"}, + {IMA_SRC_FILE, "FILE", 0, "Single Image", "Single image file"}, + {IMA_SRC_SEQUENCE, "SEQUENCE", 0, "Image Sequence", "Multiple image files, as a sequence"}, + {IMA_SRC_MOVIE, "MOVIE", 0, "Movie File", "Movie file"}, {IMA_SRC_GENERATED, "GENERATED", 0, "Generated", "Generated image"}, {IMA_SRC_VIEWER, "VIEWER", 0, "Viewer", "Compositing node viewer"}, {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3 From 696512f8ccb43b685b24a8b5188538abe0615148 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 28 Apr 2011 13:01:29 +0000 Subject: Added tooltip note that parent curve 'Follow' needs to be enabled for track axis to do anything. also show both enum descriptions in the tooltip (the enum properties description and the individual enums). --- source/blender/makesrna/intern/rna_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 436418324e2..2ff72c90042 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1826,13 +1826,13 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, track_items); - RNA_def_property_ui_text(prop, "Track Axis", "Axis that points in 'forward' direction"); + RNA_def_property_ui_text(prop, "Track Axis", "Axis that points in 'forward' direction (applies to DupliFrame when parent 'Follow' is enabled)"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); prop= RNA_def_property(srna, "up_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "upflag"); RNA_def_property_enum_items(prop, up_items); - RNA_def_property_ui_text(prop, "Up Axis", "Axis that points in the upward direction"); + RNA_def_property_ui_text(prop, "Up Axis", "Axis that points in the upward direction (applies to DupliFrame when parent 'Follow' is enabled)"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); /* proxy */ -- cgit v1.2.3 From c4c22d4e9f5f0ab11412a1d22b3f405411389379 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 30 Apr 2011 05:26:09 +0000 Subject: - pass the camera to the render stamp function. - add BKE_write_ibuf_stamp() since saving environment maps & screen shots shouldn't have stamp. --- source/blender/makesrna/intern/rna_image_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 2d5c26199d6..7327c7203b9 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -84,7 +84,7 @@ static void rna_Image_save_render(Image *image, bContext *C, ReportList *reports const float dither_back= ibuf->dither; ibuf->depth= scene->r.planes; ibuf->dither= scene->r.dither_intensity; - if (!BKE_write_ibuf(NULL, ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) { + if (!BKE_write_ibuf(ibuf, path, scene->r.imtype, scene->r.subimtype, scene->r.quality)) { BKE_reportf(reports, RPT_ERROR, "Couldn't write image: %s", path); } ibuf->depth= imb_depth_back; -- cgit v1.2.3 From 9736061c07491286021b039d1307b3951496cf3b Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Sun, 1 May 2011 03:57:53 +0000 Subject: =trunk= Made some improvements to the point density texture. Added support for tweaking the falloff with a custom curve. Also coded new falloff types based on the age or velocity of particles. Also added a test break check to the volumetric shade cache code, to avoid nasty hangups from the preview render (on render, exit, etc). --- source/blender/makesrna/intern/rna_texture.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index d8eec152831..fc74fc7268d 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1427,6 +1427,8 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) {TEX_PD_FALLOFF_SOFT, "SOFT", 0, "Soft", ""}, {TEX_PD_FALLOFF_CONSTANT, "CONSTANT", 0, "Constant", "Density is constant within lookup radius"}, {TEX_PD_FALLOFF_ROOT, "ROOT", 0, "Root", ""}, + {TEX_PD_FALLOFF_PARTICLE_AGE, "PARTICLE_AGE", 0, "Particle Age", ""}, + {TEX_PD_FALLOFF_PARTICLE_VEL, "PARTICLE_VELOCITY", 0, "Particle Velocity", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem color_source_items[] = { @@ -1509,12 +1511,30 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Scale", "Multiplier to bring particle speed within an acceptable range"); RNA_def_property_update(prop, 0, "rna_Texture_update"); + prop= RNA_def_property(srna, "falloff_speed_scale", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "falloff_speed_scale"); + RNA_def_property_range(prop, 0.001, 100.0); + RNA_def_property_ui_text(prop, "Velocity Scale", "Multiplier to bring particle speed within an acceptable range"); + RNA_def_property_update(prop, 0, "rna_Texture_update"); + + prop= RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "coba"); RNA_def_property_struct_type(prop, "ColorRamp"); RNA_def_property_ui_text(prop, "Color Ramp", ""); RNA_def_property_update(prop, 0, "rna_Texture_update"); + + prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NEVER_NULL); + RNA_def_property_pointer_sdna(prop, NULL, "falloff_curve"); + RNA_def_property_struct_type(prop, "CurveMapping"); + RNA_def_property_ui_text(prop, "Falloff Curve", ""); + RNA_def_property_update(prop, 0, "rna_Texture_update"); + prop= RNA_def_property(srna, "use_falloff_curve", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_FALLOFF_CURVE); + RNA_def_property_ui_text(prop, "Falloff Curve", "Use a custom falloff curve"); + RNA_def_property_update(prop, 0, "rna_Texture_update"); + /* Turbulence */ prop= RNA_def_property(srna, "use_turbulence", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", TEX_PD_TURBULENCE); -- cgit v1.2.3 From 22c2aef77c63cf4cbe19a1c5a8ea4671ef6440bd Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 1 May 2011 06:34:40 +0000 Subject: replace inline string searches with BLI_findstring(), strcmp(..., ""), with char comparisons. --- source/blender/makesrna/intern/rna_object_force.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 0619f5e19b6..a4fbd7c160e 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -190,7 +190,7 @@ static void rna_Cache_idname_change(Main *bmain, Scene *scene, PointerRNA *ptr) for(pid=pidlist.first; pid; pid=pid->next) { if(pid->cache==cache) pid2 = pid; - else if(strcmp(cache->name, "") && strcmp(cache->name,pid->cache->name)==0) { + else if(cache->name[0] != '\0' && strcmp(cache->name,pid->cache->name)==0) { /*TODO: report "name exists" to user */ strcpy(cache->name, cache->prev_name); new_name = 0; -- cgit v1.2.3 From 76d4c75881bf88357033abd685724d1a6a481332 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 1 May 2011 08:50:09 +0000 Subject: - Description of texture angle sources and stroke methods - Fixed bug with empty tooltip for some ENUMs --- source/blender/makesrna/intern/rna_brush.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index f3f79cde617..7bb56380ba5 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -342,22 +342,22 @@ static void rna_def_brush(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem brush_stroke_method_items[] = { - {0, "DOTS", 0, "Dots", ""}, - {BRUSH_RESTORE_MESH, "DRAG_DOT", 0, "Drag Dot", ""}, - {BRUSH_SPACE, "SPACE", 0, "Space", ""}, - {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", ""}, - {BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", ""}, + {0, "DOTS", 0, "Dots", "Apply paint on each mouse move step"}, + {BRUSH_RESTORE_MESH, "DRAG_DOT", 0, "Drag Dot", "Allows a single dot to be carefully positioned"}, + {BRUSH_SPACE, "SPACE", 0, "Space", "Limit brush application to the distance specified by spacing"}, + {BRUSH_ANCHORED, "ANCHORED", 0, "Anchored", "Keep the brush anchored to the initial location"}, + {BRUSH_AIRBRUSH, "AIRBRUSH", 0, "Airbrush", "Keep applying paint effect while holding mouse (spray)"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem texture_angle_source_items[] = { - {0, "USER", 0, "User", ""}, - {BRUSH_RAKE, "RAKE", 0, "Rake", ""}, - {BRUSH_RANDOM_ROTATION, "RANDOM", 0, "Random", ""}, + {0, "USER", 0, "User", "Rotate the brush texture by given angle"}, + {BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"}, + {BRUSH_RANDOM_ROTATION, "RANDOM", 0, "Random", "Rotate the brush texture at random"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem texture_angle_source_no_random_items[] = { - {0, "USER", 0, "User", ""}, - {BRUSH_RAKE, "RAKE", 0, "Rake", ""}, + {0, "USER", 0, "User", "Rotate the brush texture by given angle"}, + {BRUSH_RAKE, "RAKE", 0, "Rake", "Rotate the brush texture to match the stroke direction"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem brush_sculpt_plane_items[] = { -- cgit v1.2.3 From 5440b57432b43207e42817fe4dcce1716151ef3c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 1 May 2011 14:02:40 +0000 Subject: improve image sequence usability, problem was when the image didn't load there was no way to know the frame that blender was attempting to read. added a label for image sequence images showing the image file's frame, even when not able to load, this also gives realtime feedback to the user while dragging the frame offset/start/duration buttons about so they can better understand how these settings work. --- source/blender/makesrna/intern/rna_nodetree.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index b6d0f77c5a5..3c26c18f17f 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1262,29 +1262,29 @@ static void def_cmp_image(StructRNA *srna) prop = RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frames"); RNA_def_property_range(prop, 0, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Frames", "Number of images used in animation"); + RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use"); /* copied from the rna_image.c */ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "frame_start", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "sfra"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Start Frame", ""); + RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie/sequence, assuming first picture has a #1"); /* copied from the rna_image.c */ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "offset"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); - RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation"); + RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation"); /* copied from the rna_image.c */ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cycl", 1); - RNA_def_property_ui_text(prop, "Cyclic", ""); + RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie"); /* copied from the rna_image.c */ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS); - RNA_def_property_ui_text(prop, "Auto-Refresh", ""); + RNA_def_property_ui_text(prop, "Auto-Refresh", "Always refresh image on frame changes"); /* copied from the rna_image.c */ RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); prop= RNA_def_property(srna, "layer", PROP_ENUM, PROP_NONE); -- cgit v1.2.3 From 6b0d932c0d27dbce5e62e2a422e388e02f341a52 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 1 May 2011 15:16:59 +0000 Subject: warp modifier, added in the render branch for durian. simple modifier, almost like a hook, except it can deform with 2 object source -> target, has option to preserve rotation and use different falloff types. --- source/blender/makesrna/intern/rna_modifier.c | 146 ++++++++++++++++++++------ 1 file changed, 114 insertions(+), 32 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index b58fa98e051..18a93b9defb 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -79,6 +79,7 @@ EnumPropertyItem modifier_type_items[] ={ {eModifierType_Shrinkwrap, "SHRINKWRAP", ICON_MOD_SHRINKWRAP, "Shrinkwrap", ""}, {eModifierType_SimpleDeform, "SIMPLE_DEFORM", ICON_MOD_SIMPLEDEFORM, "Simple Deform", ""}, {eModifierType_Smooth, "SMOOTH", ICON_MOD_SMOOTH, "Smooth", ""}, + {eModifierType_Warp, "WARP", ICON_MOD_SUBSURF, "Warp", ""}, {eModifierType_Wave, "WAVE", ICON_MOD_WAVE, "Wave", ""}, {0, "", 0, "Simulate", ""}, {eModifierType_Cloth, "CLOTH", ICON_MOD_CLOTH, "Cloth", ""}, @@ -180,6 +181,8 @@ static StructRNA* rna_Modifier_refine(struct PointerRNA *ptr) return &RNA_SolidifyModifier; case eModifierType_Screw: return &RNA_ScrewModifier; + case eModifierType_Warp: + return &RNA_WarpModifier; default: return &RNA_Modifier; } @@ -372,10 +375,10 @@ static void rna_SolidifyModifier_vgroup_set(PointerRNA *ptr, const char *value) rna_object_vgroup_name_set(ptr, value, smd->defgrp_name, sizeof(smd->defgrp_name)); } -static void rna_DisplaceModifier_uvlayer_set(PointerRNA *ptr, const char *value) +static void rna_MappingInfo_uvlayer_set(PointerRNA *ptr, const char *value) { - DisplaceModifierData *smd= (DisplaceModifierData*)ptr->data; - rna_object_uvlayer_name_set(ptr, value, smd->uvlayer_name, sizeof(smd->uvlayer_name)); + MappingInfoModifierData *mmd= (MappingInfoModifierData *)ptr->data; + rna_object_uvlayer_name_set(ptr, value, mmd->uvlayer_name, sizeof(mmd->uvlayer_name)); } static void rna_UVProjectModifier_uvlayer_set(PointerRNA *ptr, const char *value) @@ -384,6 +387,12 @@ static void rna_UVProjectModifier_uvlayer_set(PointerRNA *ptr, const char *value rna_object_uvlayer_name_set(ptr, value, umd->uvlayer_name, sizeof(umd->uvlayer_name)); } +static void RNA_WarpModifier_vgroup_set(PointerRNA *ptr, const char *value) +{ + WarpModifierData *tmd= (WarpModifierData*)ptr->data; + rna_object_vgroup_name_set(ptr, value, tmd->defgrp_name, sizeof(tmd->defgrp_name)); +} + static void rna_WaveModifier_uvlayer_set(PointerRNA *ptr, const char *value) { WaveModifierData *wmd= (WaveModifierData*)ptr->data; @@ -619,6 +628,106 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) RNA_def_property_update(prop, 0, "rna_Modifier_update"); } +static void rna_def_modifier_generic_map_info(StructRNA *srna) +{ + static EnumPropertyItem prop_texture_coordinates_items[] = { + {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", ""}, + {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", ""}, + {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", ""}, + {MOD_DISP_MAP_UV, "UV", 0, "UV", ""}, + {0, NULL, 0, NULL, NULL}}; + + PropertyRNA *prop; + + prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); + RNA_def_property_ui_text(prop, "Texture", ""); + RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "texmapping"); + RNA_def_property_enum_items(prop, prop_texture_coordinates_items); + RNA_def_property_ui_text(prop, "Texture Coordinates", ""); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); + RNA_def_property_ui_text(prop, "UV Layer", "UV layer name"); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MappingInfo_uvlayer_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "map_object"); + RNA_def_property_ui_text(prop, "Texture Coordinate Object", ""); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); +} + +static void rna_def_modifier_warp(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + + static EnumPropertyItem prop_falloff_items[] = { + {eWarp_Falloff_None, "NONE", 0, "No Falloff", ""}, + {eWarp_Falloff_Curve, "CURVE", 0, "Curve", ""}, + {eWarp_Falloff_Smooth, "SMOOTH", ICON_SMOOTHCURVE, "Smooth", ""}, + {eWarp_Falloff_Sphere, "SPHERE", ICON_SPHERECURVE, "Sphere", ""}, + {eWarp_Falloff_Root, "ROOT", ICON_ROOTCURVE, "Root", ""}, + {eWarp_Falloff_Sharp, "SHARP", ICON_SHARPCURVE, "Sharp", ""}, + {eWarp_Falloff_Linear, "LINEAR", ICON_LINCURVE, "Linear", ""}, + {eWarp_Falloff_Const, "CONSTANT", ICON_NOCURVE, "Constant", ""}, + {0, NULL, 0, NULL, NULL}}; + + srna= RNA_def_struct(brna, "WarpModifier", "Modifier"); + RNA_def_struct_ui_text(srna, "Warp Modifier", "Warp modifier"); + RNA_def_struct_sdna(srna, "WarpModifierData"); + //RNA_def_struct_ui_icon(srna, ICON_MOD_SUBSURF); + + prop= RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE); + RNA_def_property_ui_text(prop, "From", "Object to transform from"); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop= RNA_def_property(srna, "object_to", PROP_POINTER, PROP_NONE); + RNA_def_property_ui_text(prop, "To", "Object to transform to"); + RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); + RNA_def_property_ui_range(prop, -100, 100, 10, 2); + RNA_def_property_ui_text(prop, "Strength", ""); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "falloff_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_falloff_items); + RNA_def_property_ui_text(prop, "Falloff Type", ""); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "falloff_radius", PROP_FLOAT, PROP_UNSIGNED); + RNA_def_property_ui_text(prop, "Radius", "Radius to apply"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE); + RNA_def_property_pointer_sdna(prop, NULL, "curfalloff"); + RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "use_volume_preserve", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WARP_VOLUME_PRESERVE); + RNA_def_property_ui_text(prop, "Preserve Volume", "Preserve volume when rotations are used"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); + RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); + RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name for modulating the deform"); + RNA_def_property_string_funcs(prop, NULL, NULL, "RNA_WarpModifier_vgroup_set"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + rna_def_modifier_generic_map_info(srna); +} + static void rna_def_modifier_multires(BlenderRNA *brna) { StructRNA *srna; @@ -1287,13 +1396,6 @@ static void rna_def_modifier_displace(BlenderRNA *brna) {MOD_DISP_DIR_RGB_XYZ, "RGB_TO_XYZ", 0, "RGB to XYZ", ""}, {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem prop_texture_coordinates_items[] = { - {MOD_DISP_MAP_LOCAL, "LOCAL", 0, "Map", ""}, - {MOD_DISP_MAP_GLOBAL, "GLOBAL", 0, "Global", ""}, - {MOD_DISP_MAP_OBJECT, "OBJECT", 0, "Object", ""}, - {MOD_DISP_MAP_UV, "UV", 0, "UV", ""}, - {0, NULL, 0, NULL, NULL}}; - srna= RNA_def_struct(brna, "DisplaceModifier", "Modifier"); RNA_def_struct_ui_text(srna, "Displace Modifier", "Displacement modifier"); RNA_def_struct_sdna(srna, "DisplaceModifierData"); @@ -1305,11 +1407,6 @@ static void rna_def_modifier_displace(BlenderRNA *brna) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_vgroup_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop= RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); - RNA_def_property_ui_text(prop, "Texture", ""); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop= RNA_def_property(srna, "mid_level", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "midlevel"); RNA_def_property_range(prop, 0, 1); @@ -1328,23 +1425,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Direction", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop= RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "texmapping"); - RNA_def_property_enum_items(prop, prop_texture_coordinates_items); - RNA_def_property_ui_text(prop, "Texture Coordinates", ""); - RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); - - prop= RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); - RNA_def_property_ui_text(prop, "UV Layer", "UV layer name"); - RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DisplaceModifier_uvlayer_set"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - - prop= RNA_def_property(srna, "texture_coordinate_object", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "map_object"); - RNA_def_property_ui_text(prop, "Texture Coordinate Object", ""); - RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); - RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + rna_def_modifier_generic_map_info(srna); } static void rna_def_modifier_uvproject(BlenderRNA *brna) @@ -2375,6 +2456,7 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_fluidsim(brna); rna_def_modifier_mask(brna); rna_def_modifier_simpledeform(brna); + rna_def_modifier_warp(brna); rna_def_modifier_multires(brna); rna_def_modifier_surface(brna); rna_def_modifier_smoke(brna); -- cgit v1.2.3 From 088899236b0904c0a3d0fc5a92b0cb5ffd35cd17 Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Sun, 1 May 2011 21:39:13 +0000 Subject: =trunk= Recommitted eltopo collision code (but disabled by default) with Genscher's permission. To use, you need to install liblapack and libblas --- source/blender/makesrna/intern/rna_cloth.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index a7f308742ac..afd30433c5d 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -428,6 +428,20 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED); RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects"); RNA_def_property_update(prop, 0, "rna_cloth_update"); + + prop= RNA_def_property(srna, "repel_force", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "repel_force"); + RNA_def_property_range(prop, 0.0f, 20.0f); + RNA_def_property_float_default(prop, 1.0f); + RNA_def_property_ui_text(prop, "Repulsion Force", "Repulsion force to apply on cloth when close to colliding"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); + + prop= RNA_def_property(srna, "distance_repel", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "distance_repel"); + RNA_def_property_range(prop, 0.001f, 10.0f); + RNA_def_property_float_default(prop, 0.005f); + RNA_def_property_ui_text(prop, "Repulsion Distance", "Maximum distance to apply repulsion force, must be greater then minimum distance"); + RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "distance_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); -- cgit v1.2.3 From bee2523a41c37a43df7e4bf93dce32ec45d8f132 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 2 May 2011 09:08:43 +0000 Subject: Related to bug #27004: there is now an option to disable color management for GLSL. I've tried to find a quicker way to do it that still looks the same, but couldn't find a formula that didn't have major color shifts. --- source/blender/makesrna/intern/rna_scene.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index acb0ffa3be2..0b4d5ccbbfc 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1909,6 +1909,11 @@ static void rna_def_scene_game_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "GLSL Nodes", "Use nodes for GLSL rendering"); RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update"); + prop= RNA_def_property(srna, "use_glsl_color_management", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_COLOR_MANAGEMENT); + RNA_def_property_ui_text(prop, "GLSL Color Management", "Use color management for GLSL rendering"); + RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_glsl_update"); + prop= RNA_def_property(srna, "use_glsl_extra_textures", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GAME_GLSL_NO_EXTRA_TEX); RNA_def_property_ui_text(prop, "GLSL Extra Textures", "Use extra textures like normal or specular maps for GLSL rendering"); -- cgit v1.2.3 From c2f18383f9637b61dc58cabacf109acb5bcd65f8 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 2 May 2011 11:34:57 +0000 Subject: Fix #27165: uvedit mesh selection sync did not handle click / shift+click for switching selection modes in the header. --- source/blender/makesrna/intern/rna_ui_api.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 2ee19b07d86..ae308b9423f 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -414,6 +414,9 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_header_3D", "uiTemplateHeader3D"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); + + func= RNA_def_function(srna, "template_edit_mode_selection", "uiTemplateEditModeSelection"); + RNA_def_function_flag(func, FUNC_USE_CONTEXT); func= RNA_def_function(srna, "template_reports_banner", "uiTemplateReportsBanner"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); -- cgit v1.2.3 From 03734f5c58f374cd016b318685a00a16a219defa Mon Sep 17 00:00:00 2001 From: Joseph Eagar Date: Tue, 3 May 2011 01:48:15 +0000 Subject: =trunk= Recommitted eltopo collision code (but disabled by default) with Genscher's permission. To use, you need to install liblapack and libblas --- source/blender/makesrna/intern/rna_userdef.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index a914d875490..421a48e68d0 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2676,6 +2676,10 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_enum_items(prop, view_zoom_axes); RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on"); + prop= RNA_def_property(srna, "loopcut_finish_on_release", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "loopcut_finish_on_release", 1); + RNA_def_property_ui_text(prop, "End Loopcut Slide On Release", "End Loopcut Slide On Mouse Release, a 'click-drag-and-hold' workflow"); + prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT); RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming"); -- cgit v1.2.3 From 80d94babe0ceca36f8ab6759c3321b1e7b1897d0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 3 May 2011 12:37:15 +0000 Subject: fix [#27268] 2.57b Global Pivot Option not functional. --- source/blender/makesrna/intern/rna_space.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 5e261fa2d18..75225f01598 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -319,6 +319,32 @@ static void rna_SpaceView3D_layer_update(Main *bmain, Scene *scene, PointerRNA * DAG_on_visible_update(bmain, FALSE); } +static void rna_SpaceView3D_pivot_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +{ + if (U.uiflag & USER_LOCKAROUND) { + View3D *v3d_act= (View3D*)(ptr->data); + + /* TODO, space looper */ + bScreen *screen; + for(screen= bmain->screen.first; screen; screen= screen->id.next) { + ScrArea *sa; + for(sa= screen->areabase.first; sa; sa= sa->next) { + SpaceLink *sl; + for(sl= sa->spacedata.first; sl ;sl= sl->next) { + if(sl->spacetype==SPACE_VIEW3D) { + View3D *v3d= (View3D *)sl; + if (v3d != v3d_act) { + v3d->around= v3d_act->around; + v3d->flag= (v3d->flag & ~V3D_ALIGN) | (v3d_act->flag & V3D_ALIGN); + ED_area_tag_redraw_regiontype(sa, RGN_TYPE_HEADER); + } + } + } + } + } + } +} + static PointerRNA rna_SpaceView3D_region_3d_get(PointerRNA *ptr) { View3D *v3d= (View3D*)(ptr->data); @@ -1277,13 +1303,13 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "around"); RNA_def_property_enum_items(prop, pivot_items); RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling"); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update"); prop= RNA_def_property(srna, "use_pivot_point_align", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN); RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only"); RNA_def_property_ui_icon(prop, ICON_ALIGN, 0); - RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, "rna_SpaceView3D_pivot_update"); prop= RNA_def_property(srna, "show_manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR); -- cgit v1.2.3 From b5c2598a6b31f63ee6d52c61d6ab5195a576ec56 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 May 2011 04:00:53 +0000 Subject: use UNUSED in some more function args, no functional changes. --- source/blender/makesrna/intern/rna_scene.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 0b4d5ccbbfc..e06e71d6a0e 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -313,7 +313,7 @@ static void rna_Scene_layer_set(PointerRNA *ptr, const int *values) scene->lay= ED_view3d_scene_layer_set(scene->lay, values, &scene->layact); } -static void rna_Scene_view3d_update(Main *bmain, Scene *unused, PointerRNA *ptr) +static void rna_Scene_view3d_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr) { Scene *scene= (Scene*)ptr->data; @@ -740,14 +740,14 @@ static int rna_RenderSettings_engine_get(PointerRNA *ptr) return 0; } -static void rna_Scene_glsl_update(Main *bmain, Scene *unused, PointerRNA *ptr) +static void rna_Scene_glsl_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr) { Scene *scene= (Scene*)ptr->id.data; DAG_id_tag_update(&scene->id, 0); } -static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unused, PointerRNA *ptr) +static void rna_RenderSettings_color_management_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr) { /* reset image nodes */ Scene *scene= (Scene*)ptr->id.data; @@ -769,7 +769,7 @@ static void rna_RenderSettings_color_management_update(Main *bmain, Scene *unuse } } - rna_Scene_glsl_update(bmain, unused, ptr); + rna_Scene_glsl_update(bmain, scene, ptr); } static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value) @@ -815,7 +815,7 @@ static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values) rl->lay= ED_view3d_scene_layer_set(rl->lay, values, NULL); } -static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *unused, PointerRNA *ptr) +static void rna_SceneRenderLayer_pass_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr) { Scene *scene= (Scene*)ptr->id.data; @@ -832,7 +832,7 @@ static void rna_Scene_use_nodes_set(PointerRNA *ptr, int value) ED_node_composit_default(scene); } -static void rna_Physics_update(Main *bmain, Scene *unused, PointerRNA *ptr) +static void rna_Physics_update(Main *bmain, Scene *UNUSED(scene_unused), PointerRNA *ptr) { Scene *scene= (Scene*)ptr->id.data; Base *base; -- cgit v1.2.3 From ea5b43d862a4004280660405d50560d576f6fed9 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 May 2011 05:52:14 +0000 Subject: fix [#26920] working with bones causes segmetation fault. ITASC IK solver data wasn't being cleared when constraints were removed, would access freed memory and crash. --- source/blender/makesrna/intern/rna_pose.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 9b8b23e3c47..7c5c4882253 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -470,11 +470,22 @@ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, Repo BKE_reportf(reports, RPT_ERROR, "Constraint '%s' not found in pose bone '%s'.", con->name, pchan->name); return; } + else { + Object *ob= (Object *)id; + const short is_ik= ELEM(con->type, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK); + + remove_constraint(&pchan->constraints, con); + + ED_object_constraint_update(ob); + + constraints_set_active(&pchan->constraints, NULL); - // TODO - //ED_object_constraint_set_active(id, NULL); - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, id); - remove_constraint(&pchan->constraints, con); + if (is_ik) { + BIK_clear_data(ob->pose); + } + + WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, id); + } } static int rna_PoseChannel_proxy_editable(PointerRNA *ptr) -- cgit v1.2.3 From ff7ae1d4f4350445caceaf17194db3d03036f3d0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 May 2011 05:56:26 +0000 Subject: rna object constraint remove function wasn't calling ED_object_constraint_update(). --- source/blender/makesrna/intern/rna_object.c | 3 ++- source/blender/makesrna/intern/rna_pose.c | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 2ff72c90042..11e7dd81cb6 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1096,8 +1096,9 @@ static void rna_Object_constraints_remove(Object *object, ReportList *reports, b } remove_constraint(&object->constraints, con); + ED_object_constraint_update(object); ED_object_constraint_set_active(object, NULL); - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT, object); + WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, object); } static ModifierData *rna_Object_modifier_new(Object *object, bContext *C, ReportList *reports, const char *name, int type) diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index 7c5c4882253..996a80548b3 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -475,16 +475,13 @@ static void rna_PoseChannel_constraints_remove(ID *id, bPoseChannel *pchan, Repo const short is_ik= ELEM(con->type, CONSTRAINT_TYPE_KINEMATIC, CONSTRAINT_TYPE_SPLINEIK); remove_constraint(&pchan->constraints, con); - ED_object_constraint_update(ob); - constraints_set_active(&pchan->constraints, NULL); + WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, id); if (is_ik) { BIK_clear_data(ob->pose); } - - WM_main_add_notifier(NC_OBJECT|ND_CONSTRAINT|NA_REMOVED, id); } } -- cgit v1.2.3 From d000103e80c076fb5bbdfbc87dc978b5e693564d Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 4 May 2011 13:15:42 +0000 Subject: Own TODO item: sculpting on constructive modifiers - Constructive modifiers are enabled by default in sculpt mode. - There's option to disable all constructive modifiers in the "Options" panel of toolbox in sculpt mode, - Use one column in options panel to make strings easier to read - No modifiers would still be applied on multires --- source/blender/makesrna/intern/rna_sculpt_paint.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 58f19fe8799..ce018fdfd6e 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -184,6 +184,16 @@ static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value) return brush->ob_mode & mode; } +static void rna_Sculpt_update(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Object *ob= (scene->basact)? scene->basact->object: NULL; + + if(ob) { + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); + WM_main_add_notifier(NC_OBJECT|ND_MODIFIER, ob); + } +} + #else static void rna_def_paint(BlenderRNA *brna) @@ -260,6 +270,11 @@ static void rna_def_sculpt(BlenderRNA *brna) prop= RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP); RNA_def_property_ui_text(prop, "Use OpenMP", "Take advantage of multiple CPU cores to improve sculpting performance"); + + prop= RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM); + RNA_def_property_ui_text(prop, "Use Deform Only", "Use only deformation modifiers (temporary disable all constructive modifiers except multi-resolution)"); + RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Sculpt_update"); } static void rna_def_vertex_paint(BlenderRNA *brna) -- cgit v1.2.3 From 5ed5c7441cdb23c4f5d0efe550fc3562bdbb9cf8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 May 2011 17:36:13 +0000 Subject: new rna api call: RNA_struct_idprops_unset(op->ptr, "someprop"), added to allow un-setting operator properties. --- source/blender/makesrna/intern/rna_access.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index cd9b23da5d3..03622ec756f 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -521,6 +521,24 @@ int RNA_struct_idprops_register_check(StructRNA *type) return (type->flag & STRUCT_NO_IDPROPERTIES) == 0; } +/* remove an id-property */ +int RNA_struct_idprops_unset(PointerRNA *ptr, const char *identifier) +{ + IDProperty *group= RNA_struct_idprops(ptr, 0); + + if(group) { + IDProperty *idp= IDP_GetPropertyFromGroup(group, identifier); + if(idp) { + IDP_RemFromGroup(group, idp); + IDP_FreeProperty(idp); + MEM_freeN(idp); + + return 1; + } + } + return 0; +} + int RNA_struct_is_a(StructRNA *type, StructRNA *srna) { StructRNA *base; -- cgit v1.2.3 From fbe17e09a372a02c2729bd875f9d6d35e8a2f383 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 4 May 2011 20:42:34 +0000 Subject: alternative to joe's commit r36451. loopcut now follows 'Release confirms' user preference. --- source/blender/makesrna/intern/rna_userdef.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 421a48e68d0..a914d875490 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2676,10 +2676,6 @@ static void rna_def_userdef_input(BlenderRNA *brna) RNA_def_property_enum_items(prop, view_zoom_axes); RNA_def_property_ui_text(prop, "Zoom Axis", "Axis of mouse movement to zoom in or out on"); - prop= RNA_def_property(srna, "loopcut_finish_on_release", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "loopcut_finish_on_release", 1); - RNA_def_property_ui_text(prop, "End Loopcut Slide On Release", "End Loopcut Slide On Mouse Release, a 'click-drag-and-hold' workflow"); - prop= RNA_def_property(srna, "invert_mouse_zoom", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "uiflag", USER_ZOOM_INVERT); RNA_def_property_ui_text(prop, "Invert Zoom Direction", "Invert the axis of mouse movement for zooming"); -- cgit v1.2.3