static void rna_def_mask_splines(BlenderRNA *brna) { StructRNA *srna; FunctionRNA *func; PropertyRNA *prop; srna = RNA_def_struct(brna, "MaskSplines", NULL); RNA_def_struct_sdna(srna, "MaskLayer"); RNA_def_struct_ui_text(srna, "Mask Splines", "Collection of masking splines"); func = RNA_def_function(srna, "add", "rna_MaskLayer_spline_add"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Add a number of splines to mask layer"); RNA_def_int(func, "count", 1, 0, INT_MAX, "Number", "Number of splines to add to the layer", 0, INT_MAX); /* active spline */ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "MaskSpline"); RNA_def_property_pointer_funcs(prop, "rna_MaskLayer_active_spline_get", "rna_MaskLayer_active_spline_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Spline", "Active spline of masking layer"); /* active point */ prop = RNA_def_property(srna, "active_point", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "MaskSplinePoint"); RNA_def_property_pointer_funcs(prop, "rna_MaskLayer_active_spline_point_get", "rna_MaskLayer_active_spline_point_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Spline", "Active spline of masking layer"); }
static void rna_def_struct(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "Struct", NULL); RNA_def_struct_ui_text(srna, "Struct Definition", "RNA structure definition"); RNA_def_struct_ui_icon(srna, ICON_RNA); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Struct_name_get", "rna_Struct_name_length", NULL); RNA_def_property_ui_text(prop, "Name", "Human readable name"); prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Struct_identifier_get", "rna_Struct_identifier_length", NULL); RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the code and scripting"); RNA_def_struct_name_property(srna, prop); prop= RNA_def_property(srna, "description", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Struct_description_get", "rna_Struct_description_length", NULL); RNA_def_property_ui_text(prop, "Description", "Description of the Struct's purpose"); 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, 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, 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, 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); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Property"); RNA_def_property_collection_funcs(prop, "rna_Struct_properties_begin", "rna_Struct_properties_next", "rna_iterator_listbase_end", "rna_Struct_properties_get", 0, 0, 0); RNA_def_property_ui_text(prop, "Properties", "Properties in the struct"); prop= RNA_def_property(srna, "functions", PROP_COLLECTION, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Function"); RNA_def_property_collection_funcs(prop, "rna_Struct_functions_begin", "rna_Struct_functions_next", "rna_iterator_listbase_end", "rna_Struct_functions_get", 0, 0, 0); RNA_def_property_ui_text(prop, "Functions", ""); }
static void rna_def_pointer_property(StructRNA *srna, PropertyType type) { PropertyRNA *prop; prop= RNA_def_property(srna, "fixed_type", PROP_POINTER, PROP_NONE); 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, NULL); else 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"); }
static void rna_def_render_slots(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "RenderSlots", NULL); RNA_def_struct_sdna(srna, "RenderSlot"); RNA_def_struct_ui_text(srna, "Render Slots", "Collection of the render slots"); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "RenderSlot"); RNA_def_property_pointer_funcs(prop, "rna_render_slots_active_get", "rna_render_slots_active_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active", "Active render slot of the image"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_NONE); RNA_def_property_int_funcs(prop, "rna_render_slots_active_index_get", "rna_render_slots_active_index_set", NULL); RNA_def_property_range(prop, 0, IMA_MAX_RENDER_SLOT); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Active Index", "Index of an active render slot of the image"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); }
static void rna_def_sun_lamp(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "SunLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp"); RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN); rna_def_lamp_shadow(srna, 0, 0); /* sky */ 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, NULL); RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps"); rna_def_lamp_sky_settings(brna); /* BGE Only */ prop = RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shadow_frustum_size"); RNA_def_property_ui_range(prop, 0.001, 100.0, 2, 1); RNA_def_property_ui_text(prop, "Frustum Size", "Size of the frustum used for creating the shadow map"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "show_shadow_box", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_SHOW_SHADOW_BOX); RNA_def_property_ui_text(prop, "Show Shadow Box", "Draw a box in 3D view to visualize which objects are contained in it"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); }
static void rna_def_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "Paint", NULL); RNA_def_struct_ui_text(srna, "Paint", ""); /* Global Settings */ prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); 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); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH); RNA_def_property_ui_text(prop, "Show Brush", ""); prop= RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE); RNA_def_property_ui_text(prop, "Show Brush On Surface", ""); prop= RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE); RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view"); }
static void rna_def_sun_lamp(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "SunLamp", "Lamp"); RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_ui_text(srna, "Sun Lamp", "Constant direction parallel ray lamp"); RNA_def_struct_ui_icon(srna, ICON_LAMP_SUN); rna_def_lamp_shadow(srna, 0, 0); /* sky */ 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, NULL); RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps"); rna_def_lamp_sky_settings(brna); /* BGE Only */ prop= RNA_def_property(srna, "shadow_frustum_size", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shadow_frustum_size"); RNA_def_property_ui_range(prop, 0.001, 100.0, 2, 1); RNA_def_property_ui_text(prop, "Frustum Size", "Size of the frustum used for creating the shadow map"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); }
static void rna_def_gpencil_layers(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; // FunctionRNA *func; // PropertyRNA *parm; RNA_def_property_srna(cprop, "GreasePencilLayers"); srna= RNA_def_struct(brna, "GreasePencilLayers", NULL); RNA_def_struct_sdna(srna, "bGPdata"); RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers"); #if 0 func= RNA_def_function(srna, "new", "rna_GPencil_layer_new"); RNA_def_function_ui_description(func, "Add a new spline to the curve."); parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline."); RNA_def_property_flag(parm, PROP_REQUIRED); parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline."); RNA_def_function_return(func, parm); func= RNA_def_function(srna, "remove", "rna_GPencil_layer_remove"); RNA_def_function_ui_description(func, "Remove a spline from a curve."); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); #endif prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "GreasePencil"); RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer"); }
static void rna_def_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "Paint", NULL); RNA_def_struct_ui_text(srna, "Paint", ""); /* Global Settings */ prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); 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, 0, "rna_Paint_brush_update"); prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH); RNA_def_property_ui_text(prop, "Show Brush", ""); prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE); RNA_def_property_ui_text(prop, "Show Brush On Surface", ""); prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE); RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view"); prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "num_input_samples"); RNA_def_property_ui_range(prop, 1, PAINT_MAX_INPUT_SAMPLES, 0, -1); RNA_def_property_ui_text(prop, "Input Samples", "Average multiple input samples together to smooth the brush stroke"); }
static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *parm; FunctionRNA *func; PropertyRNA *prop; RNA_def_property_srna(cprop, "NlaTracks"); srna = RNA_def_struct(brna, "NlaTracks", NULL); RNA_def_struct_sdna(srna, "AnimData"); RNA_def_struct_ui_text(srna, "NLA Tracks", "Collection of NLA Tracks"); func = RNA_def_function(srna, "new", "rna_NlaTrack_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Add a new NLA Track"); RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after"); /* return type */ parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_NlaTrack_remove"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Remove a NLA Track"); parm = RNA_def_pointer(func, "track", "NlaTrack", "", "NLA Track to remove"); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "NlaTrack"); RNA_def_property_pointer_funcs(prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint"); /* XXX: should (but doesn't) update the active track in the NLA window */ RNA_def_property_update(prop, NC_ANIMATION|ND_NLA|NA_SELECTED, NULL); }
static void rna_def_gpencil_layers_api(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; PropertyRNA *parm; RNA_def_property_srna(cprop, "GreasePencilLayers"); srna = RNA_def_struct(brna, "GreasePencilLayers", NULL); RNA_def_struct_sdna(srna, "bGPdata"); RNA_def_struct_ui_text(srna, "Grease Pencil Layers", "Collection of grease pencil layers"); func = RNA_def_function(srna, "new", "rna_GPencil_layer_new"); RNA_def_function_ui_description(func, "Add a new grease pencil layer"); parm = RNA_def_string(func, "name", "GPencilLayer", MAX_NAME, "Name", "Name of the layer"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_boolean(func, "set_active", 0, "Set Active", "Set the newly created layer to the active layer"); parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The newly created layer"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_GPencil_layer_remove"); RNA_def_function_ui_description(func, "Remove a grease pencil layer"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "layer", "GPencilLayer", "", "The layer to remove"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "GreasePencil"); RNA_def_property_pointer_funcs(prop, "rna_GPencil_active_layer_get", "rna_GPencil_active_layer_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Layer", "Active grease pencil layer"); }
static void rna_def_render_slots(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; FunctionRNA *func; PropertyRNA *prop, *parm; RNA_def_property_srna(cprop, "RenderSlots"); srna = RNA_def_struct(brna, "RenderSlots", NULL); RNA_def_struct_sdna(srna, "Image"); RNA_def_struct_ui_text(srna, "Render Layers", "Collection of render layers"); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "render_slot"); RNA_def_property_int_funcs(prop, "rna_render_slots_active_index_get", "rna_render_slots_active_index_set", "rna_render_slots_active_index_range"); RNA_def_property_ui_text(prop, "Active", "Active render slot of the image"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "RenderSlot"); RNA_def_property_pointer_funcs( prop, "rna_render_slots_active_get", "rna_render_slots_active_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active", "Active render slot of the image"); RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL); func = RNA_def_function(srna, "new", "BKE_image_add_renderslot"); RNA_def_function_ui_description(func, "Add a render slot to the image"); parm = RNA_def_string(func, "name", NULL, 0, "Name", "New name for the render slot"); parm = RNA_def_pointer(func, "result", "RenderSlot", "", "Newly created render layer"); RNA_def_function_return(func, parm); }
static void rna_def_keyingset(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "KeyingSet", NULL); RNA_def_struct_ui_text(srna, "Keying Set", "Settings that should be keyframed together"); /* Id/Label */ prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "idname"); RNA_def_property_flag(prop, PROP_REGISTER | PROP_NEVER_CLAMP); RNA_def_property_ui_text(prop, "ID Name", KEYINGSET_IDNAME_DOC); /* RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_RENAME, NULL); */ /* NOTE: disabled, as ID name shouldn't be editable */ prop = RNA_def_property(srna, "bl_label", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_KeyingSet_name_set"); RNA_def_property_ui_text(prop, "UI Name", ""); RNA_def_struct_ui_icon(srna, ICON_KEYINGSET); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_SCENE | ND_KEYINGSET | NA_RENAME, NULL); prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "description"); RNA_def_property_string_maxlength(prop, RNA_DYN_DESCR_MAX); /* else it uses the pointer size! */ RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL); RNA_def_property_ui_text(prop, "Description", "A short description of the keying set"); /* 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, NULL); RNA_def_property_ui_text(prop, "Type Info", "Callback function defines for built-in Keying Sets"); /* Paths */ prop = RNA_def_property(srna, "paths", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "paths", NULL); RNA_def_property_struct_type(prop, "KeyingSetPath"); RNA_def_property_ui_text(prop, "Paths", "Keying Set Paths to define settings that get keyframed together"); rna_def_keyingset_paths(brna, prop); /* Flags */ prop = RNA_def_property(srna, "is_path_absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute", "Keying Set defines specific paths/settings to be keyframed " "(i.e. is not reliant on context info)"); /* Keyframing Flags */ rna_def_common_keying_flags(srna, 0); /* Keying Set API */ RNA_api_keyingset(srna); }
static void rna_def_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "Paint", NULL); RNA_def_struct_ui_text(srna, "Paint", ""); /* Global Settings */ prop = RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); 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, 0, "rna_Paint_brush_update"); prop = RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH); RNA_def_property_ui_text(prop, "Show Brush", ""); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "show_brush_on_surface", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH_ON_SURFACE); RNA_def_property_ui_text(prop, "Show Brush On Surface", ""); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "show_low_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_FAST_NAVIGATE); RNA_def_property_ui_text(prop, "Fast Navigate", "For multires, show low resolution while navigating the view"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "input_samples", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "num_input_samples"); RNA_def_property_ui_range(prop, 1, PAINT_MAX_INPUT_SAMPLES, 0, -1); RNA_def_property_ui_text(prop, "Input Samples", "Average multiple input samples together to smooth the brush stroke"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_X); RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Y); RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMM_Z); RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "symmetry_flags", PAINT_SYMMETRY_FEATHER); RNA_def_property_ui_text(prop, "Symmetry Feathering", "Reduce the strength of the brush where it overlaps symmetrical daubs"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); }
static void rna_def_maskParent(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem mask_id_type_items[] = { {ID_MC, "MOVIECLIP", ICON_SEQUENCE, "Movie Clip", ""}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem parent_type_items[] = { {MASK_PARENT_POINT_TRACK, "POINT_TRACK", 0, "Point Track", ""}, {MASK_PARENT_PLANE_TRACK, "PLANE_TRACK", 0, "Plane Track", ""}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "MaskParent", NULL); RNA_def_struct_ui_text(srna, "Mask Parent", "Parenting settings for masking element"); /* Target Properties - ID-block to Drive */ prop = RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); RNA_def_property_flag(prop, PROP_EDITABLE); // RNA_def_property_editable_func(prop, "rna_maskSpline_id_editable"); /* note: custom set function is ONLY to avoid rna setting a user for this. */ RNA_def_property_pointer_funcs(prop, NULL, "rna_MaskParent_id_set", "rna_MaskParent_id_typef", NULL); RNA_def_property_ui_text(prop, "ID", "ID-block to which masking element would be parented to or to it's property"); RNA_def_property_update(prop, 0, "rna_Mask_update_parent"); prop = RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "id_type"); RNA_def_property_enum_items(prop, mask_id_type_items); RNA_def_property_enum_default(prop, ID_MC); RNA_def_property_enum_funcs(prop, NULL, "rna_MaskParent_id_type_set", NULL); //RNA_def_property_editable_func(prop, "rna_MaskParent_id_type_editable"); RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used"); RNA_def_property_update(prop, 0, "rna_Mask_update_parent"); /* type */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, parent_type_items); RNA_def_property_ui_text(prop, "Parent Type", "Parent Type"); RNA_def_property_update(prop, 0, "rna_Mask_update_parent"); /* parent */ prop = RNA_def_property(srna, "parent", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Parent", "Name of parent object in specified data block to which parenting happens"); RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2); RNA_def_property_update(prop, 0, "rna_Mask_update_parent"); /* sub_parent */ prop = RNA_def_property(srna, "sub_parent", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Sub Parent", "Name of parent sub-object in specified data block to which parenting happens"); RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2); RNA_def_property_update(prop, 0, "rna_Mask_update_parent"); }
static void rna_def_mask_splines(BlenderRNA *brna) { StructRNA *srna; FunctionRNA *func; PropertyRNA *prop; PropertyRNA *parm; srna = RNA_def_struct(brna, "MaskSplines", NULL); RNA_def_struct_sdna(srna, "MaskLayer"); RNA_def_struct_ui_text(srna, "Mask Splines", "Collection of masking splines"); /* Create new spline */ func = RNA_def_function(srna, "new", "rna_MaskLayer_spline_new"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Add a new spline to the layer"); parm = RNA_def_pointer(func, "spline", "MaskSpline", "", "The newly created spline"); RNA_def_function_return(func, parm); /* Remove the spline */ func = RNA_def_function(srna, "remove", "rna_MaskLayer_spline_remove"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Remove a spline from a layer"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "spline", "MaskSpline", "", "The spline to remove"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); /* active spline */ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "MaskSpline"); RNA_def_property_pointer_funcs(prop, "rna_MaskLayer_active_spline_get", "rna_MaskLayer_active_spline_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Spline", "Active spline of masking layer"); /* active point */ prop = RNA_def_property(srna, "active_point", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "MaskSplinePoint"); RNA_def_property_pointer_funcs(prop, "rna_MaskLayer_active_spline_point_get", "rna_MaskLayer_active_spline_point_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Spline", "Active spline of masking layer"); }
static void rna_def_animviz(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "AnimViz", NULL); RNA_def_struct_sdna(srna, "bAnimVizSettings"); RNA_def_struct_ui_text(srna, "Animation Visualisation", "Settings for the visualisation of motion"); /* onion-skinning settings (nested struct) */ prop= RNA_def_property(srna, "onion_skin_frames", 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, 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_path", 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, NULL); RNA_def_property_ui_text(prop, "Motion Paths", "Motion Path settings for visualisation"); }
static void rna_def_boidstate(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "BoidState", NULL); RNA_def_struct_ui_text(srna, "Boid State", "Boid state for boid physics"); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Boid state name"); RNA_def_struct_name_property(srna, prop); prop = RNA_def_property(srna, "ruleset_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, boidruleset_type_items); RNA_def_property_ui_text(prop, "Rule Evaluation", "How the rules in the list are evaluated"); prop = RNA_def_property(srna, "rules", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "BoidRule"); RNA_def_property_ui_text(prop, "Boid Rules", ""); 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, NULL); RNA_def_property_ui_text(prop, "Active Boid Rule", ""); prop = RNA_def_property(srna, "active_boid_rule_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_funcs(prop, "rna_BoidState_active_boid_rule_index_get", "rna_BoidState_active_boid_rule_index_set", "rna_BoidState_active_boid_rule_index_range"); RNA_def_property_ui_text(prop, "Active Boid Rule Index", ""); prop = RNA_def_property(srna, "rule_fuzzy", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "rule_fuzziness"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Rule Fuzziness", ""); RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop = RNA_def_property(srna, "volume", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Volume", ""); RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop = RNA_def_property(srna, "falloff", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Falloff", ""); RNA_def_property_update(prop, 0, "rna_Boids_reset"); }
static void rna_def_render_bake_pixel(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "BakePixel", NULL); RNA_def_struct_ui_text(srna, "Bake Pixel", ""); RNA_define_verify_sdna(0); prop = RNA_def_property(srna, "primitive_id", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "primitive_id"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "object_id", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "object_id"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "uv", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 2); RNA_def_property_float_sdna(prop, NULL, "uv"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "du_dx", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "du_dx"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "du_dy", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "du_dy"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "dv_dx", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dv_dx"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "dv_dy", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dv_dy"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop = RNA_def_property(srna, "next", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "BakePixel"); RNA_def_property_pointer_funcs(prop, "rna_BakePixel_next_get", NULL, NULL, NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_define_verify_sdna(1); }
static void rna_def_touch_sensor(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "TouchSensor", "Sensor"); RNA_def_struct_ui_text(srna, "Touch Sensor", "Sensor to detect objects colliding with the current object"); RNA_def_struct_sdna_from(srna, "bTouchSensor", "data"); prop = RNA_def_property(srna, "material", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Material"); RNA_def_property_pointer_sdna(prop, NULL, "ma"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Material", "Only look for objects with this material (blank = all objects)"); /* 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, NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); }
/* armature.bones.* */ static void rna_def_armature_edit_bones(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; PropertyRNA *parm; RNA_def_property_srna(cprop, "ArmatureEditBones"); srna = RNA_def_struct(brna, "ArmatureEditBones", NULL); RNA_def_struct_sdna(srna, "bArmature"); RNA_def_struct_ui_text(srna, "Armature EditBones", "Collection of armature edit bones"); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "EditBone"); RNA_def_property_pointer_sdna(prop, NULL, "act_edbone"); 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, NULL); /* todo, redraw */ /* RNA_def_property_collection_active(prop, prop_act); */ /* add target */ func = RNA_def_function(srna, "new", "rna_Armature_edit_bone_new"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Add a new bone"); parm = RNA_def_string(func, "name", "Object", 0, "", "New name for the bone"); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ parm = RNA_def_pointer(func, "bone", "EditBone", "", "Newly created edit bone"); RNA_def_function_return(func, parm); /* remove target */ func = RNA_def_function(srna, "remove", "rna_Armature_edit_bone_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove an existing bone from the armature"); /* target to remove*/ parm = RNA_def_pointer(func, "bone", "EditBone", "", "EditBone to remove"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); }
static void rna_def_action_pose_markers(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; PropertyRNA *parm; RNA_def_property_srna(cprop, "ActionPoseMarkers"); srna = RNA_def_struct(brna, "ActionPoseMarkers", NULL); RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_ui_text(srna, "Action Pose Markers", "Collection of timeline markers"); func = RNA_def_function(srna, "new", "rna_Action_pose_markers_new"); RNA_def_function_ui_description(func, "Add a pose marker to the action"); parm = RNA_def_string(func, "name", "Marker", 0, NULL, "New name for the marker (not unique)"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Newly created marker"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_Action_pose_markers_remove"); RNA_def_function_ui_description(func, "Remove a timeline marker"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "marker", "TimelineMarker", "", "Timeline marker to remove"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "TimelineMarker"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_LIB_EXCEPTION); RNA_def_property_pointer_funcs(prop, "rna_Action_active_pose_marker_get", "rna_Action_active_pose_marker_set", NULL, NULL); RNA_def_property_ui_text(prop, "Active Pose Marker", "Active pose marker for this action"); prop = RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "active_marker"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_int_funcs(prop, "rna_Action_active_pose_marker_index_get", "rna_Action_active_pose_marker_index_set", "rna_Action_active_pose_marker_index_range"); RNA_def_property_ui_text(prop, "Active Pose Marker Index", "Index of active pose marker"); }
/* canvas.canvas_surfaces */ static void rna_def_canvas_surfaces(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; RNA_def_property_srna(cprop, "DynamicPaintSurfaces"); srna= RNA_def_struct(brna, "DynamicPaintSurfaces", NULL); RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings"); RNA_def_struct_ui_text(srna, "Canvas Surfaces", "Collection of Dynamic Paint Canvas surfaces"); prop= RNA_def_property(srna, "active_index", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_int_funcs(prop, "rna_Surface_active_point_index_get", "rna_Surface_active_point_index_set", "rna_Surface_active_point_range"); RNA_def_property_ui_text(prop, "Active Point Cache Index", ""); prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "DynamicPaintSurface"); RNA_def_property_pointer_funcs(prop, "rna_PaintSurface_active_get", NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Active Surface", "Active Dynamic Paint surface being displayed"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); }
static void rna_def_drivertarget(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "DriverTarget", NULL); RNA_def_struct_ui_text(srna, "Driver Target", "Variable from some source/target for driver relationship."); /* Variable Name */ prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_struct_name_property(srna, prop); RNA_def_property_ui_text(prop, "Name", "Name to use in scripted expressions/functions. (No spaces or dots are allowed. Also, must not start with a symbol or digit)"); //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates /* Target Properties - ID-block to Drive */ prop= RNA_def_property(srna, "id", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ID"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_editable_func(prop, "rna_DriverTarget_id_editable"); RNA_def_property_pointer_funcs(prop, NULL, NULL, "rna_DriverTarget_id_typef"); RNA_def_property_ui_text(prop, "ID", "ID-block that the specific property used can be found from"); //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates prop= RNA_def_property(srna, "id_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "idtype"); RNA_def_property_enum_items(prop, id_type_items); RNA_def_property_enum_default(prop, ID_OB); RNA_def_property_ui_text(prop, "ID Type", "Type of ID-block that can be used."); //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates /* Target Properties - Property to Drive */ prop= RNA_def_property(srna, "rna_path", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_DriverTarget_RnaPath_get", "rna_DriverTarget_RnaPath_length", "rna_DriverTarget_RnaPath_set"); RNA_def_property_ui_text(prop, "RNA Path", "RNA Path (from Object) to property used"); //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates prop= RNA_def_property(srna, "array_index", PROP_INT, PROP_NONE); RNA_def_property_ui_text(prop, "RNA Array Index", "Index to the specific property used (if applicable)"); //RNA_def_property_update(prop, 0, "rna_ChannelDriver_update_data"); // XXX disabled for now, until we can turn off auto updates }
static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; RNA_def_property_srna(cprop, "LayerObjects"); srna = RNA_def_struct(brna, "LayerObjects", NULL); RNA_def_struct_sdna(srna, "ViewLayer"); RNA_def_struct_ui_text(srna, "Layer Objects", "Collections of objects"); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_funcs(prop, "rna_LayerObjects_active_object_get", "rna_LayerObjects_active_object_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Object", "Active object for this layer"); /* Could call: ED_object_base_activate(C, rl->basact); * but would be a bad level call and it seems the notifier is enough */ RNA_def_property_update(prop, NC_SCENE | ND_OB_ACTIVE, NULL); prop = RNA_def_property(srna, "selected", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_collection_funcs(prop, "rna_LayerObjects_selected_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_ViewLayer_objects_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Selected Objects", "All the selected objects of this layer"); }
static void rna_def_masklayers(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; PropertyRNA *parm; RNA_def_property_srna(cprop, "MaskLayers"); srna = RNA_def_struct(brna, "MaskLayers", NULL); RNA_def_struct_sdna(srna, "Mask"); RNA_def_struct_ui_text(srna, "Mask Layers", "Collection of layers used by mask"); func = RNA_def_function(srna, "new", "rna_Mask_layers_new"); RNA_def_function_ui_description(func, "Add layer to this mask"); RNA_def_string(func, "name", NULL, 0, "Name", "Name of new layer"); parm = RNA_def_pointer(func, "layer", "MaskLayer", "", "New mask layer"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_Mask_layers_remove"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Remove layer from this mask"); parm = RNA_def_pointer(func, "layer", "MaskLayer", "", "Shape to be removed"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); /* clear all layers */ func = RNA_def_function(srna, "clear", "rna_Mask_layers_clear"); RNA_def_function_ui_description(func, "Remove all mask layers"); /* active layer */ prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "MaskLayer"); RNA_def_property_pointer_funcs(prop, "rna_Mask_layer_active_get", "rna_Mask_layer_active_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_UNLINK); RNA_def_property_ui_text(prop, "Active Shape", "Active layer in this mask"); }
/* armature.bones.* */ static void rna_def_armature_bones(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *prop; /* FunctionRNA *func; */ /* PropertyRNA *parm; */ RNA_def_property_srna(cprop, "ArmatureBones"); srna = RNA_def_struct(brna, "ArmatureBones", NULL); RNA_def_struct_sdna(srna, "bArmature"); RNA_def_struct_ui_text(srna, "Armature Bones", "Collection of armature bones"); prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_pointer_sdna(prop, NULL, "act_bone"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Bone", "Armature's active bone"); RNA_def_property_pointer_funcs(prop, NULL, "rna_Armature_act_bone_set", NULL, NULL); /* todo, redraw */ /* RNA_def_property_collection_active(prop, prop_act); */ }
void RNA_def_world(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; /* static EnumPropertyItem physics_engine_items[] = { {WOPHY_NONE, "NONE", 0, "None", ""}, //{WOPHY_ENJI, "ENJI", 0, "Enji", ""}, //{WOPHY_SUMO, "SUMO", 0, "Sumo (Deprecated)", ""}, //{WOPHY_DYNAMO, "DYNAMO", 0, "Dynamo", ""}, //{WOPHY_ODE, "ODE", 0, "ODE", ""}, {WOPHY_BULLET, "BULLET", 0, "Bullet", ""}, {0, NULL, 0, NULL, NULL}}; */ srna= RNA_def_struct(brna, "World", "ID"); RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene."); RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA); rna_def_animdata_common(srna); rna_def_mtex_common(srna, "rna_World_mtex_begin", "rna_World_active_texture_get", "rna_World_active_texture_set", "WorldTextureSlot", "rna_World_update"); /* colors */ prop= RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "horr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon."); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "zenr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith."); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ambr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Ambient Color", ""); RNA_def_property_update(prop, 0, "rna_World_update"); /* exp, range */ prop= RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "exp"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light."); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_range(prop, 0.2, 5.0); RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1."); RNA_def_property_update(prop, 0, "rna_World_update"); /* sky type */ prop= RNA_def_property(srna, "blend_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND); RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith."); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "paper_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER); RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates."); RNA_def_property_update(prop, 0, "rna_World_update"); prop= RNA_def_property(srna, "real_sky", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL); RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle."); RNA_def_property_update(prop, 0, "rna_World_update"); /* nested structs */ prop= RNA_def_property(srna, "ambient_occlusion", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "WorldAmbientOcclusion"); RNA_def_property_pointer_funcs(prop, "rna_World_ambient_occlusion_get", NULL, NULL); RNA_def_property_ui_text(prop, "Ambient Occlusion", "World ambient occlusion 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_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_ui_text(prop, "Stars", "World stars settings."); rna_def_ambient_occlusion(brna); rna_def_world_mist(brna); rna_def_world_stars(brna); rna_def_world_mtex(brna); }
static void rna_def_edit_bone(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "EditBone", NULL); RNA_def_struct_sdna(srna, "EditBone"); RNA_def_struct_idprops_func(srna, "rna_EditBone_idprops"); RNA_def_struct_ui_text(srna, "Edit Bone", "Editmode bone in an Armature datablock"); RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); RNA_define_verify_sdna(0); /* not in sdna */ 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, 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"); prop = RNA_def_property(srna, "roll", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "roll"); RNA_def_property_ui_range(prop, -M_PI * 2, M_PI * 2, 0.1, 2); RNA_def_property_ui_text(prop, "Roll", "Bone rotation around head-tail axis"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); prop = RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "head"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); prop = RNA_def_property(srna, "tail", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "tail"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); rna_def_bone_common(srna, 1); prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_A); RNA_def_property_ui_text(prop, "Hide", "Bone is not visible when in Edit Mode"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); prop = RNA_def_property(srna, "lock", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_EDITMODE_LOCKED); RNA_def_property_ui_text(prop, "Lock", "Bone is not able to be transformed when in Edit Mode"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_SELECTED); RNA_def_property_ui_text(prop, "Select", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); prop = RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_ROOTSEL); RNA_def_property_ui_text(prop, "Head Select", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); prop = RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_TIPSEL); RNA_def_property_ui_text(prop, "Tail Select", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* calculated and read only, not actual data access */ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); /*RNA_def_property_float_sdna(prop, NULL, ""); *//* doesnt access any real data */ RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); //RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_flag(prop, PROP_THICK_WRAP); /* no reference to original data */ RNA_def_property_ui_text(prop, "Editbone Matrix", "Matrix combining loc/rot of the bone (head position, direction and roll), " "in armature space (WARNING: does not include/support bone's length/size)"); RNA_def_property_float_funcs(prop, "rna_EditBone_matrix_get", "rna_EditBone_matrix_set", NULL); RNA_api_armature_edit_bone(srna); RNA_define_verify_sdna(1); }
void RNA_def_world(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "World", "ID"); RNA_def_struct_ui_text(srna, "World", "World datablock describing the environment and ambient lighting of a scene"); RNA_def_struct_ui_icon(srna, ICON_WORLD_DATA); rna_def_animdata_common(srna); rna_def_mtex_common(brna, srna, "rna_World_mtex_begin", "rna_World_active_texture_get", "rna_World_active_texture_set", NULL, "WorldTextureSlot", "WorldTextureSlots", "rna_World_update", "rna_World_update"); /* colors */ prop = RNA_def_property(srna, "horizon_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "horr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Horizon Color", "Color at the horizon"); /* RNA_def_property_update(prop, 0, "rna_World_update"); */ /* render-only uses this */ RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); prop = RNA_def_property(srna, "zenith_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "zenr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Zenith Color", "Color at the zenith"); RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); prop = RNA_def_property(srna, "ambient_color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "ambr"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Ambient Color", "Ambient color of the world"); RNA_def_property_update(prop, 0, "rna_World_update"); /* exp, range */ prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "exp"); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_text(prop, "Exposure", "Amount of exponential color correction for light"); RNA_def_property_update(prop, 0, "rna_World_update"); prop = RNA_def_property(srna, "color_range", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "range"); RNA_def_property_range(prop, 0.2, 5.0); RNA_def_property_ui_text(prop, "Range", "The color range that will be mapped to 0-1"); RNA_def_property_update(prop, 0, "rna_World_update"); /* sky type */ prop = RNA_def_property(srna, "use_sky_blend", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYBLEND); RNA_def_property_ui_text(prop, "Blend Sky", "Render background with natural progression from horizon to zenith"); RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); prop = RNA_def_property(srna, "use_sky_paper", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYPAPER); RNA_def_property_ui_text(prop, "Paper Sky", "Flatten blend or texture coordinates"); RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); prop = RNA_def_property(srna, "use_sky_real", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "skytype", WO_SKYREAL); RNA_def_property_ui_text(prop, "Real Sky", "Render background with a real horizon, relative to the camera angle"); RNA_def_property_update(prop, NC_WORLD | ND_WORLD_DRAW, "rna_World_update"); /* nested structs */ prop = RNA_def_property(srna, "light_settings", 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, NULL); RNA_def_property_ui_text(prop, "Lighting", "World lighting settings"); prop = RNA_def_property(srna, "mist_settings", 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, NULL); RNA_def_property_ui_text(prop, "Mist", "World mist settings"); /* nodes */ prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "nodetree"); RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based worlds"); prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes to render the world"); RNA_def_property_update(prop, 0, "rna_World_use_nodes_update"); rna_def_lighting(brna); rna_def_world_mist(brna); rna_def_world_mtex(brna); }