diff options
Diffstat (limited to 'source/blender/makesrna/intern')
44 files changed, 423 insertions, 405 deletions
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 8345f3f632d..d6316625678 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -71,21 +71,29 @@ IF(WITH_GAMEENGINE) ADD_DEFINITIONS(-DGAMEBLENDER) ENDIF(WITH_GAMEENGINE) -IF(WITH_OPENEXR) +IF(WITH_IMAGE_OPENEXR) ADD_DEFINITIONS(-DWITH_OPENEXR) -ENDIF(WITH_OPENEXR) +ENDIF(WITH_IMAGE_OPENEXR) -IF(WITH_TIFF) +IF(WITH_IMAGE_TIFF) ADD_DEFINITIONS(-DWITH_TIFF) -ENDIF(WITH_TIFF) +ENDIF(WITH_IMAGE_TIFF) -IF(WITH_OPENJPEG) +IF(WITH_IMAGE_OPENJPEG) ADD_DEFINITIONS(-DWITH_OPENJPEG) -ENDIF(WITH_OPENJPEG) +ENDIF(WITH_IMAGE_OPENJPEG) -IF(WITH_DDS) +IF(WITH_IMAGE_DDS) ADD_DEFINITIONS(-DWITH_DDS) -ENDIF(WITH_DDS) +ENDIF(WITH_IMAGE_DDS) + +IF(WITH_IMAGE_CINEON) + ADD_DEFINITIONS(-DWITH_CINEON) +ENDIF(WITH_IMAGE_CINEON) + +IF(WITH_IMAGE_HDR) + ADD_DEFINITIONS(-DWITH_HDR) +ENDIF(WITH_IMAGE_HDR) IF(WITH_QUICKTIME) SET(INC ${INC} ../../quicktime) @@ -102,9 +110,9 @@ IF(WITH_LCMS) ADD_DEFINITIONS(-DWITH_LCMS) ENDIF(WITH_LCMS) -IF(NOT WITH_ELBEEM) +IF(NOT WITH_FLUID) ADD_DEFINITIONS(-DDISABLE_ELBEEM) -ENDIF(NOT WITH_ELBEEM) +ENDIF(NOT WITH_FLUID) IF(WITH_FFTW3) ADD_DEFINITIONS(-DFFTW3=1) diff --git a/source/blender/makesrna/intern/Makefile b/source/blender/makesrna/intern/Makefile index 6b28c56105b..4262a3538c2 100644 --- a/source/blender/makesrna/intern/Makefile +++ b/source/blender/makesrna/intern/Makefile @@ -97,6 +97,18 @@ ifeq ($(WITH_TIFF),true) CPPFLAGS += -DWITH_TIFF endif +ifeq ($(WITH_LCMS),true) + CPPFLAGS += -DWITH_LCMS +endif + +ifeq ($(WITH_CINEON),true) + CPPFLAGS += -DWITH_CINEON +endif + +ifeq ($(WITH_HDR),true) + CPPFLAGS += -DWITH_HDR +endif + ifeq ($(OS),windows) # Windows needs these extra libs because of winstuff... It is not # _really_ needed, but it is the easiest fix for now. If you have diff --git a/source/blender/makesrna/intern/SConscript b/source/blender/makesrna/intern/SConscript index 6b50daa5486..3bebffaddec 100644 --- a/source/blender/makesrna/intern/SConscript +++ b/source/blender/makesrna/intern/SConscript @@ -47,6 +47,12 @@ if env['WITH_BF_OPENJPEG']: if env['WITH_BF_DDS']: defs.append('WITH_DDS') +if env['WITH_BF_CINEON']: + defs.append('WITH_CINEON') + +if env['WITH_BF_HDR']: + defs.append('WITH_HDR') + if env['WITH_BF_FFMPEG']: defs.append('WITH_FFMPEG') incs += ' ' + env['BF_FFMPEG_INC'] @@ -84,7 +90,7 @@ if not env['WITH_BF_PYTHON']: if env['OURPLATFORM'] == 'linux2': cflags='-pthread' - incs += ' ../../../extern/binreloc/include' + incs += ' ../../../extern/binreloc/include' if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index b9764ea021f..ad8104f92e0 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -2088,7 +2088,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr } case PROP_POINTER: { PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; - fprintf(f, "\t%s, %s, %s, ", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef)); + fprintf(f, "\t%s, %s, %s, %s,", rna_function_string(pprop->get), rna_function_string(pprop->set), rna_function_string(pprop->typef), rna_function_string(pprop->poll)); if(pprop->type) fprintf(f, "&RNA_%s\n", (char*)pprop->type); else fprintf(f, "NULL\n"); break; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 62dd14b2ffa..b15f736ac76 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -786,6 +786,7 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name) return -1; } + void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax) { IntPropertyRNA *iprop= (IntPropertyRNA*)rna_ensure_property(prop); @@ -990,6 +991,22 @@ StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop) return &RNA_UnknownType; } +int RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value) +{ + prop= rna_ensure_property(prop); + + if(prop->type == PROP_POINTER) { + PointerPropertyRNA *pprop= (PointerPropertyRNA*)prop; + if(pprop->poll) + return pprop->poll(ptr, *value); + + return 1; + } + + printf("RNA_property_pointer_poll %s: is not a pointer property.\n", prop->identifier); + return 0; +} + /* Reuse for dynamic types */ EnumPropertyItem DummyRNA_NULL_items[] = { {0, NULL, 0, NULL, NULL} diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index db71fbd8c46..027ecfc12a3 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -108,20 +108,21 @@ static FCurve *rna_Action_fcurve_new(bAction *act, ReportList *reports, char *da static void rna_Action_fcurve_remove(bAction *act, ReportList *reports, FCurve *fcu) { - if(fcu->grp) { + if (fcu->grp) { if (BLI_findindex(&act->groups, fcu->grp) == -1) { BKE_reportf(reports, RPT_ERROR, "FCurve's ActionGroup '%s' not found in action '%s'", fcu->grp->name, act->id.name+2); return; } - + action_groups_remove_channel(act, fcu); + free_fcurve(fcu); } else { - if(BLI_findindex(&act->curves, fcu) == -1) { + if (BLI_findindex(&act->curves, fcu) == -1) { BKE_reportf(reports, RPT_ERROR, "FCurve not found in action '%s'", act->id.name+2); return; } - + BLI_remlink(&act->curves, fcu); free_fcurve(fcu); } diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index fecf66f533e..f5145d86270 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -522,7 +522,7 @@ static void rna_def_action_actuator(BlenderRNA *brna) 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); + 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, "continue_last_frame", PROP_BOOLEAN, PROP_NONE); @@ -1266,7 +1266,7 @@ static void rna_def_edit_object_actuator(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Mesh", "Replace the existing, when left blank 'Phys' will remake the existing physics mesh"); /* note: custom set function is ONLY to avoid rna setting a user for this. */ - RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_editobject_mesh_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Actuator_editobject_mesh_set", NULL, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); prop= RNA_def_property(srna, "time", PROP_INT, PROP_NONE); @@ -1734,7 +1734,7 @@ static void rna_def_shape_action_actuator(BlenderRNA *brna) 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); + 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, "continue_last_frame", PROP_BOOLEAN, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index e0cf4f912b1..f4b6d7ded0f 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -489,7 +489,7 @@ static void rna_def_keyingset_path(BlenderRNA *brna) RNA_def_property_struct_type(prop, "ID"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_ksPath_id_editable"); - RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_ksPath_id_typef", NULL); RNA_def_property_ui_text(prop, "ID-Block", "ID-Block that keyframes for Keying Set should be added to (for Absolute Keying Sets only)"); prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); @@ -595,7 +595,7 @@ static void rna_def_keyingset(BlenderRNA *brna) /* KeyingSetInfo (Type Info) for Builtin Sets only */ prop= RNA_def_property(srna, "type_info", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "KeyingSetInfo"); - RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_typeinfo_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for built-in Keying Sets"); /* Paths */ @@ -609,7 +609,7 @@ static void rna_def_keyingset(BlenderRNA *brna) RNA_def_property_struct_type(prop, "KeyingSetPath"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_KeyingSet_active_ksPath_editable"); - RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_KeyingSet_active_ksPath_get", "rna_KeyingSet_active_ksPath_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes"); prop= RNA_def_property(srna, "active_path_index", PROP_INT, PROP_NONE); @@ -658,7 +658,7 @@ void rna_def_animdata(BlenderRNA *brna) /* Active Action */ prop= RNA_def_property(srna, "action", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_AnimData_action_set", NULL, NULL); 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_editable_func(prop, "rna_AnimData_action_editable"); RNA_def_property_ui_text(prop, "Action", "Active Action for this datablock"); diff --git a/source/blender/makesrna/intern/rna_animviz.c b/source/blender/makesrna/intern/rna_animviz.c index a85f19e7be4..1b049ced767 100644 --- a/source/blender/makesrna/intern/rna_animviz.c +++ b/source/blender/makesrna/intern/rna_animviz.c @@ -328,14 +328,14 @@ static void rna_def_animviz(BlenderRNA *brna) prop= RNA_def_property(srna, "onion_skinning", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "AnimVizOnionSkinning"); - RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_AnimViz_onion_skinning_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Onion Skinning", "Onion Skinning (ghosting) settings for visualisation"); /* motion path settings (nested struct) */ prop= RNA_def_property(srna, "motion_paths", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "AnimVizMotionPaths"); - RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_AnimViz_motion_paths_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Motion Paths", "Motion Path settings for visualisation"); } diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 437a22b6692..91a78f1a01a 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -580,7 +580,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "EditBone"); - RNA_def_property_pointer_funcs(prop, "rna_EditBone_parent_get", "rna_EditBone_parent_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_EditBone_parent_get", "rna_EditBone_parent_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Parent", "Parent edit bone (in same Armature)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); @@ -664,7 +664,7 @@ static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_pointer_sdna(prop, NULL, "act_bone"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Bone", "Armatures active bone"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL); /* todo, redraw */ // RNA_def_property_collection_active(prop, prop_act); @@ -690,7 +690,7 @@ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone"); //RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL); /* todo, redraw */ // RNA_def_property_collection_active(prop, prop_act); diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index c4ed00794b0..5bc61eaa899 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -436,7 +436,7 @@ static void rna_def_boidstate(BlenderRNA *brna) prop= RNA_def_property(srna, "active_boid_rule", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BoidRule"); - RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_BoidState_active_boid_rule_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Boid Rule", ""); prop= RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED); @@ -488,7 +488,7 @@ static void rna_def_boid_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "active_boid_state", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BoidRule"); - RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_BoidSettings_active_boid_state_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Boid Rule", ""); prop= RNA_def_property(srna, "active_boid_state_index", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 7a08e1403e3..3d1cb7c5c2f 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -31,6 +31,7 @@ #include "DNA_brush_types.h" #include "DNA_texture_types.h" #include "DNA_scene_types.h" +#include "DNA_object_types.h" #include "BLI_math.h" @@ -140,37 +141,6 @@ static void rna_Brush_imagepaint_tool_update(Main *bmain, Scene *scene, PointerR rna_Brush_update(bmain, scene, ptr); } -static int rna_Brush_is_sculpt_brush(Brush *br, bContext *C) -{ - Sculpt *sd = CTX_data_tool_settings(C)->sculpt; - return paint_has_brush(&sd->paint, br); -} - -static int rna_Brush_is_vpaint_brush(Brush *br, bContext *C) -{ - VPaint *vp = CTX_data_tool_settings(C)->vpaint; - return paint_has_brush(&vp->paint, br); -} - -static int rna_Brush_is_wpaint_brush(Brush *br, bContext *C) -{ - VPaint *vp = CTX_data_tool_settings(C)->wpaint; - return paint_has_brush(&vp->paint, br); -} - -static int rna_Brush_is_imapaint_brush(Brush *me, bContext *C) -{ - ImagePaintSettings *data = &(CTX_data_tool_settings(C)->imapaint); - int i; - - for (i= 0; i < data->paint.brush_count; i++) { - if (strcmp(me->id.name+2, data->paint.brushes[i]->id.name+2) == 0) - return 1; - } - - return 0; -} - static void rna_Brush_icon_update(Main *bmain, Scene *scene, PointerRNA *ptr) { Brush *br= (Brush*)ptr->data; @@ -395,42 +365,10 @@ static void rna_def_brush(BlenderRNA *brna) {SCULPT_DISP_DIR_Z, "Z", 0, "Z Plane", ""}, {0, NULL, 0, NULL, NULL}}; - FunctionRNA *func; - PropertyRNA *parm; - srna= RNA_def_struct(brna, "Brush", "ID"); RNA_def_struct_ui_text(srna, "Brush", "Brush datablock for storing brush settings for painting and sculpting"); RNA_def_struct_ui_icon(srna, ICON_BRUSH_DATA); - /* functions */ - func= RNA_def_function(srna, "is_sculpt_brush", "rna_Brush_is_sculpt_brush"); - RNA_def_function_ui_description(func, "Returns true if Brush can be used for sculpting"); - parm= RNA_def_pointer(func, "context", "Context", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "ret", 0, "", ""); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "is_vpaint_brush", "rna_Brush_is_vpaint_brush"); - RNA_def_function_ui_description(func, "Returns true if Brush can be used for vertex painting"); - parm= RNA_def_pointer(func, "context", "Context", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "ret", 0, "", ""); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "is_wpaint_brush", "rna_Brush_is_wpaint_brush"); - RNA_def_function_ui_description(func, "Returns true if Brush can be used for weight painting"); - parm= RNA_def_pointer(func, "context", "Context", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "ret", 0, "", ""); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "is_imapaint_brush", "rna_Brush_is_imapaint_brush"); - RNA_def_function_ui_description(func, "Returns true if Brush can be used for image painting"); - parm= RNA_def_pointer(func, "context", "Context", "", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "ret", 0, "", ""); - RNA_def_function_return(func, parm); - /* enums */ prop= RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_blend_items); @@ -734,6 +672,23 @@ static void rna_def_brush(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Curve", "Editable falloff curve"); RNA_def_property_update(prop, 0, "rna_Brush_update"); + /* paint mode flags */ + prop= RNA_def_property(srna, "use_paint_sculpt", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_SCULPT); + RNA_def_property_ui_text(prop, "Use Sculpt", "Use this brush in sculpt mode"); + + prop= RNA_def_property(srna, "use_paint_vertex", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_VERTEX_PAINT); + RNA_def_property_ui_text(prop, "Use Vertex", "Use this brush in vertex paint mode"); + + prop= RNA_def_property(srna, "use_paint_weight", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_WEIGHT_PAINT); + RNA_def_property_ui_text(prop, "Use Weight", "Use this brush in weight paint mode"); + + prop= RNA_def_property(srna, "use_paint_texture", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "ob_mode", OB_MODE_TEXTURE_PAINT); + RNA_def_property_ui_text(prop, "Use Texture", "Use this brush in texture paint mode"); + /* texture */ prop= RNA_def_property(srna, "texture_slot", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BrushTextureSlot"); diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c index 3518044a601..58ecb78d3b8 100644 --- a/source/blender/makesrna/intern/rna_cloth.c +++ b/source/blender/makesrna/intern/rna_cloth.c @@ -353,7 +353,7 @@ static void rna_def_cloth_sim_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "rest_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "ShapeKey"); - RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", "rna_ClothSettings_rest_shape_key_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_ClothSettings_rest_shape_key_get", "rna_ClothSettings_rest_shape_key_set", NULL, NULL); RNA_def_property_ui_text(prop, "Rest Shade Key", "Shape key to use the rest spring lengths from"); RNA_def_property_update(prop, 0, "rna_cloth_update"); diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index f33ca10f934..077b8ffe199 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -29,6 +29,7 @@ #include "rna_internal.h" #include "DNA_color_types.h" +#include "DNA_texture_types.h" #ifdef RNA_RUNTIME diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 05bddfa7a32..566e6fc0b83 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -1067,6 +1067,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); @@ -1273,7 +1274,8 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tar"); // TODO: curve only! + RNA_def_property_pointer_sdna(prop, NULL, "tar"); // TODO: curve only for set function! + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); @@ -1707,7 +1709,8 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data"); prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "target"); + RNA_def_property_pointer_sdna(prop, NULL, "target"); /* TODO, mesh type */ + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll"); RNA_def_property_ui_text(prop, "Target", "Target Object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT|ND_CONSTRAINT, "rna_Constraint_dependency_update"); diff --git a/source/blender/makesrna/intern/rna_context.c b/source/blender/makesrna/intern/rna_context.c index 9ee2ca1a322..6cc93d088ad 100644 --- a/source/blender/makesrna/intern/rna_context.c +++ b/source/blender/makesrna/intern/rna_context.c @@ -76,13 +76,19 @@ static PointerRNA rna_Context_region_get(PointerRNA *ptr) return newptr; } -/*static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) +static PointerRNA rna_Context_region_data_get(PointerRNA *ptr) { bContext *C= (bContext*)ptr->data; - PointerRNA newptr; - RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionData, CTX_wm_region_data(C), &newptr); - return newptr; -}*/ + + /* only exists for one space still, no generic system yet */ + if(CTX_wm_view3d(C)) { + PointerRNA newptr; + RNA_pointer_create((ID*)CTX_wm_screen(C), &RNA_RegionView3D, CTX_wm_region_data(C), &newptr); + return newptr; + } + + return PointerRNA_NULL; +} static PointerRNA rna_Context_main_get(PointerRNA *ptr) { @@ -148,58 +154,58 @@ void RNA_def_context(BlenderRNA *brna) prop= RNA_def_property(srna, "manager", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "WindowManager"); - RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_manager_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "window", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Window"); - RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_window_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "screen", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Screen"); - RNA_def_property_pointer_funcs(prop, "rna_Context_screen_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_screen_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "area", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Area"); - RNA_def_property_pointer_funcs(prop, "rna_Context_area_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_area_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "space_data", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Space"); - RNA_def_property_pointer_funcs(prop, "rna_Context_space_data_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_space_data_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "region", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Region"); - RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_region_get", NULL, NULL, NULL); - /*prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE); + prop= RNA_def_property(srna, "region_data", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); - RNA_def_property_struct_type(prop, "RegionData"); - RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL);*/ + RNA_def_property_struct_type(prop, "RegionView3D"); + RNA_def_property_pointer_funcs(prop, "rna_Context_region_data_get", NULL, NULL, NULL); /* Data */ prop= RNA_def_property(srna, "main", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Main"); - RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_main_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Scene"); - RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_scene_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "tool_settings", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "ToolSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_tool_settings_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "user_preferences", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "UserPreferences"); - RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Context_user_preferences_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, mode_items); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index 335f5919004..2cd7953d878 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -285,6 +285,20 @@ static void rna_Curve_bevelObject_set(PointerRNA *ptr, PointerRNA value) } } +static int rna_Curve_otherObject_poll(PointerRNA *ptr, PointerRNA value) +{ + Curve *cu= (Curve*)ptr->id.data; + Object *ob= (Object*)value.data; + + if (ob) { + if (ob->type == OB_CURVE && ob->data != cu) { + return 1; + } + } + + return 0; +} + static PointerRNA rna_Curve_taperObject_get(PointerRNA *ptr) { Curve *cu= (Curve*)ptr->id.data; @@ -685,7 +699,12 @@ static void rna_def_path(BlenderRNA *brna, StructRNA *srna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_STRETCH); RNA_def_property_ui_text(prop, "Stretch", "Option for curve-deform: makes deformed child to stretch along entire path"); RNA_def_property_update(prop, 0, "rna_Curve_update_data"); - + + prop= RNA_def_property(srna, "use_deform_bounds", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", CU_DEFORM_BOUNDS_OFF); + RNA_def_property_ui_text(prop, "Bounds Clamp", "Use the mesh bounds to clamp the deformation"); + RNA_def_property_update(prop, 0, "rna_Curve_update_data"); + prop= RNA_def_property(srna, "use_time_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_OFFS_PATHDIST); RNA_def_property_ui_text(prop, "Offset Path Distance", "Children will use TimeOffs value as path distance offset"); @@ -819,6 +838,7 @@ static void rna_def_font(BlenderRNA *brna, StructRNA *srna) /* pointers */ prop= RNA_def_property(srna, "text_on_curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "textoncurve"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_otherObject_poll"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text on Curve", "Curve deforming text object"); RNA_def_property_update(prop, 0, "rna_Curve_update_deps"); @@ -1024,7 +1044,7 @@ static void rna_def_curve_splines(BlenderRNA *brna, PropertyRNA *cprop) prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Curve_active_spline_get", "rna_Curve_active_spline_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Spline", "Active curve spline"); /* Could call: ED_base_object_activate(C, scene->basact); @@ -1144,7 +1164,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape"); RNA_def_property_update(prop, 0, "rna_Curve_update_deps"); - RNA_def_property_pointer_funcs(prop, "rna_Curve_bevelObject_get", "rna_Curve_bevelObject_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Curve_bevelObject_get", "rna_Curve_bevelObject_set", NULL, "rna_Curve_otherObject_poll"); prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); @@ -1152,7 +1172,7 @@ static void rna_def_curve(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width)"); RNA_def_property_update(prop, 0, "rna_Curve_update_deps"); - RNA_def_property_pointer_funcs(prop, "rna_Curve_taperObject_get", "rna_Curve_taperObject_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Curve_taperObject_get", "rna_Curve_taperObject_set", NULL, "rna_Curve_otherObject_poll"); /* Flags */ diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index fbcc3109af4..d89d0ad5d29 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -476,7 +476,7 @@ void RNA_struct_free(BlenderRNA *brna, StructRNA *srna) if(srna->flag & STRUCT_RUNTIME) { if(RNA_struct_py_type_get(srna)) { - fprintf(stderr, "StructRNA \"%s\" freed while holding a python reference\n", srna->name); + fprintf(stderr, "RNA_struct_free '%s' freed while holding a python reference\n", srna->identifier); } } @@ -670,7 +670,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char * if(DefRNA.preprocess) { RNA_def_property_struct_type(prop, "Struct"); - RNA_def_property_pointer_funcs(prop, "rna_builtin_type_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_builtin_type_get", NULL, NULL, NULL); } else { #ifdef RNA_RUNTIME @@ -737,7 +737,7 @@ void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const cha void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop) { if(prop->type != PROP_STRING) { - fprintf(stderr, "RNA_def_struct_name_property: %s.%s, must be a string property.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_struct_name_property: \"%s.%s\", must be a string property.\n", srna->identifier, prop->identifier); DefRNA.error= 1; } else @@ -847,7 +847,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier char error[512]; if (rna_validate_identifier(identifier, error, 1) == 0) { - fprintf(stderr, "RNA_def_property: property identifier \"%s\" - %s\n", identifier, error); + fprintf(stderr, "RNA_def_property: property identifier \"%s.%s\" - %s\n", srna->identifier, identifier, error); DefRNA.error= 1; } @@ -855,7 +855,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier /* XXX - toto, detect supertype collisions */ if(rna_findlink(&dcont->properties, identifier)) { - fprintf(stderr, "RNA_def_property: duplicate identifier \"%s\"\n", identifier); + fprintf(stderr, "RNA_def_property: duplicate identifier \"%s.%s\"\n", srna->identifier, identifier); DefRNA.error= 1; } @@ -913,7 +913,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier case PROP_COLLECTION: break; default: - fprintf(stderr, "RNA_def_property: %s.%s, invalid property type.\n", srna->identifier, identifier); + fprintf(stderr, "RNA_def_property: \"%s.%s\", invalid property type.\n", srna->identifier, identifier); DefRNA.error= 1; return NULL; } @@ -1009,13 +1009,13 @@ void RNA_def_property_array(PropertyRNA *prop, int length) StructRNA *srna= DefRNA.laststruct; if(length<0) { - fprintf(stderr, "RNA_def_property_array: %s.%s, array length must be zero of greater.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array length must be zero of greater.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } if(length>RNA_MAX_ARRAY_LENGTH) { - fprintf(stderr, "RNA_def_property_array: %s.%s, array length must be smaller than %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH); + fprintf(stderr, "RNA_def_property_array: \"%s.%s\", array length must be smaller than %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH); DefRNA.error= 1; return; } @@ -1029,7 +1029,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length) prop->arraydimension= 1; break; default: - fprintf(stderr, "RNA_def_property_array: %s.%s, only boolean/int/float can be array.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_array: \"%s.%s\", only boolean/int/float can be array.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1041,7 +1041,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, int length[] int i; if (dimension < 1 || dimension > RNA_MAX_ARRAY_DIMENSION) { - fprintf(stderr, "RNA_def_property_multi_array: %s.%s, array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION); + fprintf(stderr, "RNA_def_property_multi_array: \"%s.%s\", array dimension must be between 1 and %d.\n", srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION); DefRNA.error= 1; return; } @@ -1052,7 +1052,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, int length[] case PROP_FLOAT: break; default: - fprintf(stderr, "RNA_def_property_multi_array: %s.%s, only boolean/int/float can be array.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_multi_array: \"%s.%s\", only boolean/int/float can be array.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1107,7 +1107,7 @@ void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double break; } default: - fprintf(stderr, "RNA_def_property_ui_range: %s.%s, invalid type for ui range.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_ui_range: \"%s.%s\", invalid type for ui range.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1135,7 +1135,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max) break; } default: - fprintf(stderr, "RNA_def_property_range: %s.%s, invalid type for range.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_range: \"%s.%s\", invalid type for range.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1146,7 +1146,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type) StructRNA *srna= DefRNA.laststruct; if(!DefRNA.preprocess) { - fprintf(stderr, "RNA_def_property_struct_type %s.%s: only during preprocessing.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_struct_type \"%s.%s\": only during preprocessing.\n", srna->identifier, prop->identifier); return; } @@ -1162,7 +1162,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type) break; } default: - fprintf(stderr, "RNA_def_property_struct_type: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_struct_type: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1193,7 +1193,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type) break; } default: - fprintf(stderr, "RNA_def_property_struct_runtime: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_struct_runtime: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1228,7 +1228,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item break; } default: - fprintf(stderr, "RNA_def_property_enum_items: %s.%s, invalid type for struct type.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_enum_items: \"%s.%s\", invalid type for struct type.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1245,7 +1245,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength) break; } default: - fprintf(stderr, "RNA_def_property_string_maxlength: %s.%s, type is not string.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_string_maxlength: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1262,7 +1262,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, int value) break; } default: - fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_boolean_default: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1279,7 +1279,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const int *array) break; } default: - fprintf(stderr, "RNA_def_property_boolean_default: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_boolean_default: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1296,7 +1296,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value) break; } default: - fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_int_default: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1313,7 +1313,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array) break; } default: - fprintf(stderr, "RNA_def_property_int_default: %s.%s, type is not int.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_int_default: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1330,7 +1330,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value) break; } default: - fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_float_default: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1347,7 +1347,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array) break; } default: - fprintf(stderr, "RNA_def_property_float_default: %s.%s, type is not float.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_float_default: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1364,7 +1364,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value) break; } default: - fprintf(stderr, "RNA_def_property_string_default: %s.%s, type is not string.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_string_default: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1390,7 +1390,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) eprop->defaultvalue= eprop->item[0].value; } else { - fprintf(stderr, "RNA_def_property_enum_default: %s.%s, default is not in items.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_enum_default: \"%s.%s\", default is not in items.\n", srna->identifier, prop->identifier); DefRNA.error= 1; } } @@ -1398,7 +1398,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) break; } default: - fprintf(stderr, "RNA_def_property_enum_default: %s.%s, type is not enum.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_enum_default: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1437,7 +1437,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, const char *stru return dp; } else { - fprintf(stderr, "rna_def_property_sdna: %s.%s not found.\n", structname, propname); + fprintf(stderr, "rna_def_property_sdna: \"%s.%s\" not found.\n", structname, propname); DefRNA.error= 1; return NULL; } @@ -1475,7 +1475,7 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, co } if(prop->type != PROP_BOOLEAN) { - fprintf(stderr, "RNA_def_property_boolean_sdna: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_boolean_sdna: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } @@ -1508,7 +1508,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const } if(prop->type != PROP_INT) { - fprintf(stderr, "RNA_def_property_int_sdna: %s.%s, type is not int.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_int_sdna: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } @@ -1546,7 +1546,7 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons } if(prop->type != PROP_FLOAT) { - fprintf(stderr, "RNA_def_property_float_sdna: %s.%s, type is not float.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_float_sdna: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } @@ -1565,7 +1565,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const } if(prop->type != PROP_ENUM) { - fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, type is not enum.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_enum_sdna: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } @@ -1576,7 +1576,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const prop->totarraylength= 0; if(!DefRNA.silent) { - fprintf(stderr, "RNA_def_property_enum_sdna: %s.%s, array not supported for enum type.\n", structname, propname); + fprintf(stderr, "RNA_def_property_enum_sdna: \"%s.%s\", array not supported for enum type.\n", structname, propname); DefRNA.error= 1; } } @@ -1607,7 +1607,7 @@ void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, con } if(prop->type != PROP_STRING) { - fprintf(stderr, "RNA_def_property_string_sdna: %s.%s, type is not string.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_string_sdna: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } @@ -1632,7 +1632,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co } if(prop->type != PROP_POINTER) { - fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, type is not pointer.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_pointer_sdna: \"%s.%s\", type is not pointer.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } @@ -1643,7 +1643,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co prop->totarraylength= 0; if(!DefRNA.silent) { - fprintf(stderr, "RNA_def_property_pointer_sdna: %s.%s, array not supported for pointer type.\n", structname, propname); + fprintf(stderr, "RNA_def_property_pointer_sdna: \"%s.%s\", array not supported for pointer type.\n", structname, propname); DefRNA.error= 1; } } @@ -1662,7 +1662,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, } if(prop->type != PROP_COLLECTION) { - fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, type is not collection.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\", type is not collection.\n", srna->identifier, prop->identifier); DefRNA.error= 1; return; } @@ -1673,7 +1673,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, prop->totarraylength= 0; if(!DefRNA.silent) { - fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s, array of collections not supported.\n", structname, propname); + fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\", array of collections not supported.\n", structname, propname); DefRNA.error= 1; } } @@ -1714,7 +1714,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, } else { if(!DefRNA.silent) { - fprintf(stderr, "RNA_def_property_collection_sdna: %s.%s not found.\n", structname, lengthpropname); + fprintf(stderr, "RNA_def_property_collection_sdna: \"%s.%s\" not found.\n", structname, lengthpropname); DefRNA.error= 1; } } @@ -1794,7 +1794,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch break; } default: - fprintf(stderr, "RNA_def_property_boolean_funcs: %s.%s, type is not boolean.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_boolean_funcs: \"%s.%s\", type is not boolean.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1825,7 +1825,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, const char *get, const char * break; } default: - fprintf(stderr, "RNA_def_property_int_funcs: %s.%s, type is not int.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_int_funcs: \"%s.%s\", type is not int.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1856,7 +1856,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, const char *get, const char break; } default: - fprintf(stderr, "RNA_def_property_float_funcs: %s.%s, type is not float.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_float_funcs: \"%s.%s\", type is not float.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1881,7 +1881,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char break; } default: - fprintf(stderr, "RNA_def_property_enum_funcs: %s.%s, type is not enum.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_enum_funcs: \"%s.%s\", type is not enum.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1906,13 +1906,13 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const cha break; } default: - fprintf(stderr, "RNA_def_property_string_funcs: %s.%s, type is not string.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_string_funcs: \"%s.%s\", type is not string.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } } -void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef) +void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *typef, const char *poll) { StructRNA *srna= DefRNA.laststruct; @@ -1928,10 +1928,11 @@ void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const ch if(get) pprop->get= (PropPointerGetFunc)get; if(set) pprop->set= (PropPointerSetFunc)set; if(typef) pprop->typef= (PropPointerTypeFunc)typef; + if(poll) pprop->poll= (PropPointerPollFunc)poll; break; } default: - fprintf(stderr, "RNA_def_property_pointer_funcs: %s.%s, type is not pointer.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_pointer_funcs: \"%s.%s\", type is not pointer.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -1960,7 +1961,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, con break; } default: - fprintf(stderr, "RNA_def_property_collection_funcs: %s.%s, type is not collection.\n", srna->identifier, prop->identifier); + fprintf(stderr, "RNA_def_property_collection_funcs: \"%s.%s\", type is not collection.\n", srna->identifier, prop->identifier); DefRNA.error= 1; break; } @@ -2422,11 +2423,11 @@ FunctionRNA *RNA_def_function_runtime(StructRNA *srna, const char *identifier, C void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret) { if (ret->flag & PROP_DYNAMIC) { - fprintf(stderr, "RNA_def_function_return: %s.%s, dynamic values are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier); + fprintf(stderr, "RNA_def_function_return: \"%s.%s\", dynamic values are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier); return; } else if (ret->arraydimension) { - fprintf(stderr, "RNA_def_function_return: %s.%s, arrays are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier); + fprintf(stderr, "RNA_def_function_return: \"%s.%s\", arrays are not allowed as strict returns, use RNA_def_function_output instead.\n", func->identifier, ret->identifier); return; } diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 09f531cf95d..5dc75c5cf62 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -989,7 +989,7 @@ static void rna_def_drivertarget(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable"); /* 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"); + 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"); @@ -1261,7 +1261,7 @@ static void rna_def_fcurve_modifiers(BlenderRNA *brna, PropertyRNA *cprop) /* Collection active property */ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "FModifier"); - RNA_def_property_pointer_funcs(prop, "rna_FCurve_active_modifier_get", "rna_FCurve_active_modifier_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_FCurve_active_modifier_get", "rna_FCurve_active_modifier_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active F-Curve Modifier", "Active F-Curve Modifier"); @@ -1359,7 +1359,7 @@ static void rna_def_fcurve(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "grp"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Group", "Action Group that this F-Curve belongs to"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_FCurve_group_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_FCurve_group_set", NULL, NULL); RNA_def_property_update(prop, NC_ANIMATION, NULL); /* Path + Array Index */ diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index f92918fbbb3..917025a7a89 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -207,11 +207,18 @@ PointerRNA rna_object_shapekey_index_get(struct ID *id, int value); int rna_object_shapekey_index_set(struct ID *id, PointerRNA value, int current); /* named internal so as not to conflict with obj.update() rna func */ -void rna_Object_internal_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); void rna_Object_internal_update_data(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); void rna_Mesh_update_draw(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); void rna_TextureSlot_update(struct Main *bmain, struct Scene *scene, struct PointerRNA *ptr); +/* basic poll functions for object types */ +int rna_Armature_object_poll(struct PointerRNA *ptr, struct PointerRNA value); +int rna_Camera_object_poll(struct PointerRNA *ptr, struct PointerRNA value); +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); + + char *rna_TextureSlot_path(struct PointerRNA *ptr); /* API functions */ diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 7737d6094bc..216533a8708 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -87,6 +87,7 @@ typedef EnumPropertyItem *(*PropEnumItemFunc)(struct bContext *C, struct Pointer typedef PointerRNA (*PropPointerGetFunc)(struct PointerRNA *ptr); typedef StructRNA* (*PropPointerTypeFunc)(struct PointerRNA *ptr); typedef void (*PropPointerSetFunc)(struct PointerRNA *ptr, const PointerRNA value); +typedef int (*PropPointerPollFunc)(struct PointerRNA *ptr, const PointerRNA value); typedef void (*PropCollectionBeginFunc)(struct CollectionPropertyIterator *iter, struct PointerRNA *ptr); typedef void (*PropCollectionNextFunc)(struct CollectionPropertyIterator *iter); typedef void (*PropCollectionEndFunc)(struct CollectionPropertyIterator *iter); @@ -257,6 +258,7 @@ typedef struct PointerPropertyRNA { PropPointerGetFunc get; PropPointerSetFunc set; PropPointerTypeFunc typef; + PropPointerPollFunc poll; /* unlike operators, 'set' can still run if poll fails, used for filtering display */ struct StructRNA *type; } PointerPropertyRNA; diff --git a/source/blender/makesrna/intern/rna_key.c b/source/blender/makesrna/intern/rna_key.c index 7e9aebeffa4..26a101303b1 100644 --- a/source/blender/makesrna/intern/rna_key.c +++ b/source/blender/makesrna/intern/rna_key.c @@ -433,7 +433,7 @@ static void rna_def_keyblock(BlenderRNA *brna) prop= RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_ShapeKey_relative_key_get", "rna_ShapeKey_relative_key_set", NULL, NULL); RNA_def_property_ui_text(prop, "Relative Key", "Shape used as a relative key"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 769d73d9f79..4e2504516ec 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -741,7 +741,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna) prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "LampSkySettings"); - RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps"); rna_def_lamp_sky_settings(brna); diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index c2f3953e627..0fc569acf83 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -352,7 +352,7 @@ void RNA_def_main(BlenderRNA *brna) prop= RNA_def_property(srna, "test", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Test"); - RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Test_test_get", NULL, NULL, NULL); RNA_define_verify_sdna(1); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 1c790898ef2..9b4548e0de6 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -1682,13 +1682,13 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "raytrace_mirror", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialRaytraceMirror"); - RNA_def_property_pointer_funcs(prop, "rna_Material_mirror_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_mirror_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Raytrace Mirror", "Raytraced reflection settings for the material"); prop= RNA_def_property(srna, "raytrace_transparency", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialRaytraceTransparency"); - RNA_def_property_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_transp_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Raytrace Transparency", "Raytraced transparency settings for the material"); prop= RNA_def_property(srna, "volume", PROP_POINTER, PROP_NONE); @@ -1700,25 +1700,25 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "halo", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialHalo"); - RNA_def_property_pointer_funcs(prop, "rna_Material_halo_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_halo_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Halo", "Halo settings for the material"); prop= RNA_def_property(srna, "subsurface_scattering", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialSubsurfaceScattering"); - RNA_def_property_pointer_funcs(prop, "rna_Material_sss_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_sss_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Subsurface Scattering", "Subsurface scattering settings for the material"); prop= RNA_def_property(srna, "strand", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialStrand"); - RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_strand_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Strand", "Strand settings for the material"); prop= RNA_def_property(srna, "physics", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "MaterialPhysics"); - RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_physics_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Physics", "Game physics settings"); /* nodetree */ @@ -1735,7 +1735,7 @@ void RNA_def_material(BlenderRNA *brna) prop= RNA_def_property(srna, "active_node_material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", "rna_Material_active_node_material_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Material_active_node_material_get", "rna_Material_active_node_material_set", NULL, NULL); RNA_def_property_ui_text(prop, "Material", "Active node material"); RNA_def_property_update(prop, NC_MATERIAL, NULL); @@ -1781,7 +1781,7 @@ void rna_def_mtex_common(StructRNA *srna, const char *begin, const char *activeg prop= RNA_def_property(srna, "active_texture", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Texture"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL); + RNA_def_property_pointer_funcs(prop, activeget, activeset, NULL, NULL); RNA_def_property_ui_text(prop, "Active Texture", "Active texture slot being displayed"); RNA_def_property_update(prop, 0, update); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 37d6b2b93de..cdab225f09c 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -581,8 +581,7 @@ static int rna_CustomDataData_numverts(PointerRNA *ptr, int type) Mesh *me= (Mesh*)ptr->id.data; CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; - int a; - size_t b; + int a, b; for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) { if(cdl->type == type) { @@ -979,8 +978,7 @@ static char *rna_CustomDataData_path(PointerRNA *ptr, char *collection, int type Mesh *me= (Mesh*)ptr->id.data; CustomData *fdata= rna_mesh_fdata(me); CustomDataLayer *cdl; - int a; - size_t b; + int a, b; for(cdl=fdata->layers, a=0; a<fdata->totlayer; cdl++, a++) { if(cdl->type == type) { @@ -1313,7 +1311,7 @@ static void rna_def_mtface(BlenderRNA *brna) prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tpage"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_TextureFace_image_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Image", ""); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); @@ -1620,7 +1618,7 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop) prop= RNA_def_property(srna, "active_tface", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTextureFace"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_mtface_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_mtface_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Texture Face", "Active Texture Face"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); } @@ -1671,7 +1669,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "active_uv_texture", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_texture_get", "rna_Mesh_active_uv_texture_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_uv_texture_get", "rna_Mesh_active_uv_texture_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active UV Texture", "Active UV texture"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); @@ -1683,7 +1681,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "uv_texture_clone", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get", "rna_Mesh_uv_texture_clone_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_clone_get", "rna_Mesh_uv_texture_clone_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Clone UV Texture", "UV texture to be used as cloning source"); @@ -1693,7 +1691,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "uv_texture_stencil", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshTextureFaceLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_stencil_get", "rna_Mesh_uv_texture_stencil_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_uv_texture_stencil_get", "rna_Mesh_uv_texture_stencil_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Mask UV Texture", "UV texture to mask the painted area"); @@ -1711,7 +1709,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "active_vertex_color", PROP_POINTER, PROP_UNSIGNED); RNA_def_property_struct_type(prop, "MeshColorLayer"); - RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vertex_color_get", "rna_Mesh_active_vertex_color_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Mesh_active_vertex_color_get", "rna_Mesh_active_vertex_color_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Vertex Color Layer", "Active vertex color layer"); RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index fa5d703a84f..49c67697291 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -659,7 +659,7 @@ static void rna_def_modifier_lattice(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_LatticeModifier_object_set", NULL, "rna_Lattice_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -691,7 +691,7 @@ static void rna_def_modifier_curve(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Curve object to deform with"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_CurveModifier_object_set", NULL, "rna_Curve_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -983,7 +983,7 @@ static void rna_def_modifier_armature(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Armature object to deform with"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_ArmatureModifier_object_set", NULL, "rna_Armature_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1070,13 +1070,13 @@ static void rna_def_modifier_softbody(BlenderRNA *brna) prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "SoftBodySettings"); - RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_settings_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Soft Body Settings", ""); prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "PointCache"); - RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_SoftBodyModifier_point_cache_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Soft Body Point Cache", ""); } @@ -1098,7 +1098,7 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_BooleanModifier_object_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1145,7 +1145,7 @@ static void rna_def_modifier_array(BlenderRNA *brna) prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curve_ob"); RNA_def_property_ui_text(prop, "Curve", "Curve object to fit array length to"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_curve_set", NULL, "rna_Curve_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1203,13 +1203,13 @@ static void rna_def_modifier_array(BlenderRNA *brna) /* Caps */ prop= RNA_def_property(srna, "start_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Start Cap", "Mesh object to use as a start cap"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_start_cap_set", NULL, "rna_Mesh_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_update"); prop= RNA_def_property(srna, "end_cap", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "End Cap", "Mesh object to use as an end cap"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_ArrayModifier_end_cap_set", NULL, "rna_Mesh_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } @@ -1286,7 +1286,7 @@ static void rna_def_modifier_displace(BlenderRNA *brna) 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_range(prop, -100, 100, 10, 3); RNA_def_property_ui_text(prop, "Strength", ""); RNA_def_property_update(prop, 0, "rna_Modifier_update"); @@ -1384,9 +1384,10 @@ static void rna_def_modifier_uvproject(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_UVProjector_object_get", "rna_UVProjector_object_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Object", "Object to use as projector transform"); + RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); } static void rna_def_modifier_smooth(BlenderRNA *brna) @@ -1457,7 +1458,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Control object: if available, its location determines the center of the effect"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_CastModifier_object_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1530,7 +1531,7 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_MeshDeformModifier_object_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1792,7 +1793,7 @@ static void rna_def_modifier_collision(BlenderRNA *brna) prop= RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "CollisionSettings"); - RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_CollisionModifier_settings_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Settings", ""); } @@ -1874,14 +1875,14 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) prop= RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Target", "Mesh target to shrink to"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_target_set", NULL, "rna_Mesh_object_poll"); 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, "auxiliary_target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "auxTarget"); RNA_def_property_ui_text(prop, "Auxiliary Target", "Additional mesh target to shrink to"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_ShrinkwrapModifier_auxiliary_target_set", NULL, "rna_Mesh_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); @@ -1985,7 +1986,7 @@ static void rna_def_modifier_mask(BlenderRNA *brna) prop= RNA_def_property(srna, "armature", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_arm"); RNA_def_property_ui_text(prop, "Armature", "Armature to use as source of bones to mask"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskModifier_armature_set", NULL, "rna_Armature_object_poll"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 29666c6ed04..51e2fc38014 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -129,18 +129,18 @@ EnumPropertyItem object_type_curve_items[] = { #include "ED_object.h" #include "ED_particle.h" -void rna_Object_internal_update(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Object_internal_update(Main *bmain, Scene *scene, PointerRNA *ptr) { DAG_id_flush_update(ptr->id.data, OB_RECALC_OB); } -void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) +static void rna_Object_matrix_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) { object_apply_mat4(ptr->id.data, ((Object *)ptr->id.data)->obmat); rna_Object_internal_update(bmain, scene, ptr); } -void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) +static void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) { Object *ob= ptr->id.data; @@ -154,7 +154,7 @@ void rna_Object_matrix_local_get(PointerRNA *ptr, float values[16]) } } -void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) +static void rna_Object_matrix_local_set(PointerRNA *ptr, const float values[16]) { Object *ob= ptr->id.data; @@ -1052,6 +1052,32 @@ static void rna_Object_boundbox_get(PointerRNA *ptr, float *values) } +/* generic poll functions */ +int rna_Lattice_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_LATTICE; +} + +int rna_Curve_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_CURVE; +} + +int rna_Armature_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_ARMATURE; +} + +int rna_Mesh_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_MESH; +} + +int rna_Camera_object_poll(PointerRNA *ptr, PointerRNA value) +{ + return ((Object *)value.id.data)->type == OB_CAMERA; +} + #else static void rna_def_vertex_group(BlenderRNA *brna) @@ -1096,7 +1122,7 @@ static void rna_def_material_slot(BlenderRNA *brna) prop= RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_MaterialSlot_material_get", "rna_MaterialSlot_material_set", NULL, NULL); RNA_def_property_ui_text(prop, "Material", "Material datablock used by this material slot"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); @@ -1346,7 +1372,7 @@ static void rna_def_object_constraints(BlenderRNA *brna, PropertyRNA *cprop) /* Collection active property */ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_constraint_get", "rna_Object_active_constraint_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_constraint_get", "rna_Object_active_constraint_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); @@ -1391,7 +1417,7 @@ static void rna_def_object_modifiers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active EditBone", "Armatures active edit bone"); //RNA_def_property_update(prop, 0, "rna_Armature_act_editbone_update"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_edit_bone_set", NULL, NULL); /* todo, redraw */ // RNA_def_property_collection_active(prop, prop_act); @@ -1511,7 +1537,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "data", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef"); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_data_set", "rna_Object_data_typef", NULL); RNA_def_property_editable_func(prop, "rna_Object_data_editable"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Data", "Object data"); @@ -1551,7 +1577,7 @@ static void rna_def_object(BlenderRNA *brna) /* parent */ prop= RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Object_parent_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); RNA_def_property_ui_text(prop, "Parent", "Parent Object"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_dependency_update"); @@ -1606,7 +1632,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", "rna_Object_active_material_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_material_get", "rna_Object_active_material_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Material", "Active material being displayed"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Object_internal_update"); @@ -1760,7 +1786,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "game", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "GameObjectSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_game_settings_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Game Settings", "Game engine related settings for the object"); /* vertex groups */ @@ -1771,7 +1797,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_vertex_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "VertexGroup"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_vertex_group_get", "rna_Object_active_vertex_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object"); RNA_def_property_update(prop, NC_GEOM|ND_DATA, "rna_Object_internal_update_data"); @@ -1810,13 +1836,13 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "field", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "FieldSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_field_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Field Settings", "Settings for using the objects as a field in physics simulation"); prop= RNA_def_property(srna, "collision", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "CollisionSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_collision_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Collision Settings", "Settings for using the objects as a collider in physics simulation"); prop= RNA_def_property(srna, "soft_body", PROP_POINTER, PROP_NONE); @@ -1831,7 +1857,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ParticleSystem"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_particle_system_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Particle System", "Active particle system being displayed"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); @@ -2047,7 +2073,7 @@ static void rna_def_object(BlenderRNA *brna) prop= RNA_def_property(srna, "active_shape_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); - RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Object_active_shape_key_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Shape Key", "Current shape key"); prop= RNA_def_property(srna, "active_shape_key_index", PROP_INT, PROP_NONE); @@ -2072,7 +2098,7 @@ static void rna_def_dupli_object(BlenderRNA *brna) prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob"); - /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL); */ + /* RNA_def_property_pointer_funcs(prop, "rna_DupliObject_object_get", NULL, NULL, NULL); */ RNA_def_property_ui_text(prop, "Object", "Object being duplicated"); prop= RNA_def_property(srna, "object_matrix", PROP_FLOAT, PROP_MATRIX); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index 4baf81a9427..a8ea4adb9b9 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1949,7 +1949,7 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "active_dupliweight", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ParticleDupliWeight"); - RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_ParticleDupliWeight_active_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Dupli Object", ""); prop= RNA_def_property(srna, "active_dupliweight_index", PROP_INT, PROP_UNSIGNED); @@ -1981,13 +1981,13 @@ static void rna_def_particle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "force_field_1", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd"); RNA_def_property_struct_type(prop, "FieldSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Particle_field1_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Particle_field1_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Force Field 1", ""); prop= RNA_def_property(srna, "force_field_2", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "pd2"); RNA_def_property_struct_type(prop, "FieldSettings"); - RNA_def_property_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Particle_field2_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Force Field 2", ""); } @@ -2069,7 +2069,7 @@ static void rna_def_particle_system(BlenderRNA *brna) //RNA_def_property_pointer_sdna(prop, NULL, "part"); RNA_def_property_struct_type(prop, "ParticleSettings"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); - RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_particle_settings_get", "rna_particle_settings_set", NULL, NULL); RNA_def_property_ui_text(prop, "Settings", "Particle system settings"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); @@ -2131,7 +2131,7 @@ static void rna_def_particle_system(BlenderRNA *brna) prop= RNA_def_property(srna, "active_particle_target", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ParticleTarget"); - RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_ParticleSystem_active_particle_target_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Particle Target", ""); prop= RNA_def_property(srna, "active_particle_target_index", PROP_INT, PROP_UNSIGNED); diff --git a/source/blender/makesrna/intern/rna_pose.c b/source/blender/makesrna/intern/rna_pose.c index d05a3d341ba..37b453ad7a4 100644 --- a/source/blender/makesrna/intern/rna_pose.c +++ b/source/blender/makesrna/intern/rna_pose.c @@ -632,7 +632,7 @@ static void rna_def_pose_channel_constraints(BlenderRNA *brna, PropertyRNA *cpro /* Collection active property */ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Constraint"); - RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get", "rna_PoseChannel_active_constraint_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_active_constraint_get", "rna_PoseChannel_active_constraint_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Constraint", "Active PoseChannel constraint"); @@ -970,7 +970,7 @@ static void rna_def_pose_channel(BlenderRNA *brna) prop= RNA_def_property(srna, "bone_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BoneGroup"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_PoseChannel_bone_group_get", "rna_PoseChannel_bone_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Bone Group", "Bone Group this pose channel belongs to"); RNA_def_property_editable_func(prop, "rna_PoseChannel_proxy_editable"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); @@ -1157,7 +1157,7 @@ static void rna_def_pose(BlenderRNA *brna) prop= RNA_def_property(srna, "active_bone_group", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BoneGroup"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Pose_active_bone_group_get", "rna_Pose_active_bone_group_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Bone Group", "Active bone group for this pose"); RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update"); @@ -1177,7 +1177,7 @@ static void rna_def_pose(BlenderRNA *brna) prop= RNA_def_property(srna, "ik_param", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "IKParam"); - RNA_def_property_pointer_funcs(prop, "rna_Pose_ikparam_get", NULL, "rna_Pose_ikparam_typef"); + RNA_def_property_pointer_funcs(prop, "rna_Pose_ikparam_get", NULL, "rna_Pose_ikparam_typef", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "IK Param", "Parameters for IK solver"); diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index aa174fd97c3..d3c81e3f324 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -884,19 +884,19 @@ static void rna_def_struct(BlenderRNA *brna) prop= RNA_def_property(srna, "base", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Struct"); - RNA_def_property_pointer_funcs(prop, "rna_Struct_base_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Struct_base_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Base", "Struct definition this is derived from"); prop= RNA_def_property(srna, "nested", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Struct"); - RNA_def_property_pointer_funcs(prop, "rna_Struct_nested_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Struct_nested_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Nested", "Struct in which this struct is always nested, and to which it logically belongs"); prop= RNA_def_property(srna, "name_property", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "StringProperty"); - RNA_def_property_pointer_funcs(prop, "rna_Struct_name_property_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Struct_name_property_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Name Property", "Property that gives the name of the struct"); prop= RNA_def_property(srna, "properties", PROP_COLLECTION, PROP_NONE); @@ -974,7 +974,7 @@ static void rna_def_property(BlenderRNA *brna) prop= RNA_def_property(srna, "srna", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Struct"); - RNA_def_property_pointer_funcs(prop, "rna_Property_srna_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Property_srna_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Base", "Struct definition used for properties assigned to this item"); prop= RNA_def_property(srna, "unit", PROP_ENUM, PROP_NONE); @@ -1212,9 +1212,9 @@ static void rna_def_pointer_property(StructRNA *srna, PropertyType type) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Struct"); if(type == PROP_POINTER) - RNA_def_property_pointer_funcs(prop, "rna_PointerProperty_fixed_type_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_PointerProperty_fixed_type_get", NULL, NULL, NULL); else - RNA_def_property_pointer_funcs(prop, "rna_CollectionProperty_fixed_type_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_CollectionProperty_fixed_type_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Pointer Type", "Fixed pointer type, empty if variable type"); } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index eea426ceb0c..aaedc75eb23 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -106,13 +106,17 @@ EnumPropertyItem image_type_items[] = { {R_TARGA, "TARGA", ICON_FILE_IMAGE, "Targa", ""}, {R_RAWTGA, "TARGA_RAW", ICON_FILE_IMAGE, "Targa Raw", ""}, {0, "", 0, " ", NULL}, +#ifdef WITH_CINEON {R_CINEON, "CINEON", ICON_FILE_IMAGE, "Cineon", ""}, {R_DPX, "DPX",ICON_FILE_IMAGE, "DPX", ""}, +#endif #ifdef WITH_OPENEXR {R_MULTILAYER, "MULTILAYER", ICON_FILE_IMAGE, "MultiLayer", ""}, {R_OPENEXR, "OPEN_EXR", ICON_FILE_IMAGE, "OpenEXR", ""}, #endif +#ifdef WITH_HDR {R_RADHDR, "HDR", ICON_FILE_IMAGE, "Radiance HDR", ""}, +#endif #ifdef WITH_TIFF {R_TIFF, "TIFF", ICON_FILE_IMAGE, "TIFF", ""}, #endif @@ -1195,7 +1199,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "skgen_template"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_skgen_etch_template_set", NULL, NULL); RNA_def_property_ui_text(prop, "Template", "Template armature that will be retargeted to the stroke"); prop= RNA_def_property(srna, "etch_subdivision_number", PROP_INT, PROP_NONE); @@ -1592,7 +1596,7 @@ static void rna_def_freestyle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "linestyle", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "FreestyleLineStyle"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); - RNA_def_property_pointer_funcs(prop, "rna_FreestyleLineSet_linestyle_get", "rna_FreestyleLineSet_linestyle_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_FreestyleLineSet_linestyle_get", "rna_FreestyleLineSet_linestyle_set", NULL, NULL); RNA_def_property_ui_text(prop, "Line Style", "Line style settings"); RNA_def_property_update(prop, NC_SCENE, NULL); @@ -1771,7 +1775,7 @@ static void rna_def_freestyle_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "active_lineset", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "FreestyleLineSet"); - RNA_def_property_pointer_funcs(prop, "rna_FreestyleSettings_active_lineset_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_FreestyleSettings_active_lineset_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Line Set", "Active line set being displayed"); RNA_def_property_update(prop, NC_SCENE, NULL); @@ -3131,7 +3135,7 @@ static void rna_def_scene_objects(BlenderRNA *brna, PropertyRNA *cprop) prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); - RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Scene_active_object_get", "rna_Scene_active_object_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Object", "Active object for this scene"); /* Could call: ED_base_object_activate(C, scene->basact); @@ -3222,6 +3226,7 @@ void RNA_def_scene(BlenderRNA *brna) /* Global Settings */ prop= RNA_def_property(srna, "camera", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll"); RNA_def_property_ui_text(prop, "Camera", "Active camera used for rendering the scene"); RNA_def_property_update(prop, NC_SCENE|NA_EDITED, "rna_Scene_view3d_update"); @@ -3229,7 +3234,7 @@ void RNA_def_scene(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "set"); RNA_def_property_struct_type(prop, "Scene"); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_ID_SELF_CHECK); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Scene_set_set", NULL, NULL); RNA_def_property_ui_text(prop, "Background Scene", "Background set scene"); RNA_def_property_update(prop, NC_SCENE|NA_EDITED, NULL); @@ -3384,7 +3389,7 @@ void RNA_def_scene(BlenderRNA *brna) prop= RNA_def_property(srna, "active_keying_set", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "KeyingSet"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_Scene_active_keying_set_get", "rna_Scene_active_keying_set_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Keying Set", "Active Keying Set used to insert/delete keyframes"); RNA_def_property_update(prop, NC_SCENE|ND_KEYINGSET, NULL); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index ecf2206c25c..cb028e6da1a 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -184,7 +184,7 @@ static void rna_def_screen(BlenderRNA *brna) prop= RNA_def_property(srna, "scene", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE|PROP_NEVER_NULL); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Screen_scene_set", NULL, NULL); RNA_def_property_ui_text(prop, "Scene", "Active scene to be edited in the screen"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, 0, "rna_Screen_scene_update"); diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 604f7776d56..435c90eb623 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -30,6 +30,7 @@ #include "DNA_ID.h" #include "DNA_scene_types.h" +#include "DNA_brush_types.h" #include "BKE_paint.h" @@ -88,29 +89,6 @@ static PointerRNA rna_ParticleBrush_curve_get(PointerRNA *ptr) return rna_pointer_inherit_refine(ptr, &RNA_CurveMapping, NULL); } -static void rna_Paint_brushes_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) -{ - Paint *p= (Paint*)ptr->data; - rna_iterator_array_begin(iter, (void*)p->brushes, sizeof(Brush*), p->brush_count, 0, NULL); -} - -static int rna_Paint_brushes_length(PointerRNA *ptr) -{ - Paint *p= (Paint*)ptr->data; - - return p->brush_count; -} - -static PointerRNA rna_Paint_active_brush_get(PointerRNA *ptr) -{ - return rna_pointer_inherit_refine(ptr, &RNA_Brush, paint_brush(ptr->data)); -} - -static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value) -{ - paint_brush_set(ptr->data, value.data); -} - static void rna_ParticleEdit_redo(Main *bmain, Scene *scene, PointerRNA *ptr) { Object *ob= (scene->basact)? scene->basact->object: NULL; @@ -133,7 +111,7 @@ static void rna_ParticleEdit_tool_set(PointerRNA *ptr, int value) ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; /* redraw hair completely if weight brush is/was used */ - if(pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) { + if((pset->brushtype == PE_BRUSH_WEIGHT || value == PE_BRUSH_WEIGHT) && pset->scene) { Object *ob = (pset->scene->basact)? pset->scene->basact->object: NULL; if(ob) { DAG_id_flush_update(&ob->id, OB_RECALC_DATA); @@ -163,63 +141,28 @@ static int rna_ParticleEdit_editable_get(PointerRNA *ptr) { ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; - return (pset->object && PE_get_current(pset->scene, pset->object)); + return (pset->object && pset->scene && PE_get_current(pset->scene, pset->object)); } static int rna_ParticleEdit_hair_get(PointerRNA *ptr) { ParticleEditSettings *pset= (ParticleEditSettings*)ptr->data; - PTCacheEdit *edit = PE_get_current(pset->scene, pset->object); - - return (edit && edit->psys); -} - -static void rna_Paint_active_brush_index_set(PointerRNA *ptr, int value) -{ - Paint *p= ptr->data; - CLAMP(value, 0, p->brush_count-1); - p->active_brush_index= value; -} - -static void rna_Paint_active_brush_index_range(PointerRNA *ptr, int *min, int *max) -{ - Paint *p= ptr->data; - *min= 0; - *max= MAX2(p->brush_count-1, 0); -} + if(pset->scene) { + PTCacheEdit *edit = PE_get_current(pset->scene, pset->object); -static void rna_Paint_active_brush_name_get(PointerRNA *ptr, char *value) -{ - Paint *p= ptr->data; - Brush *br = paint_brush(p); + return (edit && edit->psys); + } - BLI_strncpy(value, br->id.name+2, sizeof(br->id.name)-2); -} - - -static int rna_Paint_active_brush_name_length(PointerRNA *ptr) -{ - Paint *p= ptr->data; - Brush *br = paint_brush(p); - return strlen(br->id.name+2); + return 0; } -static void rna_Paint_active_brush_name_set(PointerRNA *ptr, const char *value) +static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value) { - Paint *p= ptr->data; - Brush *br; - int i; - - for(i = 0; i < p->brush_count; ++i) { - br = p->brushes[i]; - - if (strcmp(br->id.name+2, value)==0) { - paint_brush_set(p, br); - return; - } - } + Scene *scene= (Scene *)ptr->id.data; + Object *ob = OBACT; + Brush *brush= value.id.data; + return ob->mode & brush->ob_mode; } - #else static void rna_def_paint(BlenderRNA *brna) @@ -230,32 +173,11 @@ static void rna_def_paint(BlenderRNA *brna) srna= RNA_def_struct(brna, "Paint", NULL); RNA_def_struct_ui_text(srna, "Paint", ""); - prop= RNA_def_property(srna, "brushes", PROP_COLLECTION, PROP_NONE); - RNA_def_property_struct_type(prop, "Brush"); - RNA_def_property_collection_funcs(prop, "rna_Paint_brushes_begin", - "rna_iterator_array_next", - "rna_iterator_array_end", - "rna_iterator_array_dereference_get", - "rna_Paint_brushes_length", 0, 0); - RNA_def_property_ui_text(prop, "Brushes", "Brushes selected for this paint mode"); - - prop= RNA_def_property(srna, "active_brush_index", PROP_INT, PROP_NONE); - RNA_def_property_int_funcs(prop, NULL, "rna_Paint_active_brush_index_set", "rna_Paint_active_brush_index_range"); - RNA_def_property_range(prop, 0, INT_MAX); - RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL); - - prop= RNA_def_property(srna, "active_brush_name", PROP_STRING, PROP_NONE); - RNA_def_property_string_funcs(prop, "rna_Paint_active_brush_name_get", "rna_Paint_active_brush_name_length", "rna_Paint_active_brush_name_set"); - RNA_def_property_string_maxlength(prop, sizeof(((ID*)NULL)->name)-2); - RNA_def_property_ui_text(prop, "Active Brush Name", ""); - RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL); - - /* Fake property to get active brush directly, rather than integer index */ + /* Global Settings */ prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); - RNA_def_property_struct_type(prop, "Brush"); - RNA_def_property_pointer_funcs(prop, "rna_Paint_active_brush_get", "rna_Paint_active_brush_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Brush", "Active paint brush"); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Brush_mode_poll"); + RNA_def_property_ui_text(prop, "Brush", "Active Brush"); RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL); prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE); @@ -492,7 +414,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ParticleBrush"); - RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_ParticleEdit_brush_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Brush", ""); prop= RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); @@ -569,7 +491,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) /* dummy */ prop= RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "CurveMapping"); - RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_ParticleBrush_curve_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Curve", ""); } diff --git a/source/blender/makesrna/intern/rna_sensor.c b/source/blender/makesrna/intern/rna_sensor.c index 90a520d6d92..7a130efa37c 100644 --- a/source/blender/makesrna/intern/rna_sensor.c +++ b/source/blender/makesrna/intern/rna_sensor.c @@ -382,7 +382,7 @@ static void rna_def_touch_sensor(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material"); /* note: custom set function is ONLY to avoid rna setting a user for this. */ - RNA_def_property_pointer_funcs(prop, NULL, "rna_Sensor_touch_material_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Sensor_touch_material_set", NULL, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); } diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index eb0c7cb7487..b39a9fecebf 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -1218,6 +1218,7 @@ static void rna_def_scene(BlenderRNA *brna) prop= RNA_def_property(srna, "scene_camera", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); + RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Camera_object_poll"); RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera"); RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8bb736f7976..436e9f60dc7 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1136,7 +1136,7 @@ static void rna_def_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "current_orientation", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "TransformOrientation"); - RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_CurrentOrientation_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Current Transform Orientation", "Current Transformation orientation"); prop= RNA_def_property(srna, "lock_camera_and_layers", PROP_BOOLEAN, PROP_NONE); @@ -1161,12 +1161,12 @@ static void rna_def_space_view3d(BlenderRNA *brna) prop= RNA_def_property(srna, "region_3d", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "RegionView3D"); - RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_3d_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "3D Region", "3D region in this space, in case of quad view the camera region"); prop= RNA_def_property(srna, "region_quadview", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "RegionView3D"); - RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_SpaceView3D_region_quadview_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Quad View Region", "3D region that defines the quad view settings"); /* region */ @@ -1284,7 +1284,7 @@ static void rna_def_space_buttons(BlenderRNA *brna) 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. */ - RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceProperties_pin_id_set", "rna_SpaceProperties_pin_id_typef"); + 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"); @@ -1304,7 +1304,7 @@ static void rna_def_space_image(BlenderRNA *brna) /* image */ prop= RNA_def_property(srna, "image", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceImageEditor_image_set", NULL, NULL); RNA_def_property_ui_text(prop, "Image", "Image displayed and edited in this space"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_IMAGE, NULL); @@ -1354,7 +1354,7 @@ static void rna_def_space_image(BlenderRNA *brna) prop= RNA_def_property(srna, "uv_editor", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "SpaceUVEditor"); - RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_SpaceImageEditor_uvedit_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "UV Editor", "UV editor settings"); /* paint */ @@ -1532,7 +1532,7 @@ static void rna_def_space_text(BlenderRNA *brna) prop= RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text", "Text displayed and edited in this space"); - RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceTextEditor_text_set", NULL, NULL); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_TEXT, NULL); /* display */ @@ -1617,7 +1617,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); + RNA_def_property_pointer_funcs(prop, NULL, "rna_SpaceDopeSheetEditor_action_set", NULL, NULL); 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"); diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index 84fd217e64e..277a6b9e282 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -1447,7 +1447,7 @@ static void rna_def_texture_pointdensity(BlenderRNA *brna) prop= RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Particle System", "Particle System to render as points"); RNA_def_property_struct_type(prop, "ParticleSystem"); - RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL); + RNA_def_property_pointer_funcs(prop, "rna_PointDensity_psys_get", "rna_PointDensity_psys_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, 0, "rna_Texture_update"); diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c index d25efd23da0..e13483bf87a 100644 --- a/source/blender/makesrna/intern/rna_ui.c +++ b/source/blender/makesrna/intern/rna_ui.c @@ -545,10 +545,11 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop= RNA_def_property(srna, "operator_context", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, operator_context_items); RNA_def_property_enum_funcs(prop, "rna_UILayout_op_context_get", "rna_UILayout_op_context_set", NULL); - + prop= RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_enabled_get", "rna_UILayout_enabled_set"); - + RNA_def_property_ui_text(prop, "Enabled", "When false, this (sub)layout is greyed out."); + #if 0 prop= RNA_def_property(srna, "red_alert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_UILayout_red_alert_get", "rna_UILayout_red_alert_set"); @@ -565,10 +566,11 @@ static void rna_def_ui_layout(BlenderRNA *brna) prop= RNA_def_property(srna, "scale_x", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_x_get", "rna_UILayout_scale_x_set", NULL); - + RNA_def_property_ui_text(prop, "Scale X", "Scale factor along the X for items in this (sub)layout."); + prop= RNA_def_property(srna, "scale_y", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_funcs(prop, "rna_UILayout_scale_y_get", "rna_UILayout_scale_y_set", NULL); - + RNA_def_property_ui_text(prop, "Scale Y", "Scale factor along the Y for items in this (sub)layout."); RNA_api_ui_layout(srna); } @@ -580,68 +582,77 @@ static void rna_def_panel(BlenderRNA *brna) FunctionRNA *func; srna= RNA_def_struct(brna, "Panel", NULL); - RNA_def_struct_ui_text(srna, "Panel", "Panel containing buttons"); + RNA_def_struct_ui_text(srna, "Panel", "Panel containing UI elements"); RNA_def_struct_sdna(srna, "Panel"); RNA_def_struct_refine_func(srna, "rna_Panel_refine"); RNA_def_struct_register_funcs(srna, "rna_Panel_register", "rna_Panel_unregister"); /* poll */ func= RNA_def_function(srna, "poll", NULL); - RNA_def_function_ui_description(func, "Test if the panel is visible or not."); - RNA_def_function_flag(func, FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); + RNA_def_function_ui_description(func, "If this method returns a non-null output, then the panel can be drawn."); + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw buttons into the panel UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the panel UI layout."); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "draw_header", NULL); - RNA_def_function_ui_description(func, "Draw buttons into the panel header UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the panel's header UI layout."); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "UILayout"); - + RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the panel in the UI."); + prop= RNA_def_property(srna, "text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "drawname"); - + RNA_def_property_ui_text(prop, "Text", "XXX todo"); + /* registration */ prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_flag(prop, PROP_REGISTER); - + RNA_def_property_ui_text(prop, "ID Name", "If this is set, the panel gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_PT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_PT_hello\""); + prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->label"); RNA_def_property_flag(prop, PROP_REGISTER); - + RNA_def_property_ui_text(prop, "Label", "The panel label, shows up in the panel header at the right of the triangle used to collapse the panel."); + prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->space_type"); RNA_def_property_enum_items(prop, space_type_items); RNA_def_property_flag(prop, PROP_REGISTER); - + RNA_def_property_ui_text(prop, "Space type", "The space where the panel is going to be used in."); + prop= RNA_def_property(srna, "bl_region_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->region_type"); RNA_def_property_enum_items(prop, region_type_items); RNA_def_property_flag(prop, PROP_REGISTER); + RNA_def_property_ui_text(prop, "Region Type", "The region where the panel is going to be used in."); prop= RNA_def_property(srna, "bl_context", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->context"); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); /* should this be optional? - Campbell */ - + RNA_def_property_ui_text(prop, "Context", "The context in which the panel belongs to. (TODO: explain the possible combinations bl_context/bl_region_type/bl_space_type)"); + prop= RNA_def_property(srna, "bl_default_closed", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type->flag", PNL_DEFAULT_CLOSED); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); - + RNA_def_property_ui_text(prop, "Default closed", "Defines if the panel has to be open or collapsed at the time of its creation. Note that once the panel has been created with bl_default_closed = True, at reload (F8) it stays open."); + prop= RNA_def_property(srna, "bl_show_header", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "type->flag", PNL_NO_HEADER); RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); + RNA_def_property_ui_text(prop, "Show Header", "If set to True, the panel shows a header, which contains a clickable arrow to collapse the panel and the label (see bl_label)."); } static void rna_def_header(BlenderRNA *brna) @@ -652,14 +663,14 @@ static void rna_def_header(BlenderRNA *brna) FunctionRNA *func; srna= RNA_def_struct(brna, "Header", NULL); - RNA_def_struct_ui_text(srna, "Header", "Editor header containing buttons"); + RNA_def_struct_ui_text(srna, "Header", "Editor header containing UI elements."); RNA_def_struct_sdna(srna, "Header"); RNA_def_struct_refine_func(srna, "rna_Header_refine"); RNA_def_struct_register_funcs(srna, "rna_Header_register", "rna_Header_unregister"); /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw buttons into the header UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the header UI layout."); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -669,16 +680,19 @@ static void rna_def_header(BlenderRNA *brna) prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "layout"); RNA_def_property_struct_type(prop, "UILayout"); + RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the header in the UI."); /* registration */ prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_flag(prop, PROP_REGISTER); + RNA_def_property_ui_text(prop, "ID Name", "If this is set, the header gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_HT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_HT_hello\""); prop= RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type->space_type"); RNA_def_property_enum_items(prop, space_type_items); RNA_def_property_flag(prop, PROP_REGISTER); + RNA_def_property_ui_text(prop, "Space type", "The space where the header is going to be used in."); RNA_define_verify_sdna(1); } @@ -698,15 +712,15 @@ static void rna_def_menu(BlenderRNA *brna) /* poll */ func= RNA_def_function(srna, "poll", NULL); - RNA_def_function_ui_description(func, "Test if the menu is visible or not."); - RNA_def_function_flag(func, FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); + RNA_def_function_ui_description(func, "If this method returns a non-null output, then the menu can be drawn. This is a static method, hence it is not possible to use 'self' in it."); + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); /* draw */ func= RNA_def_function(srna, "draw", NULL); - RNA_def_function_ui_description(func, "Draw buttons into the menu UI layout."); + RNA_def_function_ui_description(func, "Draw UI elements into the menu UI layout."); RNA_def_function_flag(func, FUNC_REGISTER); parm= RNA_def_pointer(func, "context", "Context", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -716,15 +730,18 @@ static void rna_def_menu(BlenderRNA *brna) prop= RNA_def_property(srna, "layout", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "layout"); RNA_def_property_struct_type(prop, "UILayout"); + RNA_def_property_ui_text(prop, "Layout", "Defines the structure of the menu in the UI."); /* registration */ prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->idname"); RNA_def_property_flag(prop, PROP_REGISTER); + RNA_def_property_ui_text(prop, "ID Name", "If this is set, the menu gets a custom ID, otherwise it takes the name of the class used to define the panel. For example, if the class name is \"OBJECT_MT_hello\", and bl_idname is not set by the script, then bl_idname = \"OBJECT_MT_hello\""); prop= RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "type->label"); RNA_def_property_flag(prop, PROP_REGISTER); + RNA_def_property_ui_text(prop, "Label", "The menu label"); RNA_define_verify_sdna(1); } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index b2831c4b1d3..032aa731e0f 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -127,11 +127,13 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "row", "uiLayoutRow"); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); + RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed next to each other in a row."); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); - + func= RNA_def_function(srna, "column", "uiLayoutColumn"); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); + RNA_def_function_ui_description(func, "Sub-layout. Items placed in this sublayout are placed under each other in a column."); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow"); @@ -144,7 +146,8 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "box", "uiLayoutBox"); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); - + RNA_def_function_ui_description(func, "Sublayout. Items placed in this sublayout are placed under each other in a column and are surrounded by a box."); + /* split layout */ func= RNA_def_function(srna, "split", "uiLayoutSplit"); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); @@ -154,6 +157,7 @@ void RNA_api_ui_layout(StructRNA *srna) /* items */ func= RNA_def_function(srna, "prop", "rna_uiItemR"); + RNA_def_function_ui_description(func, "Item. Exposes an RNA item and places it into the layout."); api_ui_item_rna_common(func); api_ui_item_common(func); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); @@ -192,6 +196,7 @@ void RNA_api_ui_layout(StructRNA *srna) parm= RNA_def_pointer(func, "properties", "OperatorProperties", "", "Operator properties to fill in, return when 'properties' is set to true."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); RNA_def_function_return(func, parm); + RNA_def_function_ui_description(func, "Item. Places a button into the layout to call an Operator."); /* func= RNA_def_function(srna, "operator_enum", "uiItemEnumO_string"); api_ui_item_op_common(func); @@ -241,6 +246,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); */ func= RNA_def_function(srna, "label", "uiItemL"); + RNA_def_function_ui_description(func, "Item. Display text in the layout."); api_ui_item_common(func); func= RNA_def_function(srna, "menu", "uiItemM"); @@ -250,6 +256,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "separator", "uiItemS"); + RNA_def_function_ui_description(func, "Item. Inserts empty space into the layout between items."); /* context */ func= RNA_def_function(srna, "set_context_pointer", "uiLayoutSetContextPointer"); @@ -274,7 +281,6 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block."); RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); - RNA_def_string(func, "filter", "", 0, "", "Function identifier to filter the ID block."); func= RNA_def_function(srna, "template_ID_preview", "uiTemplateIDPreview"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); @@ -282,7 +288,6 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_string(func, "new", "", 0, "", "Operator identifier to create a new ID block."); RNA_def_string(func, "open", "", 0, "", "Operator identifier to open a file for creating a new ID block."); RNA_def_string(func, "unlink", "", 0, "", "Operator identifier to unlink the ID block."); - RNA_def_string(func, "filter", "", 0, "", "Function identifier to filter the ID block."); RNA_def_int(func, "rows", 0, 0, INT_MAX, "Number of thumbnail preview rows to display", "", 0, INT_MAX); RNA_def_int(func, "cols", 0, 0, INT_MAX, "Number of thumbnail preview columns to display", "", 0, INT_MAX); @@ -308,6 +313,7 @@ void RNA_api_ui_layout(StructRNA *srna) func= RNA_def_function(srna, "template_modifier", "uiTemplateModifier"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); + RNA_def_function_ui_description(func, "Layout . Generates the UI layout for modifiers."); parm= RNA_def_pointer(func, "data", "Modifier", "", "Modifier data."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); @@ -315,6 +321,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "compact", 0, "", "Show a smaller version of the template, split on two lines."); func= RNA_def_function(srna, "template_constraint", "uiTemplateConstraint"); + RNA_def_function_ui_description(func, "Layout . Generates the UI layout for constraints."); parm= RNA_def_pointer(func, "data", "Constraint", "", "Constraint data."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR|PROP_NEVER_NULL); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); @@ -322,30 +329,36 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "compact", 0, "", "Show a smaller version of the template, split on two lines."); func= RNA_def_function(srna, "template_preview", "uiTemplatePreview"); + RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc."); parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_pointer(func, "parent", "ID", "", "ID datablock."); RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot."); func= RNA_def_function(srna, "template_curve_mapping", "uiTemplateCurveMapping"); + RNA_def_function_ui_description(func, "Item. A curve mapping widget used for e.g falloff curves for lamps."); api_ui_item_rna_common(func); RNA_def_enum(func, "type", curve_type_items, 0, "Type", "Type of curves to display."); RNA_def_boolean(func, "levels", 0, "", "Show black/white levels."); RNA_def_boolean(func, "brush", 0, "", "Show brush options."); func= RNA_def_function(srna, "template_color_ramp", "uiTemplateColorRamp"); + RNA_def_function_ui_description(func, "Item. A color ramp widget."); api_ui_item_rna_common(func); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); func= RNA_def_function(srna, "template_histogram", "uiTemplateHistogram"); + RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data."); api_ui_item_rna_common(func); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); func= RNA_def_function(srna, "template_waveform", "uiTemplateWaveform"); + RNA_def_function_ui_description(func, "Item. A waveform widget to analyze imaga data."); api_ui_item_rna_common(func); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); func= RNA_def_function(srna, "template_vectorscope", "uiTemplateVectorscope"); + RNA_def_function_ui_description(func, "Item. A vectorscope widget to analyze imaga data."); api_ui_item_rna_common(func); RNA_def_boolean(func, "expand", 0, "", "Expand button to show more detail."); @@ -359,6 +372,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "template_color_wheel", "uiTemplateColorWheel"); + RNA_def_function_ui_description(func, "Item. A color wheel widget to pick colors."); api_ui_item_rna_common(func); RNA_def_boolean(func, "value_slider", 0, "", "Display the value slider to the right of the color wheel"); RNA_def_boolean(func, "lock", 0, "", "Lock the color wheel display to value 1.0 regardless of actual color"); @@ -376,6 +390,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_property_flag(parm, PROP_REQUIRED); func= RNA_def_function(srna, "template_image", "uiTemplateImage"); + RNA_def_function_ui_description(func, "Item(s). User interface for selecting images and their source paths."); RNA_def_function_flag(func, FUNC_USE_CONTEXT); api_ui_item_rna_common(func); parm= RNA_def_pointer(func, "image_user", "ImageUser", "", ""); @@ -383,6 +398,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "compact", 0, "", "Use more compact layout."); func= RNA_def_function(srna, "template_list", "uiTemplateList"); + RNA_def_function_ui_description(func, "Item. A list widget to display data. e.g. vertexgroups."); RNA_def_function_flag(func, FUNC_USE_CONTEXT); parm= RNA_def_pointer(func, "data", "AnyType", "", "Data from which to take property."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_RNAPTR); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index d3b2e2fdd27..356d55b8120 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -2048,13 +2048,6 @@ static void rna_def_userdef_view(BlenderRNA *brna) RNA_def_property_enum_funcs(prop, NULL, "rna_userdef_timecode_style_set", NULL); RNA_def_property_ui_text(prop, "TimeCode Style", "Format of Time Codes displayed when not displaying timing in terms of frames"); RNA_def_property_update(prop, 0, "rna_userdef_update"); - - /* Properties Window */ - prop= RNA_def_property(srna, "properties_width_check", PROP_INT, PROP_NONE); - RNA_def_property_int_sdna(prop, NULL, "propwidth"); - RNA_def_property_range(prop, 150, 400); - RNA_def_property_ui_text(prop, "Width Check", "Dual Column layout will change to single column layout when the width of the area gets below this value (needs restart to take effect)"); - RNA_def_property_update(prop, 0, "rna_userdef_update"); } static void rna_def_userdef_edit(BlenderRNA *brna) @@ -2844,31 +2837,31 @@ void RNA_def_userdef(BlenderRNA *brna) prop= RNA_def_property(srna, "view", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesView"); - RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_UserDef_view_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "View & Controls", "Preferences related to viewing data"); prop= RNA_def_property(srna, "edit", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesEdit"); - RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_UserDef_edit_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Edit Methods", "Settings for interacting with Blender data"); prop= RNA_def_property(srna, "inputs", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesInput"); - RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_UserDef_input_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Inputs", "Settings for input devices"); prop= RNA_def_property(srna, "filepaths", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesFilePaths"); - RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_UserDef_filepaths_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "File Paths", "Default paths for external files"); prop= RNA_def_property(srna, "system", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "UserPreferencesSystem"); - RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_UserDef_system_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "System & OpenGL", "Graphics driver and operating system settings"); rna_def_userdef_view(brna); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 84053c0a181..eeac6813f78 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -887,7 +887,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo return dummyot.ext.srna; } -#endif +#endif /* DISABLE_PYTHON */ static StructRNA* rna_Operator_refine(PointerRNA *opr) { @@ -961,7 +961,7 @@ static wmKeyMapItem *rna_KeyMap_add_modal_item(wmKeyMap *km, bContext *C, Report return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue); } -#else +#else /* RNA_RUNTIME */ static void rna_def_operator(BlenderRNA *brna) { @@ -985,7 +985,7 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "OperatorProperties"); RNA_def_property_ui_text(prop, "Properties", ""); - RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL, NULL); prop= RNA_def_property(srna, "has_reports", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* this is 'virtual' property */ @@ -1048,7 +1048,7 @@ static void rna_def_macro_operator(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "OperatorProperties"); RNA_def_property_ui_text(prop, "Properties", ""); - RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Operator_properties_get", NULL, NULL, NULL); /* Registration */ prop= RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); @@ -1095,7 +1095,7 @@ static void rna_def_operator_type_macro(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "OperatorProperties"); RNA_def_property_ui_text(prop, "Properties", ""); - RNA_def_property_pointer_funcs(prop, "rna_OperatorTypeMacro_properties_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_OperatorTypeMacro_properties_get", NULL, NULL, NULL); } static void rna_def_operator_utils(BlenderRNA *brna) @@ -1232,7 +1232,7 @@ static void rna_def_window(BlenderRNA *brna) RNA_def_property_struct_type(prop, "Screen"); RNA_def_property_ui_text(prop, "Screen", "Active screen showing in the window"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL); + RNA_def_property_pointer_funcs(prop, NULL, "rna_Window_screen_set", NULL, NULL); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_update(prop, 0, "rna_Window_screen_update"); } @@ -1262,7 +1262,7 @@ static void rna_def_windowmanager(BlenderRNA *brna) prop= RNA_def_property(srna, "active_keyconfig", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "KeyConfig"); RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keyconfig_get", "rna_WindowManager_active_keyconfig_set", 0); + RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keyconfig_get", "rna_WindowManager_active_keyconfig_set", 0, NULL); RNA_def_property_ui_text(prop, "Active Key Configuration", ""); prop= RNA_def_property(srna, "default_keyconfig", PROP_POINTER, PROP_NEVER_NULL); @@ -1427,7 +1427,7 @@ static void rna_def_keyconfig(BlenderRNA *brna) prop= RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "OperatorProperties"); - RNA_def_property_pointer_funcs(prop, "rna_KeyMapItem_properties_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_KeyMapItem_properties_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Properties", "Properties to set when the operator is called"); prop= RNA_def_property(srna, "map_type", PROP_ENUM, PROP_NONE); @@ -1518,5 +1518,5 @@ void RNA_def_wm(BlenderRNA *brna) rna_def_keyconfig(brna); } -#endif +#endif /* RNA_RUNTIME */ diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 5df35ed4210..0f72cfa8b9d 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -186,7 +186,7 @@ void RNA_api_operator(StructRNA *srna) /* poll */ func= RNA_def_function(srna, "poll", NULL); RNA_def_function_ui_description(func, "Test if the operator can be called or not."); - RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); RNA_def_pointer(func, "context", "Context", "", ""); @@ -246,7 +246,7 @@ void RNA_api_macro(StructRNA *srna) /* poll */ func= RNA_def_function(srna, "poll", NULL); RNA_def_function_ui_description(func, "Test if the operator can be called or not."); - RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL); + RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_REGISTER_OPTIONAL); RNA_def_function_return(func, RNA_def_boolean(func, "visible", 1, "", "")); RNA_def_pointer(func, "context", "Context", "", ""); diff --git a/source/blender/makesrna/intern/rna_world.c b/source/blender/makesrna/intern/rna_world.c index 4d0170bdc18..f4517c8a5ee 100644 --- a/source/blender/makesrna/intern/rna_world.c +++ b/source/blender/makesrna/intern/rna_world.c @@ -528,19 +528,19 @@ void RNA_def_world(BlenderRNA *brna) prop= RNA_def_property(srna, "lighting", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "WorldLighting"); - RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_World_lighting_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Lighting", "World lighting settings"); prop= RNA_def_property(srna, "mist", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "WorldMistSettings"); - RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_World_mist_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Mist", "World mist settings"); prop= RNA_def_property(srna, "stars", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "WorldStarsSettings"); - RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_World_stars_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Stars", "World stars settings"); rna_def_lighting(brna); |