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_REPORTS | 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_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, "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_strokes_api(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; FunctionRNA *func; PropertyRNA *parm; RNA_def_property_srna(cprop, "GPencilStrokes"); srna = RNA_def_struct(brna, "GPencilStrokes", NULL); RNA_def_struct_sdna(srna, "bGPDframe"); RNA_def_struct_ui_text(srna, "Grease Pencil Frames", "Collection of grease pencil frames"); func = RNA_def_function(srna, "new", "rna_GPencil_stroke_new"); RNA_def_function_ui_description(func, "Add a new grease pencil frame"); parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "", "The newly created stroke"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_GPencil_stroke_remove"); RNA_def_function_ui_description(func, "Remove a grease pencil frame"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "stroke", "GPencilStroke", "Stroke", "The stroke to remove"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); }
static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) { StructRNA *srna; BPY_PROPDEF_HEAD(IntProperty) if(srna) { static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", NULL}; const char *id=NULL, *name="", *description=""; int id_len; int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def=0; PropertyRNA *prop; PyObject *pyopts= NULL; int opts=0; char *pysubtype= NULL; int subtype= PROP_NONE; if (!PyArg_ParseTupleAndKeywords(args, kw, "s#|ssiiiiiiO!s:IntProperty", (char **)kwlist, &id, &id_len, &name, &description, &def, &min, &max, &soft_min, &soft_max, &step, &PySet_Type, &pyopts, &pysubtype)) return NULL; BPY_PROPDEF_SUBTYPE_CHECK(IntProperty, property_flag_items, property_subtype_number_items) prop= RNA_def_property(srna, id, PROP_INT, subtype); RNA_def_property_int_default(prop, def); RNA_def_property_range(prop, min, max); RNA_def_property_ui_text(prop, name, description); RNA_def_property_ui_range(prop, MAX2(soft_min, min), MIN2(soft_max, max), step, 3); if(pyopts) { if(opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN); if((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); } RNA_def_property_duplicate_pointers(srna, prop); } Py_RETURN_NONE; }
static void rna_def_text_marker(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "TextMarker", NULL); RNA_def_struct_ui_text(srna, "Text Marker", "Marker highlighting a portion of text in a Text datablock"); prop= RNA_def_property(srna, "line", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "lineno"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Line", "Line in which the marker is located"); prop= RNA_def_property(srna, "character_index_start", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "start"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Start", "Start position of the marker in the line"); prop= RNA_def_property(srna, "character_index_end", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "end"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "End", "Start position of the marker in the line"); prop= RNA_def_property(srna, "group", PROP_INT, PROP_UNSIGNED); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_range(prop, 0, (int)0xFFFF); RNA_def_property_ui_text(prop, "Group", ""); prop= RNA_def_property(srna, "is_temporary", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_TEMP); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Temporary", "Marker is temporary"); prop= RNA_def_property(srna, "use_edit_all", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", TMARK_EDITALL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Edit All", "Edit all markers of the same group as one"); prop= RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Color", "Color to display the marker with"); }
static void rna_def_color_ramp(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; static EnumPropertyItem prop_interpolation_items[] = { {COLBAND_INTERP_EASE, "EASE", 0, "Ease", ""}, {COLBAND_INTERP_CARDINAL, "CARDINAL", 0, "Cardinal", ""}, {COLBAND_INTERP_LINEAR, "LINEAR", 0, "Linear", ""}, {COLBAND_INTERP_B_SPLINE, "B_SPLINE", 0, "B-Spline", ""}, {COLBAND_INTERP_CONSTANT, "CONSTANT", 0, "Constant", ""}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem prop_mode_items[] = { {COLBAND_BLEND_RGB, "RGB", 0, "RGB", ""}, {COLBAND_BLEND_HSV, "HSV", 0, "HSV", ""}, {COLBAND_BLEND_HSL, "HSL", 0, "HSL", ""}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem prop_hsv_items[] = { {COLBAND_HUE_NEAR, "NEAR", 0, "Near", ""}, {COLBAND_HUE_FAR, "FAR", 0, "Far", ""}, {COLBAND_HUE_CW, "CW", 0, "Clockwise", ""}, {COLBAND_HUE_CCW, "CCW", 0, "Counter-Clockwise", ""}, {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "ColorRamp", NULL); RNA_def_struct_sdna(srna, "ColorBand"); RNA_def_struct_path_func(srna, "rna_ColorRamp_path"); RNA_def_struct_ui_text(srna, "Color Ramp", "Color ramp mapping a scalar value to a color"); prop = RNA_def_property(srna, "elements", PROP_COLLECTION, PROP_COLOR); RNA_def_property_collection_sdna(prop, NULL, "data", "tot"); RNA_def_property_struct_type(prop, "ColorRampElement"); RNA_def_property_ui_text(prop, "Elements", ""); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); rna_def_color_ramp_element_api(brna, prop); prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipotype"); RNA_def_property_enum_items(prop, prop_interpolation_items); RNA_def_property_ui_text(prop, "Interpolation", "Set interpolation between color stops"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); prop = RNA_def_property(srna, "hue_interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ipotype_hue"); RNA_def_property_enum_items(prop, prop_hsv_items); RNA_def_property_ui_text(prop, "Color Interpolation", "Set color interpolation"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); prop = RNA_def_property(srna, "color_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "color_mode"); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Color Mode", "Set color mode to use for interpolation"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); #if 0 /* use len(elements) */ prop = RNA_def_property(srna, "total", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "tot"); /* needs a function to do the right thing when adding elements like colorband_add_cb() */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_range(prop, 0, 31); /* MAXCOLORBAND = 32 */ RNA_def_property_ui_text(prop, "Total", "Total number of elements"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); #endif func = RNA_def_function(srna, "evaluate", "rna_ColorRamp_eval"); RNA_def_function_ui_description(func, "Evaluate ColorRamp"); prop = RNA_def_float(func, "position", 1.0f, 0.0f, 1.0f, "Position", "Evaluate ColorRamp at position", 0.0f, 1.0f); RNA_def_property_flag(prop, PROP_REQUIRED); /* return */ prop = RNA_def_float_color(func, "color", 4, NULL, -FLT_MAX, FLT_MAX, "Color", "Color at given position", -FLT_MAX, FLT_MAX); RNA_def_property_flag(prop, PROP_THICK_WRAP); RNA_def_function_output(func, prop); }
static void rna_def_fluidsim_domain(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem quality_items[] = { {OB_FSDOM_GEOM, "GEOMETRY", 0, "Geometry", "Display geometry"}, {OB_FSDOM_PREVIEW, "PREVIEW", 0, "Preview", "Display preview quality results"}, {OB_FSDOM_FINAL, "FINAL", 0, "Final", "Display final quality results"}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "DomainFluidSettings", "FluidSettings"); RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_ui_text(srna, "Domain Fluid Simulation Settings", "Fluid simulation settings for the domain of a fluid simulation"); /* standard settings */ prop = RNA_def_property(srna, "resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "resolutionxyz"); RNA_def_property_range(prop, 1, 1024); RNA_def_property_ui_text(prop, "Resolution", "Domain resolution in X,Y and Z direction"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); prop = RNA_def_property(srna, "preview_resolution", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "previewresxyz"); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Preview Resolution", "Preview resolution in X,Y and Z direction"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); prop = RNA_def_property(srna, "viewport_display_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "guiDisplayMode"); RNA_def_property_enum_items(prop, quality_items); RNA_def_property_ui_text(prop, "Viewport Display Mode", "How to display the mesh in the viewport"); RNA_def_property_update(prop, 0, "rna_fluid_update"); prop = RNA_def_property(srna, "render_display_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "renderDisplayMode"); RNA_def_property_enum_items(prop, quality_items); RNA_def_property_ui_text(prop, "Render Display Mode", "How to display the mesh for rendering"); prop = RNA_def_property(srna, "use_reverse_frames", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_REVERSE); RNA_def_property_ui_text(prop, "Reverse Frames", "Reverse fluid frames"); RNA_def_property_update(prop, 0, "rna_fluid_find_enframe"); prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); RNA_def_property_string_maxlength(prop, FILE_MAX); RNA_def_property_string_sdna(prop, NULL, "surfdataPath"); RNA_def_property_ui_text(prop, "Path", "Directory (and/or filename prefix) to store baked fluid simulation files in"); RNA_def_property_update(prop, 0, "rna_fluid_update"); prop = RNA_def_property(srna, "memory_estimate", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_DomainFluidSettings_memory_estimate_get", "rna_DomainFluidSettings_memory_estimate_length", NULL); RNA_def_property_ui_text(prop, "Memory Estimate", "Estimated amount of memory needed for baking the domain"); /* advanced settings */ prop = RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_float_sdna(prop, NULL, "grav"); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -1000.1, 1000.1); RNA_def_property_ui_text(prop, "Gravity", "Gravity in X, Y and Z direction"); prop = RNA_def_property(srna, "use_time_override", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", OB_FLUIDSIM_OVERRIDE_TIME); RNA_def_property_ui_text(prop, "Override Time", "Use a custom start and end time (in seconds) instead of the scene's timeline"); prop = RNA_def_property(srna, "start_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "animStart"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "Start Time", "Simulation time of the first blender frame (in seconds)"); prop = RNA_def_property(srna, "end_time", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "animEnd"); RNA_def_property_range(prop, 0, 100); RNA_def_property_ui_text(prop, "End Time", "Simulation time of the last blender frame (in seconds)"); prop = RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frameOffset"); RNA_def_property_ui_text(prop, "Cache Offset", "Offset when reading baked cache"); RNA_def_property_update(prop, NC_OBJECT, "rna_fluid_update"); prop = RNA_def_property(srna, "simulation_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "realsize"); RNA_def_property_range(prop, 0.001, 10); RNA_def_property_ui_text(prop, "Real World Size", "Size of the simulation domain in metres"); prop = RNA_def_property(srna, "simulation_rate", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "animRate"); RNA_def_property_range(prop, 0.0, 100.0); RNA_def_property_ui_text(prop, "Simulation Speed", "Fluid motion rate (0 = stationary, 1 = normal speed)"); prop = RNA_def_property(srna, "viscosity_base", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "viscosityValue"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Viscosity Base", "Viscosity setting: value that is multiplied by 10 to the power of (exponent*-1)"); prop = RNA_def_property(srna, "viscosity_exponent", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "viscosityExponent"); RNA_def_property_range(prop, 0, 10); RNA_def_property_ui_text(prop, "Viscosity Exponent", "Negative exponent for the viscosity value (to simplify entering small values " "e.g. 5*10^-6)"); prop = RNA_def_property(srna, "grid_levels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxRefine"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, -1, 4); RNA_def_property_ui_text(prop, "Grid Levels", "Number of coarsened grids to use (-1 for automatic)"); prop = RNA_def_property(srna, "compressibility", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "gstar"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.001, 0.1); RNA_def_property_ui_text(prop, "Compressibility", "Allowed compressibility due to gravitational force for standing fluid " "(directly affects simulation step size)"); /* domain boundary settings */ rna_def_fluidsim_slip(srna); prop = RNA_def_property(srna, "surface_smooth", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "surfaceSmoothing"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0, 5.0); RNA_def_property_ui_text(prop, "Surface Smoothing", "Amount of surface smoothing (a value of 0 is off, 1 is normal smoothing and " "more than 1 is extra smoothing)"); prop = RNA_def_property(srna, "surface_subdivisions", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "surfaceSubdivs"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0, 5); RNA_def_property_ui_text(prop, "Surface Subdivisions", "Number of isosurface subdivisions (this is necessary for the inclusion of particles " "into the surface generation - WARNING: can lead to longer computation times !)"); prop = RNA_def_property(srna, "use_speed_vectors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "domainNovecgen", 0); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Generate Speed Vectors", "Generate speed vectors for vector blur"); /* no collision object surface */ prop = RNA_def_property(srna, "surface_noobs", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "typeFlags", OB_FSSG_NOOBS); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Remove air bubbles", "Removes the air gap between fluid surface and obstacles - WARNING: Can result " "in a dissolving surface in other areas"); /* particles */ prop = RNA_def_property(srna, "tracer_particles", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "generateTracers"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Tracer Particles", "Number of tracer particles to generate"); prop = RNA_def_property(srna, "generate_particles", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "generateParticles"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_text(prop, "Generate Particles", "Amount of particles to generate (0=off, 1=normal, >1=more)"); /* simulated fluid mesh data */ prop = RNA_def_property(srna, "fluid_mesh_vertices", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "FluidMeshVertex"); RNA_def_property_ui_text(prop, "Fluid Mesh Vertices", "Vertices of the fluid mesh generated by simulation"); RNA_def_property_collection_funcs(prop, "rna_FluidMeshVertex_data_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_FluidMeshVertex_data_length", NULL, NULL, NULL); rna_def_fluid_mesh_vertices(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); }
static void rna_def_bone_common(StructRNA *srna, int editbone) { PropertyRNA *prop; /* strings */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); if (editbone) RNA_def_property_string_funcs(prop, NULL, NULL, "rna_EditBone_name_set"); else RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Bone_name_set"); RNA_def_property_update(prop, 0, "rna_Bone_update_renamed"); /* flags */ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 32); if (editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_layer_set"); else RNA_def_property_boolean_funcs(prop, NULL, "rna_Bone_layer_set"); RNA_def_property_ui_text(prop, "Layers", "Layers bone exists in"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); prop = RNA_def_property(srna, "use_connect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_CONNECTED); if (editbone) RNA_def_property_boolean_funcs(prop, NULL, "rna_EditBone_connected_set"); else RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Connected", "When bone has a parent, bone's head is stuck to the parent's tail"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "use_inherit_rotation", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_HINGE); RNA_def_property_ui_text(prop, "Inherit Rotation", "Bone inherits rotation or scale from parent bone"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "use_envelope_multiply", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_MULT_VG_ENV); RNA_def_property_ui_text(prop, "Multiply Vertex Group with Envelope", "When deforming bone, multiply effects of Vertex Group weights with Envelope influence"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "use_deform", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_DEFORM); RNA_def_property_ui_text(prop, "Deform", "Enable Bone to deform geometry"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "use_inherit_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Inherit Scale", "Bone inherits scaling from parent bone"); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_SCALE); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "use_local_location", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Local Location", "Bone location is set in local space"); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_LOCAL_LOCATION); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "use_relative_parent", PROP_BOOLEAN, PROP_NONE); RNA_def_property_ui_text(prop, "Relative Parenting", "Object children will use relative transform, like deform"); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_RELATIVE_PARENTING); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "show_wire", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_DRAWWIRE); RNA_def_property_ui_text(prop, "Draw Wire", "Bone is always drawn as Wireframe regardless of viewport draw mode " "(useful for non-obstructive custom bone shapes)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* XXX: use_cyclic_offset is deprecated in 2.5. May/may not return */ prop = RNA_def_property(srna, "use_cyclic_offset", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BONE_NO_CYCLICOFFSET); RNA_def_property_ui_text(prop, "Cyclic Offset", "When bone doesn't have a parent, it receives cyclic offset effects (Deprecated)"); // "When bone doesn't have a parent, it receives cyclic offset effects"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_UNSELECTABLE); RNA_def_property_ui_text(prop, "Selectable", "Bone is able to be selected"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* Number values */ /* envelope deform settings */ prop = RNA_def_property(srna, "envelope_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Envelope Deform Distance", "Bone deformation distance (for Envelope deform only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "envelope_weight", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "weight"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Envelope Deform Weight", "Bone deformation weight (for Envelope deform only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "head_radius", PROP_FLOAT, PROP_UNSIGNED); if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_head"); /* XXX range is 0 to lim, where lim = 10000.0f * MAX2(1.0, view3d->grid); */ /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Head Radius", "Radius of head of bone (for Envelope deform only)"); prop = RNA_def_property(srna, "tail_radius", PROP_FLOAT, PROP_UNSIGNED); if (editbone) RNA_def_property_update(prop, 0, "rna_Armature_editbone_transform_update"); else RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_float_sdna(prop, NULL, "rad_tail"); /* XXX range is 0 to lim, where lim = 10000.0f * MAX2(1.0, view3d->grid); */ /*RNA_def_property_range(prop, 0, 1000); */ RNA_def_property_ui_range(prop, 0.01, 100, 0.1, 3); RNA_def_property_ui_text(prop, "Envelope Tail Radius", "Radius of tail of bone (for Envelope deform only)"); /* b-bones deform settings */ prop = RNA_def_property(srna, "bbone_segments", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "segments"); RNA_def_property_range(prop, 1, 32); RNA_def_property_ui_text(prop, "B-Bone Segments", "Number of subdivisions of bone (for B-Bones only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "bbone_in", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ease1"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "B-Bone Ease In", "Length of first Bezier Handle (for B-Bones only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "bbone_out", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ease2"); RNA_def_property_range(prop, 0.0f, 2.0f); RNA_def_property_ui_text(prop, "B-Bone Ease Out", "Length of second Bezier Handle (for B-Bones only)"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "bbone_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "xwidth"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "B-Bone Display X Width", "B-Bone X size"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "bbone_z", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "zwidth"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "B-Bone Display Z Width", "B-Bone Z size"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); }
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); }
static void rna_def_lattice(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "Lattice", "ID"); RNA_def_struct_ui_text(srna, "Lattice", "Lattice datablock defining a grid for deforming other objects"); RNA_def_struct_ui_icon(srna, ICON_LATTICE_DATA); prop = RNA_def_property(srna, "points_u", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsu"); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_u_set", NULL); RNA_def_property_range(prop, 1, 64); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "U", "Point in U direction (can't be changed when there are shape keys)"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); prop = RNA_def_property(srna, "points_v", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsv"); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_v_set", NULL); RNA_def_property_range(prop, 1, 64); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "V", "Point in V direction (can't be changed when there are shape keys)"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); prop = RNA_def_property(srna, "points_w", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "pntsw"); RNA_def_property_int_funcs(prop, NULL, "rna_Lattice_points_w_set", NULL); RNA_def_property_range(prop, 1, 64); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "W", "Point in W direction (can't be changed when there are shape keys)"); RNA_def_property_update(prop, 0, "rna_Lattice_update_size"); RNA_def_property_editable_func(prop, "rna_Lattice_size_editable"); prop = RNA_def_property(srna, "interpolation_type_u", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typeu"); RNA_def_property_enum_items(prop, keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type U", ""); RNA_def_property_update(prop, 0, "rna_Lattice_update_data_editlatt"); prop = RNA_def_property(srna, "interpolation_type_v", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typev"); RNA_def_property_enum_items(prop, keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type V", ""); RNA_def_property_update(prop, 0, "rna_Lattice_update_data_editlatt"); prop = RNA_def_property(srna, "interpolation_type_w", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "typew"); RNA_def_property_enum_items(prop, keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation Type W", ""); RNA_def_property_update(prop, 0, "rna_Lattice_update_data_editlatt"); prop = RNA_def_property(srna, "use_outside", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE); RNA_def_property_boolean_funcs(prop, NULL, "rna_Lattice_use_outside_set"); RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data_editlatt"); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group to apply the influence of the lattice"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Lattice_vg_name_set"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data_editlatt"); prop = RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "key"); RNA_def_property_ui_text(prop, "Shape Keys", ""); prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "LatticePoint"); RNA_def_property_collection_funcs(prop, "rna_Lattice_points_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Points", "Points of the lattice"); prop = RNA_def_property(srna, "is_editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Lattice_is_editmode_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Is Editmode", "True when used in editmode"); /* pointers */ rna_def_animdata_common(srna); RNA_api_lattice(srna); }
static void rna_def_ID(BlenderRNA *brna) { StructRNA *srna; FunctionRNA *func; PropertyRNA *prop, *parm; static EnumPropertyItem update_flag_items[] = { {OB_RECALC_OB, "OBJECT", 0, "Object", ""}, {OB_RECALC_DATA, "DATA", 0, "Data", ""}, {OB_RECALC_TIME, "TIME", 0, "Time", ""}, {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "ID", NULL); RNA_def_struct_ui_text(srna, "ID", "Base type for data-blocks, defining a unique name, linking from other libraries " "and garbage collection"); RNA_def_struct_flag(srna, STRUCT_ID | STRUCT_ID_REFCOUNT); RNA_def_struct_refine_func(srna, "rna_ID_refine"); RNA_def_struct_idprops_func(srna, "rna_ID_idprops"); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Unique data-block ID name"); RNA_def_property_string_funcs(prop, "rna_ID_name_get", "rna_ID_name_length", "rna_ID_name_set"); RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2); RNA_def_property_editable_func(prop, "rna_ID_name_editable"); RNA_def_property_update(prop, NC_ID | NA_RENAME, NULL); RNA_def_struct_name_property(srna, prop); prop = RNA_def_property(srna, "users", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "us"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Users", "Number of times this data-block is referenced"); prop = RNA_def_property(srna, "use_fake_user", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_FAKEUSER); RNA_def_property_ui_text(prop, "Fake User", "Save this data-block even if it has no users"); RNA_def_property_boolean_funcs(prop, NULL, "rna_ID_fake_user_set"); prop = RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data for their own purposes " "(initial state is undefined)"); prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Is Updated", "Datablock is tagged for recalculation"); prop = RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_ID_RECALC_DATA); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Is Updated Data", "Datablock data is tagged for recalculation"); prop = RNA_def_property(srna, "is_library_indirect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_INDIRECT); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Is Indirect", "Is this ID block linked indirectly"); prop = RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "lib"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Library", "Library file the data-block is linked from"); prop = RNA_def_pointer(srna, "preview", "ImagePreview", "Preview", "Preview image and icon of this data-block (None if not supported for this type of data)"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_pointer_funcs(prop, "rna_IDPreview_get", NULL, NULL, NULL); /* functions */ func = RNA_def_function(srna, "copy", "rna_ID_copy"); RNA_def_function_ui_description(func, "Create a copy of this data-block (not supported for all data-blocks)"); parm = RNA_def_pointer(func, "id", "ID", "", "New copy of the ID"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "user_clear", "rna_ID_user_clear"); RNA_def_function_ui_description(func, "Clear the user count of a data-block so its not saved, " "on reload the data will be removed"); func = RNA_def_function(srna, "animation_data_create", "rna_ID_animation_data_create"); RNA_def_function_flag(func, FUNC_USE_MAIN); RNA_def_function_ui_description(func, "Create animation data to this ID, note that not all ID types support this"); parm = RNA_def_pointer(func, "anim_data", "AnimData", "", "New animation data or NULL"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "animation_data_clear", "rna_ID_animation_data_free"); RNA_def_function_flag(func, FUNC_USE_MAIN); RNA_def_function_ui_description(func, "Clear animation on this this ID"); func = RNA_def_function(srna, "update_tag", "rna_ID_update_tag"); RNA_def_function_flag(func, FUNC_USE_REPORTS); RNA_def_function_ui_description(func, "Tag the ID to update its display data, " "e.g. when calling :class:`bpy.types.Scene.update`"); RNA_def_enum_flag(func, "refresh", update_flag_items, 0, "", "Type of updates to perform"); }
static void rna_def_image_preview(BlenderRNA *brna) { StructRNA *srna; FunctionRNA *func; PropertyRNA *prop; srna = RNA_def_struct(brna, "ImagePreview", NULL); RNA_def_struct_sdna(srna, "PreviewImage"); RNA_def_struct_ui_text(srna, "Image Preview", "Preview image and icon"); prop = RNA_def_property(srna, "is_image_custom", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag[ICON_SIZE_PREVIEW]", PRV_USER_EDITED); RNA_def_property_boolean_funcs(prop, NULL, "rna_ImagePreview_is_image_custom_set"); RNA_def_property_ui_text(prop, "Custom Image", "True if this preview image has been modified by py script," "and is no more auto-generated by Blender"); prop = RNA_def_int_vector(srna, "image_size", 2, NULL, 0, 0, "Image Size", "Width and height in pixels", 0, 0); RNA_def_property_subtype(prop, PROP_PIXEL); RNA_def_property_int_funcs(prop, "rna_ImagePreview_image_size_get", "rna_ImagePreview_image_size_set", NULL); prop = RNA_def_property(srna, "image_pixels", PROP_INT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_multi_array(prop, 1, NULL); RNA_def_property_ui_text(prop, "Image Pixels", "Image pixels, as bytes (always RGBA 32bits)"); RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_image_pixels_get_length"); RNA_def_property_int_funcs(prop, "rna_ImagePreview_image_pixels_get", "rna_ImagePreview_image_pixels_set", NULL); prop = RNA_def_property(srna, "image_pixels_float", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_multi_array(prop, 1, NULL); RNA_def_property_ui_text(prop, "Float Image Pixels", "Image pixels components, as floats (RGBA concatenated values)"); RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_image_pixels_float_get_length"); RNA_def_property_float_funcs(prop, "rna_ImagePreview_image_pixels_float_get", "rna_ImagePreview_image_pixels_float_set", NULL); prop = RNA_def_property(srna, "is_icon_custom", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag[ICON_SIZE_ICON]", PRV_USER_EDITED); RNA_def_property_boolean_funcs(prop, NULL, "rna_ImagePreview_is_icon_custom_set"); RNA_def_property_ui_text(prop, "Custom Icon", "True if this preview icon has been modified by py script," "and is no more auto-generated by Blender"); prop = RNA_def_int_vector(srna, "icon_size", 2, NULL, 0, 0, "Icon Size", "Width and height in pixels", 0, 0); RNA_def_property_subtype(prop, PROP_PIXEL); RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_size_get", "rna_ImagePreview_icon_size_set", NULL); prop = RNA_def_property(srna, "icon_pixels", PROP_INT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_multi_array(prop, 1, NULL); RNA_def_property_ui_text(prop, "Icon Pixels", "Icon pixels, as bytes (always RGBA 32bits)"); RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_icon_pixels_get_length"); RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_pixels_get", "rna_ImagePreview_icon_pixels_set", NULL); prop = RNA_def_property(srna, "icon_pixels_float", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_multi_array(prop, 1, NULL); RNA_def_property_ui_text(prop, "Float Icon Pixels", "Icon pixels components, as floats (RGBA concatenated values)"); RNA_def_property_dynamic_array_funcs(prop, "rna_ImagePreview_icon_pixels_float_get_length"); RNA_def_property_float_funcs(prop, "rna_ImagePreview_icon_pixels_float_get", "rna_ImagePreview_icon_pixels_float_set", NULL); prop = RNA_def_int(srna, "icon_id", 0, INT_MIN, INT_MAX, "Icon ID", "Unique integer identifying this preview as an icon (zero means invalid)", INT_MIN, INT_MAX); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_int_funcs(prop, "rna_ImagePreview_icon_id_get", NULL, NULL); func = RNA_def_function(srna, "reload", "rna_ImagePreview_icon_reload"); RNA_def_function_ui_description(func, "Reload the preview from its source path"); }
static void rna_def_ID_properties(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; /* this is struct is used for holding the virtual * PropertyRNA's for ID properties */ srna = RNA_def_struct(brna, "PropertyGroupItem", NULL); RNA_def_struct_sdna(srna, "IDProperty"); RNA_def_struct_ui_text(srna, "ID Property", "Property that stores arbitrary, user defined properties"); /* IDP_STRING */ prop = RNA_def_property(srna, "string", PROP_STRING, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); /* IDP_INT */ prop = RNA_def_property(srna, "int", PROP_INT, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); prop = RNA_def_property(srna, "int_array", PROP_INT, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_array(prop, 1); /* IDP_FLOAT */ prop = RNA_def_property(srna, "float", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); prop = RNA_def_property(srna, "float_array", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_array(prop, 1); /* IDP_DOUBLE */ prop = RNA_def_property(srna, "double", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); prop = RNA_def_property(srna, "double_array", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_array(prop, 1); /* IDP_GROUP */ prop = RNA_def_property(srna, "group", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "PropertyGroup"); prop = RNA_def_property(srna, "collection", PROP_COLLECTION, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_struct_type(prop, "PropertyGroup"); prop = RNA_def_property(srna, "idp_array", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "PropertyGroup"); RNA_def_property_collection_funcs(prop, "rna_IDPArray_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_IDPArray_length", NULL, NULL, NULL); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); /* never tested, maybe its useful to have this? */ #if 0 prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting"); RNA_def_struct_name_property(srna, prop); #endif /* IDP_ID -- not implemented yet in id properties */ /* ID property groups > level 0, since level 0 group is merged * with native RNA properties. the builtin_properties will take * care of the properties here */ srna = RNA_def_struct(brna, "PropertyGroup", NULL); RNA_def_struct_sdna(srna, "IDPropertyGroup"); RNA_def_struct_ui_text(srna, "ID Property Group", "Group of ID properties"); RNA_def_struct_idprops_func(srna, "rna_PropertyGroup_idprops"); RNA_def_struct_register_funcs(srna, "rna_PropertyGroup_register", "rna_PropertyGroup_unregister", NULL); RNA_def_struct_refine_func(srna, "rna_PropertyGroup_refine"); /* important so python types can have their name used in list views * however this isn't prefect because it overrides how python would set the name * when we only really want this so RNA_def_struct_name_property() is set to something useful */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_flag(prop, PROP_EXPORT | PROP_IDPROPERTY); /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ RNA_def_property_ui_text(prop, "Name", "Unique name used in the code and scripting"); RNA_def_struct_name_property(srna, prop); }
void RNA_def_controller(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem python_controller_modes[] = { {CONT_PY_SCRIPT, "SCRIPT", 0, "Script", ""}, {CONT_PY_MODULE, "MODULE", 0, "Module", ""}, {0, NULL, 0, NULL, NULL}}; /* Controller */ srna = RNA_def_struct(brna, "Controller", NULL); RNA_def_struct_sdna(srna, "bController"); RNA_def_struct_refine_func(srna, "rna_Controller_refine"); RNA_def_struct_ui_text(srna, "Controller", "Game engine logic brick to process events, connecting sensors to actuators"); RNA_api_controller(srna); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_Constroller_name_set"); RNA_def_struct_name_property(srna, prop); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_type_set", NULL); RNA_def_property_enum_items(prop, controller_type_items); RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_SHOW); RNA_def_property_ui_text(prop, "Expanded", "Set controller expanded in the user interface"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "use_priority", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PRIO); RNA_def_property_ui_text(prop, "Priority", "Mark controller for execution before all non-marked controllers " "(good for startup scripts)"); RNA_def_property_ui_icon(prop, ICON_BOOKMARKS, 1); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "actuators", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "links", NULL); RNA_def_property_struct_type(prop, "Actuator"); RNA_def_property_ui_text(prop, "Actuators", "The list containing the actuators connected to the controller"); RNA_def_property_collection_funcs(prop, "rna_Controller_actuators_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", "rna_Controller_actuators_length", NULL, NULL, NULL); /* State */ /* array of OB_MAX_STATES */ /*prop= RNA_def_property(srna, "states", PROP_BOOLEAN, PROP_LAYER_MEMBER); */ /*RNA_def_property_array(prop, OB_MAX_STATES); */ /*RNA_def_property_clear_flag(prop, PROP_EDITABLE); */ /*RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); */ /*RNA_def_property_boolean_funcs(prop, "rna_Controller_state_get", "rna_Controller_state_set"); */ /*RNA_def_property_update(prop, NC_LOGIC, NULL); */ /* number of the state */ prop = RNA_def_property(srna, "states", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "state_mask"); RNA_def_property_range(prop, 1, OB_MAX_STATES); RNA_def_property_ui_text(prop, "", "Set Controller state index (1 to 30)"); RNA_def_property_int_funcs(prop, "rna_Controller_state_number_get", "rna_Controller_state_number_set", NULL); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Expression Controller */ srna = RNA_def_struct(brna, "ExpressionController", "Controller"); RNA_def_struct_sdna_from(srna, "bExpressionCont", "data"); RNA_def_struct_ui_text(srna, "Expression Controller", "Controller passing on events based on the evaluation of an expression"); prop = RNA_def_property(srna, "expression", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "str"); RNA_def_property_ui_text(prop, "Expression", ""); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Python Controller */ srna = RNA_def_struct(brna, "PythonController", "Controller" ); RNA_def_struct_sdna_from(srna, "bPythonCont", "data"); RNA_def_struct_ui_text(srna, "Python Controller", "Controller executing a python script"); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, python_controller_modes); RNA_def_property_enum_funcs(prop, NULL, "rna_Controller_mode_set", NULL); RNA_def_property_ui_text(prop, "Execution Method", "Python script type (textblock or module - faster)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "text", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Text"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Text", "Text datablock with the python script"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "module", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Module", "Module name and function to run, e.g. \"someModule.main\" " "(internal texts and external python files can be used)"); RNA_def_property_update(prop, NC_LOGIC, NULL); prop = RNA_def_property(srna, "use_debug", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONT_PY_DEBUG); RNA_def_property_ui_text(prop, "D", "Continuously reload the module from disk for editing external modules " "without restarting"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Other Controllers */ srna = RNA_def_struct(brna, "AndController", "Controller"); RNA_def_struct_ui_text(srna, "And Controller", "Controller passing on events based on a logical AND operation"); srna = RNA_def_struct(brna, "OrController", "Controller"); RNA_def_struct_ui_text(srna, "Or Controller", "Controller passing on events based on a logical OR operation"); srna = RNA_def_struct(brna, "NorController", "Controller"); RNA_def_struct_ui_text(srna, "Nor Controller", "Controller passing on events based on a logical NOR operation"); srna = RNA_def_struct(brna, "NandController", "Controller"); RNA_def_struct_ui_text(srna, "Nand Controller", "Controller passing on events based on a logical NAND operation"); srna = RNA_def_struct(brna, "XorController", "Controller"); RNA_def_struct_ui_text(srna, "Xor Controller", "Controller passing on events based on a logical XOR operation"); srna = RNA_def_struct(brna, "XnorController", "Controller"); RNA_def_struct_ui_text(srna, "Xnor Controller", "Controller passing on events based on a logical XNOR operation"); }
void RNA_def_camera(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static const EnumPropertyItem prop_type_items[] = { {CAM_PERSP, "PERSP", 0, "Perspective", ""}, {CAM_ORTHO, "ORTHO", 0, "Orthographic", ""}, {CAM_PANO, "PANO", 0, "Panoramic", ""}, {0, NULL, 0, NULL, NULL} }; static const EnumPropertyItem prop_draw_type_extra_items[] = { {CAM_DTX_CENTER, "CENTER", 0, "Center", ""}, {CAM_DTX_CENTER_DIAG, "CENTER_DIAGONAL", 0, "Center Diagonal", ""}, {CAM_DTX_THIRDS, "THIRDS", 0, "Thirds", ""}, {CAM_DTX_GOLDEN, "GOLDEN", 0, "Golden", ""}, {CAM_DTX_GOLDEN_TRI_A, "GOLDEN_TRIANGLE_A", 0, "Golden Triangle A", ""}, {CAM_DTX_GOLDEN_TRI_B, "GOLDEN_TRIANGLE_B", 0, "Golden Triangle B", ""}, {CAM_DTX_HARMONY_TRI_A, "HARMONY_TRIANGLE_A", 0, "Harmonious Triangle A", ""}, {CAM_DTX_HARMONY_TRI_B, "HARMONY_TRIANGLE_B", 0, "Harmonious Triangle B", ""}, {0, NULL, 0, NULL, NULL} }; static const EnumPropertyItem prop_lens_unit_items[] = { {0, "MILLIMETERS", 0, "Millimeters", "Specify the lens in millimeters"}, {CAM_ANGLETOGGLE, "FOV", 0, "Field of View", "Specify the lens as the field of view's angle"}, {0, NULL, 0, NULL, NULL} }; static const EnumPropertyItem sensor_fit_items[] = { {CAMERA_SENSOR_FIT_AUTO, "AUTO", 0, "Auto", "Fit to the sensor width or height depending on image resolution"}, {CAMERA_SENSOR_FIT_HOR, "HORIZONTAL", 0, "Horizontal", "Fit to the sensor width"}, {CAMERA_SENSOR_FIT_VERT, "VERTICAL", 0, "Vertical", "Fit to the sensor height"}, {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "Camera", "ID"); RNA_def_struct_ui_text(srna, "Camera", "Camera data-block for storing camera settings"); RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA); /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); RNA_def_property_ui_text(prop, "Type", "Camera types"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "show_guide", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "dtx"); RNA_def_property_enum_items(prop, prop_draw_type_extra_items); RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Composition Guides", "Draw overlay"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "sensor_fit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "sensor_fit"); RNA_def_property_enum_items(prop, sensor_fit_items); RNA_def_property_ui_text(prop, "Sensor Fit", "Method to fit image and field of view angle inside the sensor"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); /* Number values */ prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "passepartalpha"); RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "angle_x", PROP_FLOAT, PROP_ANGLE); RNA_def_property_range(prop, DEG2RAD(0.367), DEG2RAD(172.847)); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Horizontal FOV", "Camera lens horizontal field of view"); RNA_def_property_float_funcs(prop, "rna_Camera_angle_x_get", "rna_Camera_angle_x_set", NULL); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "angle_y", PROP_FLOAT, PROP_ANGLE); RNA_def_property_range(prop, DEG2RAD(0.367), DEG2RAD(172.847)); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Vertical FOV", "Camera lens vertical field of view"); RNA_def_property_float_funcs(prop, "rna_Camera_angle_y_get", "rna_Camera_angle_y_set", NULL); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_range(prop, DEG2RAD(0.367), DEG2RAD(172.847)); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Field of View", "Camera lens field of view"); RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipsta"); RNA_def_property_range(prop, 1e-6f, FLT_MAX); RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "clipend"); RNA_def_property_range(prop, 1e-6f, FLT_MAX); RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_DISTANCE_CAMERA); RNA_def_property_float_sdna(prop, NULL, "lens"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_range(prop, 1.0f, 5000.0f, 1, 2); RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_DISTANCE_CAMERA); RNA_def_property_float_sdna(prop, NULL, "sensor_x"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2); RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_DISTANCE_CAMERA); RNA_def_property_float_sdna(prop, NULL, "sensor_y"); RNA_def_property_range(prop, 1.0f, FLT_MAX); RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2); RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "ortho_scale"); RNA_def_property_range(prop, FLT_MIN, FLT_MAX); RNA_def_property_ui_range(prop, 0.001f, 10000.0f, 10, 3); RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "drawsize"); RNA_def_property_range(prop, 0.01f, 1000.0f); RNA_def_property_ui_range(prop, 0.01, 100, 1, 2); RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "shift_x", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shiftx"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3); RNA_def_property_ui_text(prop, "Shift X", "Camera horizontal shift"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "shift_y", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shifty"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_ui_range(prop, -2.0, 2.0, 1, 3); RNA_def_property_ui_text(prop, "Shift Y", "Camera vertical shift"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "YF_dofdist"); RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 5000.0f, 1, 2); RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); /* Stereo Settings */ prop = RNA_def_property(srna, "stereo", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "stereo"); RNA_def_property_struct_type(prop, "CameraStereoData"); RNA_def_property_ui_text(prop, "Stereo", ""); /* flag */ prop = RNA_def_property(srna, "show_limits", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWLIMITS); RNA_def_property_ui_text(prop, "Show Limits", "Draw the clipping range and focus point on the camera"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_mist", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWMIST); RNA_def_property_ui_text(prop, "Show Mist", "Draw a line from the Camera to indicate the mist area"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT); RNA_def_property_ui_text(prop, "Show Passepartout", "Show a darkened overlay outside the image area in Camera view"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "show_safe_areas", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOW_SAFE_MARGINS); RNA_def_property_ui_text(prop, "Show Safe Areas", "Show TV title safe and action safe areas in Camera view"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "show_safe_center", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOW_SAFE_CENTER); RNA_def_property_ui_text(prop, "Show Center-cut safe areas", "Show safe areas to fit content in a different aspect ratio"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "show_name", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME); RNA_def_property_ui_text(prop, "Show Name", "Show the active Camera's name in Camera view"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "show_sensor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWSENSOR); RNA_def_property_ui_text(prop, "Show Sensor Size", "Show sensor size (film gate) in Camera view"); RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL); prop = RNA_def_property(srna, "lens_unit", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_lens_unit_items); RNA_def_property_ui_text(prop, "Lens Unit", "Unit to edit lens in for the user interface"); /* pointers */ prop = RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_pointer_sdna(prop, NULL, "dof_ob"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define the depth of field focal point"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dependency_update"); prop = RNA_def_property(srna, "gpu_dof", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "GPUDOFSettings"); RNA_def_property_ui_text(prop, "GPU Depth Of Field", ""); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); rna_def_animdata_common(srna); /* Nested Data */ RNA_define_animate_sdna(true); /* *** Animated *** */ rna_def_camera_stereo_data(brna); /* Camera API */ RNA_api_camera(srna); }
static void rna_def_area(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; srna = RNA_def_struct(brna, "Area", NULL); RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor"); RNA_def_struct_sdna(srna, "ScrArea"); prop = RNA_def_property(srna, "spaces", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "spacedata", NULL); RNA_def_property_struct_type(prop, "Space"); RNA_def_property_ui_text(prop, "Spaces", "Spaces contained in this area, the first being the active space " "(NOTE: Useful for example to restore a previously used 3D view space " "in a certain area to get the old view orientation)"); rna_def_area_spaces(brna, prop); prop = RNA_def_property(srna, "regions", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "regionbase", NULL); RNA_def_property_struct_type(prop, "Region"); RNA_def_property_ui_text(prop, "Regions", "Regions this area is subdivided in"); prop = RNA_def_property(srna, "show_menus", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", HEADER_NO_PULLDOWN); RNA_def_property_ui_text(prop, "Show Menus", "Show menus in the header"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "spacetype"); RNA_def_property_enum_items(prop, rna_enum_space_type_items); RNA_def_property_enum_default(prop, SPACE_VIEW3D); RNA_def_property_enum_funcs(prop, "rna_Area_type_get", "rna_Area_type_set", "rna_Area_type_itemf"); RNA_def_property_ui_text(prop, "Editor Type", "Current editor type for this area"); RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Area_type_update"); prop = RNA_def_property(srna, "x", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "totrct.xmin"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "X Position", "The window relative vertical location of the area"); prop = RNA_def_property(srna, "y", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "totrct.ymin"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Y Position", "The window relative horizontal location of the area"); prop = RNA_def_property(srna, "width", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "winx"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Width", "Area width"); prop = RNA_def_property(srna, "height", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "winy"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Height", "Area height"); RNA_def_function(srna, "tag_redraw", "ED_area_tag_redraw"); func = RNA_def_function(srna, "header_text_set", "ED_area_headerprint"); RNA_def_function_ui_description(func, "Set the header text"); RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text"); }
static void rna_def_screen(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "Screen", "ID"); RNA_def_struct_sdna(srna, "Screen"); /* it is actually bScreen but for 2.5 the dna is patched! */ RNA_def_struct_ui_text(srna, "Screen", "Screen data-block, defining the layout of areas in a window"); RNA_def_struct_ui_icon(srna, ICON_SPLITSCREEN); /* pointers */ 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, 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"); /* collections */ prop = RNA_def_property(srna, "areas", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "areabase", NULL); RNA_def_property_struct_type(prop, "Area"); RNA_def_property_ui_text(prop, "Areas", "Areas the screen is subdivided into"); /* readonly status indicators */ prop = RNA_def_property(srna, "is_animation_playing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Screen_is_animation_playing_get", NULL); RNA_def_property_ui_text(prop, "Animation Playing", "Animation playback is active"); prop = RNA_def_property(srna, "show_fullscreen", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_Screen_fullscreen_get", NULL); RNA_def_property_ui_text(prop, "Maximize", "An area is maximized, filling this screen"); /* Define Anim Playback Areas */ prop = RNA_def_property(srna, "use_play_top_left_3d_editor", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_REGION); RNA_def_property_ui_text(prop, "Top-Left 3D Editor", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_3d_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_3D_WIN); RNA_def_property_ui_text(prop, "All 3D View Editors", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_follow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_FOLLOW); RNA_def_property_ui_text(prop, "Follow", "Follow current frame in editors"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_animation_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_ANIM_WIN); RNA_def_property_ui_text(prop, "Animation Editors", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_properties_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_BUTS_WIN); RNA_def_property_ui_text(prop, "Property Editors", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_image_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_ALL_IMAGE_WIN); RNA_def_property_ui_text(prop, "Image Editors", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_sequence_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_SEQ); RNA_def_property_ui_text(prop, "Sequencer Editors", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_node_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_NODES); RNA_def_property_ui_text(prop, "Node Editors", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); prop = RNA_def_property(srna, "use_play_clip_editors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "redraws_flag", TIME_CLIPS); RNA_def_property_ui_text(prop, "Clip Editors", ""); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_TIME, "rna_Screen_redraw_update"); }
static void rna_def_smoke_domain_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_noise_type_items[] = { {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, #ifdef WITH_FFTW3 {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, #endif /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem prop_compression_items[] = { { VDB_COMPRESSION_ZIP, "ZIP", 0, "Zip", "Effective but slow compression" }, #ifdef WITH_OPENVDB_BLOSC { VDB_COMPRESSION_BLOSC, "BLOSC", 0, "Blosc", "Multithreaded compression, similar in size and quality as 'Zip'" }, #endif { VDB_COMPRESSION_NONE, "NONE", 0, "None", "Do not use any compression" }, { 0, NULL, 0, NULL, NULL } }; static EnumPropertyItem smoke_cache_comp_items[] = { {SM_CACHE_LIGHT, "CACHELIGHT", 0, "Light", "Fast but not so effective compression"}, {SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem smoke_highres_sampling_items[] = { {SM_HRES_FULLSAMPLE, "FULLSAMPLE", 0, "Full Sample", ""}, {SM_HRES_LINEAR, "LINEAR", 0, "Linear", ""}, {SM_HRES_NEAREST, "NEAREST", 0, "Nearest", ""}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem smoke_data_depth_items[] = { {16, "16", 0, "Float (Half)", "Half float (16 bit data)"}, {0, "32", 0, "Float (Full)", "Full float (32 bit data)"}, /* default */ {0, NULL, 0, NULL, NULL}, }; static EnumPropertyItem smoke_domain_colli_items[] = { {SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"}, {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open", "Smoke doesn't collide with top and bottom sides"}, {SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem cache_file_type_items[] = { {PTCACHE_FILE_PTCACHE, "POINTCACHE", 0, "Point Cache", "Blender specific point cache file format"}, #ifdef WITH_OPENVDB {PTCACHE_FILE_OPENVDB, "OPENVDB", 0, "OpenVDB", "OpenVDB file format"}, #endif {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL); RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings"); RNA_def_struct_sdna(srna, "SmokeDomainSettings"); RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path"); prop = RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxres"); RNA_def_property_range(prop, 6, 512); RNA_def_property_ui_range(prop, 24, 512, 2, -1); RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "amplify"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_range(prop, 1, 10, 1, -1); RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG); RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise"); RNA_def_property_enum_items(prop, prop_noise_type_items); RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Density", "How much density affects smoke motion (higher value results in faster rising smoke)"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "beta"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Heat", "How much heat affects smoke motion (higher value results in faster rising smoke)"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "coll_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependency"); prop = RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "fluid_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependency"); prop = RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "eff_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset_dependency"); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2); RNA_def_property_ui_text(prop, "Strength", "Strength of noise"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_range(prop, 1.0, 10000.0); RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, -1); RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG); RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x "); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]"); RNA_def_property_ui_text(prop, "Point Cache", ""); prop = RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "cache_comp"); RNA_def_property_enum_items(prop, smoke_cache_comp_items); RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used"); prop = RNA_def_property(srna, "openvdb_cache_compress_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "openvdb_comp"); RNA_def_property_enum_items(prop, prop_compression_items); RNA_def_property_ui_text(prop, "Compression", "Compression method to be used"); prop = RNA_def_property(srna, "data_depth", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "data_depth"); RNA_def_property_enum_items(prop, smoke_data_depth_items); RNA_def_property_ui_text(prop, "Data Depth", "Bit depth for writing all scalar (including vector) " "lower values reduce file size"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL); prop = RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "border_collisions"); RNA_def_property_enum_items(prop, smoke_domain_colli_items); RNA_def_property_ui_text(prop, "Border Collisions", "Select which domain border will be treated as collision object"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "EffectorWeights"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Weights", ""); prop = RNA_def_property(srna, "highres_sampling", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, smoke_highres_sampling_items); RNA_def_property_ui_text(prop, "Emitter", "Method for sampling the high resolution flow"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "time_scale"); RNA_def_property_range(prop, 0.2, 1.5); RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5); RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vorticity"); RNA_def_property_range(prop, 0.01, 4.0); RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5); RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "density_grid", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 32); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_dynamic_array_funcs(prop, "rna_SmokeModifier_grid_get_length"); RNA_def_property_float_funcs(prop, "rna_SmokeModifier_density_grid_get", NULL, NULL); RNA_def_property_ui_text(prop, "Density Grid", "Smoke density grid"); prop = RNA_def_property(srna, "velocity_grid", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 32); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_dynamic_array_funcs(prop, "rna_SmokeModifier_velocity_grid_get_length"); RNA_def_property_float_funcs(prop, "rna_SmokeModifier_velocity_grid_get", NULL, NULL); RNA_def_property_ui_text(prop, "Velocity Grid", "Smoke velocity grid"); prop = RNA_def_property(srna, "flame_grid", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 32); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_dynamic_array_funcs(prop, "rna_SmokeModifier_grid_get_length"); RNA_def_property_float_funcs(prop, "rna_SmokeModifier_flame_grid_get", NULL, NULL); RNA_def_property_ui_text(prop, "Flame Grid", "Smoke flame grid"); prop = RNA_def_property(srna, "color_grid", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 32); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_dynamic_array_funcs(prop, "rna_SmokeModifier_color_grid_get_length"); RNA_def_property_float_funcs(prop, "rna_SmokeModifier_color_grid_get", NULL, NULL); RNA_def_property_ui_text(prop, "Color Grid", "Smoke color grid"); prop = RNA_def_property(srna, "heat_grid", PROP_FLOAT, PROP_NONE); RNA_def_property_array(prop, 32); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_dynamic_array_funcs(prop, "rna_SmokeModifier_heat_grid_get_length"); RNA_def_property_float_funcs(prop, "rna_SmokeModifier_heat_grid_get", NULL, NULL); RNA_def_property_ui_text(prop, "Heat Grid", "Smoke heat grid"); prop = RNA_def_property(srna, "cell_size", PROP_FLOAT, PROP_XYZ); /* can change each frame when using adaptive domain */ RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "cell_size", "Cell Size"); prop = RNA_def_property(srna, "start_point", PROP_FLOAT, PROP_XYZ); /* can change each frame when using adaptive domain */ RNA_def_property_float_sdna(prop, NULL, "p0"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "p0", "Start point"); prop = RNA_def_property(srna, "domain_resolution", PROP_INT, PROP_XYZ); /* can change each frame when using adaptive domain */ RNA_def_property_int_sdna(prop, NULL, "res"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "res", "Smoke Grid Resolution"); prop = RNA_def_property(srna, "burning_rate", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 4.0); RNA_def_property_ui_range(prop, 0.01, 2.0, 1.0, 5); RNA_def_property_ui_text(prop, "Speed", "Speed of the burning reaction (use larger values for smaller flame)"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "flame_smoke", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 8.0); RNA_def_property_ui_range(prop, 0.0, 4.0, 1.0, 5); RNA_def_property_ui_text(prop, "Smoke", "Amount of smoke created by burning fuel"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "flame_vorticity", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 2.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 1.0, 5); RNA_def_property_ui_text(prop, "Vorticity", "Additional vorticity for the flames"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "flame_ignition", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.5, 5.0); RNA_def_property_ui_range(prop, 0.5, 2.5, 1.0, 5); RNA_def_property_ui_text(prop, "Ignition", "Minimum temperature of flames"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "flame_max_temp", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 1.0, 10.0); RNA_def_property_ui_range(prop, 1.0, 5.0, 1.0, 5); RNA_def_property_ui_text(prop, "Maximum", "Maximum temperature of flames"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "flame_smoke_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Smoke Color", "Color of smoke emitted from burning fuel"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "use_adaptive_domain", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_ADAPTIVE_DOMAIN); RNA_def_property_ui_text(prop, "Adaptive Domain", "Adapt simulation resolution and size to fluid"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "additional_res", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "adapt_res"); RNA_def_property_range(prop, 0, 512); RNA_def_property_ui_range(prop, 0, 512, 2, -1); RNA_def_property_ui_text(prop, "Additional", "Maximum number of additional cells"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "adapt_margin", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "adapt_margin"); RNA_def_property_range(prop, 2, 24); RNA_def_property_ui_range(prop, 2, 24, 2, -1); RNA_def_property_ui_text(prop, "Margin", "Margin added around fluid to minimize boundary interference"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "adapt_threshold", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 0.5); RNA_def_property_ui_range(prop, 0.01, 0.5, 1.0, 5); RNA_def_property_ui_text(prop, "Threshold", "Maximum amount of fluid cell can contain before it is considered empty"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); prop = RNA_def_property(srna, "cache_file_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "cache_file_format"); RNA_def_property_enum_items(prop, cache_file_type_items); RNA_def_property_enum_funcs(prop, NULL, "rna_Smoke_cachetype_set", NULL); RNA_def_property_ui_text(prop, "File Format", "Select the file format to be used for caching"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_resetCache"); }
void RNA_api_object(StructRNA *srna) { FunctionRNA *func; PropertyRNA *parm; static EnumPropertyItem mesh_type_items[] = { {eModifierMode_Realtime, "PREVIEW", 0, "Preview", "Apply modifier preview settings"}, {eModifierMode_Render, "RENDER", 0, "Render", "Apply modifier render settings"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem dupli_eval_mode_items[] = { {DAG_EVAL_VIEWPORT, "VIEWPORT", 0, "Viewport", "Generate duplis using viewport settings"}, {DAG_EVAL_PREVIEW, "PREVIEW", 0, "Preview", "Generate duplis using preview settings"}, {DAG_EVAL_RENDER, "RENDER", 0, "Render", "Generate duplis using render settings"}, {0, NULL, 0, NULL, NULL} }; #ifndef NDEBUG static EnumPropertyItem mesh_dm_info_items[] = { {0, "SOURCE", 0, "Source", "Source mesh"}, {1, "DEFORM", 0, "Deform", "Objects deform mesh"}, {2, "FINAL", 0, "Final", "Objects final mesh"}, {0, NULL, 0, NULL, NULL} }; #endif /* Matrix space conversion */ func = RNA_def_function(srna, "convert_space", "rna_Scene_mat_convert_space"); RNA_def_function_ui_description(func, "Convert (transform) the given matrix from one space to another"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "pose_bone", "PoseBone", "", "Bone to use to define spaces (may be None, in which case only the two 'WORLD' and " "'LOCAL' spaces are usable)"); parm = RNA_def_property(func, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(parm, "", "The matrix to transform"); parm = RNA_def_property(func, "matrix_return", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(parm, "", "The transformed matrix"); RNA_def_function_output(func, parm); parm = RNA_def_enum(func, "from_space", space_items, CONSTRAINT_SPACE_WORLD, "", "The space in which 'matrix' is currently"); parm = RNA_def_enum(func, "to_space", space_items, CONSTRAINT_SPACE_WORLD, "", "The space to which you want to transform 'matrix'"); /* Camera-related operations */ func = RNA_def_function(srna, "calc_matrix_camera", "rna_Object_calc_matrix_camera"); RNA_def_function_ui_description(func, "Generate the camera projection matrix of this object " "(mostly useful for Camera and Lamp types)"); parm = RNA_def_property(func, "result", PROP_FLOAT, PROP_MATRIX); RNA_def_property_multi_array(parm, 2, rna_matrix_dimsize_4x4); RNA_def_property_ui_text(parm, "", "The camera projection matrix"); RNA_def_function_output(func, parm); parm = RNA_def_int(func, "x", 1, 0, INT_MAX, "", "Width of the render area", 0, 10000); parm = RNA_def_int(func, "y", 1, 0, INT_MAX, "", "Height of the render area", 0, 10000); parm = RNA_def_float(func, "scale_x", 1.0f, 1.0e-6f, FLT_MAX, "", "Width scaling factor", 1.0e-2f, 100.0f); parm = RNA_def_float(func, "scale_y", 1.0f, 1.0e-6f, FLT_MAX, "", "height scaling factor", 1.0e-2f, 100.0f); func = RNA_def_function(srna, "camera_fit_coords", "rna_Object_camera_fit_coords"); RNA_def_function_ui_description(func, "Compute the coordinate (and scale for ortho cameras) " "given object should be to 'see' all given coordinates"); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene to get render size information from, if available"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_float_array(func, "coordinates", 1, NULL, -FLT_MAX, FLT_MAX, "", "Coordinates to fit in", -FLT_MAX, FLT_MAX); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_DYNAMIC); parm = RNA_def_property(func, "co_return", PROP_FLOAT, PROP_XYZ); RNA_def_property_array(parm, 3); RNA_def_property_ui_text(parm, "", "The location to aim to be able to see all given points"); RNA_def_property_flag(parm, PROP_OUTPUT); parm = RNA_def_property(func, "scale_return", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_text(parm, "", "The ortho scale to aim to be able to see all given points (if relevant)"); RNA_def_property_flag(parm, PROP_OUTPUT); /* mesh */ func = RNA_def_function(srna, "to_mesh", "rna_Object_to_mesh"); RNA_def_function_ui_description(func, "Create a Mesh datablock with modifiers applied"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate modifiers"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_boolean(func, "apply_modifiers", 0, "", "Apply modifiers"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); RNA_def_boolean(func, "calc_tessface", true, "Calculate Tessellation", "Calculate tessellation faces"); RNA_def_boolean(func, "calc_undeformed", false, "Calculate Undeformed", "Calculate undeformed vertex coordinates"); parm = RNA_def_pointer(func, "mesh", "Mesh", "", "Mesh created from object, remove it if it is only used for export"); RNA_def_function_return(func, parm); /* duplis */ func = RNA_def_function(srna, "dupli_list_create", "rna_Object_create_duplilist"); RNA_def_function_ui_description(func, "Create a list of dupli objects for this object, needs to " "be freed manually with free_dupli_list to restore the " "objects real matrix and layers"); parm = RNA_def_pointer(func, "scene", "Scene", "", "Scene within which to evaluate duplis"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); RNA_def_enum(func, "settings", dupli_eval_mode_items, 0, "", "Generate texture coordinates for rendering"); RNA_def_function_flag(func, FUNC_USE_REPORTS); func = RNA_def_function(srna, "dupli_list_clear", "rna_Object_free_duplilist"); RNA_def_function_ui_description(func, "Free the list of dupli objects"); /* Armature */ func = RNA_def_function(srna, "find_armature", "modifiers_isDeformedByArmature"); RNA_def_function_ui_description(func, "Find armature influencing this object as a parent or via a modifier"); parm = RNA_def_pointer(func, "ob_arm", "Object", "", "Armature object influencing this object or NULL"); RNA_def_function_return(func, parm); /* Shape key */ func = RNA_def_function(srna, "shape_key_add", "rna_Object_shape_key_add"); RNA_def_function_ui_description(func, "Add shape key to this object"); RNA_def_function_flag(func, FUNC_USE_CONTEXT | FUNC_USE_REPORTS); RNA_def_string(func, "name", "Key", 0, "", "Unique name for the new keyblock"); /* optional */ RNA_def_boolean(func, "from_mix", 1, "", "Create new shape from existing mix of shapes"); parm = RNA_def_pointer(func, "key", "ShapeKey", "", "New shape keyblock"); RNA_def_property_flag(parm, PROP_RNAPTR); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "shape_key_remove", "rna_Object_shape_key_remove"); RNA_def_function_ui_description(func, "Remove a Shape Key from this object"); RNA_def_function_flag(func, FUNC_USE_MAIN | FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "key", "ShapeKey", "", "Keyblock to be removed"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); /* Ray Cast */ func = RNA_def_function(srna, "ray_cast", "rna_Object_ray_cast"); RNA_def_function_ui_description(func, "Cast a ray onto in object space"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* ray start and end */ parm = RNA_def_float_vector(func, "start", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_float_vector(func, "end", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); RNA_def_property_flag(parm, PROP_REQUIRED); /* return location and normal */ parm = RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The hit location of this ray cast", -1e4, 1e4); RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_function_output(func, parm); parm = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the ray cast hit location", -1e4, 1e4); RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_function_output(func, parm); parm = RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no intersection is found", 0, 0); RNA_def_function_output(func, parm); /* Nearest Point */ func = RNA_def_function(srna, "closest_point_on_mesh", "rna_Object_closest_point_on_mesh"); RNA_def_function_ui_description(func, "Find the nearest point in object space"); RNA_def_function_flag(func, FUNC_USE_REPORTS); /* location of point for test and max distance */ parm = RNA_def_float_vector(func, "point", 3, NULL, -FLT_MAX, FLT_MAX, "", "", -1e4, 1e4); RNA_def_property_flag(parm, PROP_REQUIRED); /* default is sqrt(FLT_MAX) */ RNA_def_float(func, "max_dist", 1.844674352395373e+19, 0.0, FLT_MAX, "", "", 0.0, FLT_MAX); /* return location and normal */ parm = RNA_def_float_vector(func, "location", 3, NULL, -FLT_MAX, FLT_MAX, "Location", "The location on the object closest to the point", -1e4, 1e4); RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_function_output(func, parm); parm = RNA_def_float_vector(func, "normal", 3, NULL, -FLT_MAX, FLT_MAX, "Normal", "The face normal at the closest point", -1e4, 1e4); RNA_def_property_flag(parm, PROP_THICK_WRAP); RNA_def_function_output(func, parm); parm = RNA_def_int(func, "index", 0, 0, 0, "", "The face index, -1 when no closest point is found", 0, 0); RNA_def_function_output(func, parm); /* View */ func = RNA_def_function(srna, "is_visible", "rna_Object_is_visible"); RNA_def_function_ui_description(func, "Determine if object is visible in a given scene"); parm = RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility"); RNA_def_function_return(func, parm); /* utility function for checking if the object is modified */ func = RNA_def_function(srna, "is_modified", "rna_Object_is_modified"); RNA_def_function_ui_description(func, "Determine if this object is modified from the base mesh data"); parm = RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "is_deform_modified", "rna_Object_is_deform_modified"); RNA_def_function_ui_description(func, "Determine if this object is modified by a deformation from the base mesh data"); parm = RNA_def_pointer(func, "scene", "Scene", "", ""); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL); parm = RNA_def_enum(func, "settings", mesh_type_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); parm = RNA_def_boolean(func, "result", 0, "", "Object visibility"); RNA_def_function_return(func, parm); #ifndef NDEBUG /* mesh */ func = RNA_def_function(srna, "dm_info", "rna_Object_dm_info"); RNA_def_function_ui_description(func, "Returns a string for derived mesh data"); parm = RNA_def_enum(func, "type", mesh_dm_info_items, 0, "", "Modifier settings to apply"); RNA_def_property_flag(parm, PROP_REQUIRED); /* weak!, no way to return dynamic string type */ parm = RNA_def_string(func, "result", NULL, 16384, "result", ""); RNA_def_property_flag(parm, PROP_THICK_WRAP); /* needed for string return value */ RNA_def_function_output(func, parm); #endif /* NDEBUG */ func = RNA_def_function(srna, "update_from_editmode", "rna_Object_update_from_editmode"); RNA_def_function_ui_description(func, "Load the objects edit-mode data intp the object data"); parm = RNA_def_boolean(func, "result", 0, "", "Success"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "cache_release", "BKE_object_free_caches"); RNA_def_function_ui_description(func, "Release memory used by caches associated with this object. Intended to be used by render engines only"); }
static void rna_def_layer_collection(BlenderRNA *brna) { StructRNA *srna; FunctionRNA *func; PropertyRNA *prop; srna = RNA_def_struct(brna, "LayerCollection", NULL); RNA_def_struct_ui_text(srna, "Layer Collection", "Layer collection"); RNA_def_struct_ui_icon(srna, ICON_GROUP); prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE); RNA_def_property_struct_type(prop, "Collection"); RNA_def_property_ui_text(prop, "Collection", "Collection this layer collection is wrapping"); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "collection->id.name"); RNA_def_property_clear_flag(prop, PROP_EDITABLE | PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Name", "Name of this view layer (same as its collection one)"); RNA_def_property_string_funcs( prop, "rna_LayerCollection_name_get", "rna_LayerCollection_name_length", NULL); RNA_def_struct_name_property(srna, prop); prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "layer_collections", NULL); RNA_def_property_struct_type(prop, "LayerCollection"); RNA_def_property_ui_text(prop, "Children", "Child layer collections"); /* Restriction flags. */ prop = RNA_def_property(srna, "exclude", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_EXCLUDE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Exclude from View Layer", "Exclude from view layer"); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, -1); RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_exclude_update"); prop = RNA_def_property(srna, "holdout", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_HOLDOUT); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_icon(prop, ICON_HOLDOUT_OFF, 1); RNA_def_property_ui_text(prop, "Holdout", "Mask out objects in collection from view layer"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update"); prop = RNA_def_property(srna, "indirect_only", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_INDIRECT_ONLY); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_icon(prop, ICON_INDIRECT_ONLY_OFF, 1); RNA_def_property_ui_text( prop, "Indirect Only", "Objects in collection only contribute indirectly (through shadows and reflections) " "in the view layer"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update"); prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LAYER_COLLECTION_HIDE); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_STATIC); RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1); RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_update"); /* Run-time flags. */ prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "runtime_flag", LAYER_COLLECTION_VISIBLE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text( prop, "Visible", "Whether this collection is visible, take into account the collection parent"); func = RNA_def_function(srna, "has_objects", "rna_LayerCollection_has_objects"); RNA_def_function_ui_description(func, ""); RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", "")); func = RNA_def_function( srna, "has_selected_objects", "rna_LayerCollection_has_selected_objects"); RNA_def_function_ui_description(func, ""); prop = RNA_def_pointer( func, "view_layer", "ViewLayer", "", "ViewLayer the layer collection belongs to"); RNA_def_parameter_flags(prop, 0, PARM_REQUIRED); RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", "")); }
static void rna_def_maskSpline(BlenderRNA *brna) { static EnumPropertyItem spline_interpolation_items[] = { {MASK_SPLINE_INTERP_LINEAR, "LINEAR", 0, "Linear", ""}, {MASK_SPLINE_INTERP_EASE, "EASE", 0, "Ease", ""}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem spline_offset_mode_items[] = { {MASK_SPLINE_OFFSET_EVEN, "EVEN", 0, "Even", "Calculate even feather offset"}, {MASK_SPLINE_OFFSET_SMOOTH, "SMOOTH", 0, "Smooth", "Calculate feather offset as a second curve"}, {0, NULL, 0, NULL, NULL} }; StructRNA *srna; PropertyRNA *prop; rna_def_maskSplinePoint(brna); srna = RNA_def_struct(brna, "MaskSpline", NULL); RNA_def_struct_ui_text(srna, "Mask spline", "Single spline used for defining mask shape"); /* offset mode */ prop = RNA_def_property(srna, "offset_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "offset_mode"); RNA_def_property_enum_items(prop, spline_offset_mode_items); RNA_def_property_ui_text(prop, "Feather Offset", "The method used for calculating the feather offset"); RNA_def_property_update(prop, 0, "rna_Mask_update_data"); /* weight interpolation */ prop = RNA_def_property(srna, "weight_interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "weight_interp"); RNA_def_property_enum_items(prop, spline_interpolation_items); RNA_def_property_ui_text(prop, "Weight Interpolation", "The type of weight interpolation for spline"); RNA_def_property_update(prop, 0, "rna_Mask_update_data"); /* cyclic */ prop = RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_SPLINE_CYCLIC); RNA_def_property_ui_text(prop, "Cyclic", "Make this spline a closed loop"); RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data"); /* fill */ prop = RNA_def_property(srna, "use_fill", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", MASK_SPLINE_NOFILL); RNA_def_property_ui_text(prop, "Fill", "Make this spline filled"); RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data"); /* self-intersection check */ prop = RNA_def_property(srna, "use_self_intersection_check", PROP_BOOLEAN, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_SPLINE_NOINTERSECT); RNA_def_property_ui_text(prop, "Self Intersection Check", "Prevent feather from self-intersections"); RNA_def_property_update(prop, NC_MASK | NA_EDITED, "rna_Mask_update_data"); prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "MaskSplinePoint"); RNA_def_property_collection_sdna(prop, NULL, "points", "tot_point"); RNA_def_property_ui_text(prop, "Points", "Collection of points"); RNA_def_property_srna(prop, "MaskSplinePoints"); }
static void rna_def_particle_edit(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem select_mode_items[] = { {SCE_SELECT_PATH, "PATH", ICON_PARTICLE_PATH, "Path", "Path edit mode"}, {SCE_SELECT_POINT, "POINT", ICON_PARTICLE_POINT, "Point", "Point select mode"}, {SCE_SELECT_END, "TIP", ICON_PARTICLE_TIP, "Tip", "Tip select mode"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem puff_mode[] = { {0, "ADD", 0, "Add", "Make hairs more puffy"}, {1, "SUB", 0, "Sub", "Make hairs less puffy"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem length_mode[] = { {0, "GROW", 0, "Grow", "Make hairs longer"}, {1, "SHRINK", 0, "Shrink", "Make hairs shorter"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem edit_type_items[] = { {PE_TYPE_PARTICLES, "PARTICLES", 0, "Particles", ""}, {PE_TYPE_SOFTBODY, "SOFT_BODY", 0, "Soft body", ""}, {PE_TYPE_CLOTH, "CLOTH", 0, "Cloth", ""}, {0, NULL, 0, NULL, NULL} }; /* edit */ srna = RNA_def_struct(brna, "ParticleEdit", NULL); RNA_def_struct_sdna(srna, "ParticleEditSettings"); RNA_def_struct_path_func(srna, "rna_ParticleEdit_path"); RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode"); prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "brushtype"); RNA_def_property_enum_items(prop, particle_edit_hair_brush_items); RNA_def_property_enum_funcs(prop, NULL, "rna_ParticleEdit_tool_set", "rna_ParticleEdit_tool_itemf"); RNA_def_property_ui_text(prop, "Tool", ""); prop = RNA_def_property(srna, "select_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "selectmode"); RNA_def_property_enum_items(prop, select_mode_items); RNA_def_property_ui_text(prop, "Selection Mode", "Particle select and display mode"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update"); prop = RNA_def_property(srna, "use_preserve_length", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_KEEP_LENGTHS); RNA_def_property_ui_text(prop, "Keep Lengths", "Keep path lengths constant"); prop = RNA_def_property(srna, "use_preserve_root", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_LOCK_FIRST); RNA_def_property_ui_text(prop, "Keep Root", "Keep root keys unmodified"); prop = RNA_def_property(srna, "use_emitter_deflect", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DEFLECT_EMITTER); RNA_def_property_ui_text(prop, "Deflect Emitter", "Keep paths from intersecting the emitter"); prop = RNA_def_property(srna, "emitter_distance", PROP_FLOAT, PROP_UNSIGNED); RNA_def_property_float_sdna(prop, NULL, "emitterdist"); RNA_def_property_ui_range(prop, 0.0f, 10.0f, 10, 3); RNA_def_property_ui_text(prop, "Emitter Distance", "Distance to keep particles away from the emitter"); prop = RNA_def_property(srna, "use_fade_time", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_FADE_TIME); RNA_def_property_ui_text(prop, "Fade Time", "Fade paths and keys further away from current frame"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update"); prop = RNA_def_property(srna, "use_auto_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_AUTO_VELOCITY); RNA_def_property_ui_text(prop, "Auto Velocity", "Calculate point velocities automatically"); prop = RNA_def_property(srna, "show_particles", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_DRAW_PART); RNA_def_property_ui_text(prop, "Draw Particles", "Draw actual particles"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo"); prop = RNA_def_property(srna, "use_default_interpolate", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_INTERPOLATE_ADDED); RNA_def_property_ui_text(prop, "Interpolate", "Interpolate new particles from the existing ones"); prop = RNA_def_property(srna, "default_key_count", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "totaddkey"); RNA_def_property_range(prop, 2, SHRT_MAX); RNA_def_property_ui_range(prop, 2, 20, 10, 3); RNA_def_property_ui_text(prop, "Keys", "How many keys to make new particles with"); 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, NULL); RNA_def_property_ui_text(prop, "Brush", ""); prop = RNA_def_property(srna, "draw_step", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Steps", "How many steps to draw the path with"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo"); prop = RNA_def_property(srna, "fade_frames", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_text(prop, "Frames", "How many frames to fade"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_update"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "edittype"); RNA_def_property_enum_items(prop, edit_type_items); RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ParticleEdit_redo"); prop = RNA_def_property(srna, "is_editable", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_editable_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Editable", "A valid edit mode exists"); prop = RNA_def_property(srna, "is_hair", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_ParticleEdit_hair_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Hair", "Editing hair"); prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Object", "The edited object"); /* brush */ srna = RNA_def_struct(brna, "ParticleBrush", NULL); RNA_def_struct_sdna(srna, "ParticleBrushData"); RNA_def_struct_path_func(srna, "rna_ParticleBrush_path"); RNA_def_struct_ui_text(srna, "Particle Brush", "Particle editing brush"); prop = RNA_def_property(srna, "size", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 100, 10, 3); RNA_def_property_ui_text(prop, "Radius", "Radius of the brush in pixels"); prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, 0.001, 1.0); RNA_def_property_ui_text(prop, "Strength", "Brush strength"); prop = RNA_def_property(srna, "count", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 1000); RNA_def_property_ui_range(prop, 1, 100, 10, 3); RNA_def_property_ui_text(prop, "Count", "Particle count"); prop = RNA_def_property(srna, "steps", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "step"); RNA_def_property_range(prop, 1, SHRT_MAX); RNA_def_property_ui_range(prop, 1, 50, 10, 3); RNA_def_property_ui_text(prop, "Steps", "Brush steps"); prop = RNA_def_property(srna, "puff_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "invert"); RNA_def_property_enum_items(prop, puff_mode); RNA_def_property_ui_text(prop, "Puff Mode", ""); prop = RNA_def_property(srna, "use_puff_volume", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", PE_BRUSH_DATA_PUFF_VOLUME); RNA_def_property_ui_text(prop, "Puff Volume", "Apply puff to unselected end-points (helps maintain hair volume when puffing root)"); prop = RNA_def_property(srna, "length_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "invert"); RNA_def_property_enum_items(prop, length_mode); RNA_def_property_ui_text(prop, "Length Mode", ""); /* 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, NULL); RNA_def_property_ui_text(prop, "Curve", ""); }
/* err... bones should not be directly edited (only editbones should be...) */ static void rna_def_bone(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "Bone", NULL); RNA_def_struct_ui_text(srna, "Bone", "Bone in an Armature datablock"); RNA_def_struct_ui_icon(srna, ICON_BONE_DATA); RNA_def_struct_path_func(srna, "rna_Bone_path"); RNA_def_struct_idprops_func(srna, "rna_Bone_idprops"); /* pointers/collections */ /* parent (pointer) */ prop = RNA_def_property(srna, "parent", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_pointer_sdna(prop, NULL, "parent"); RNA_def_property_ui_text(prop, "Parent", "Parent bone (in same Armature)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* children (collection) */ prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "childbase", NULL); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_ui_text(prop, "Children", "Bones which are children of this bone"); rna_def_bone_common(srna, 0); /* XXX should we define this in PoseChannel wrapping code instead? * But PoseChannels directly get some of their flags from here... */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BONE_HIDDEN_P); RNA_def_property_ui_text(prop, "Hide", "Bone is not visible when it is not in Edit Mode (i.e. in Object or Pose Modes)"); 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); /* XXX: review whether this could be used for interesting effects... */ RNA_def_property_update(prop, 0, "rna_Bone_select_update"); 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, "Select Head", ""); 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, "Select Tail", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* XXX better matrix descriptions possible (Arystan) */ prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "bone_mat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_3x3); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Bone Matrix", "3x3 bone matrix"); prop = RNA_def_property(srna, "matrix_local", PROP_FLOAT, PROP_MATRIX); RNA_def_property_float_sdna(prop, NULL, "arm_mat"); RNA_def_property_multi_array(prop, 2, rna_matrix_dimsize_4x4); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Bone Armature-Relative Matrix", "4x4 bone matrix relative to armature"); 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_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Tail", "Location of tail end of the bone"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); prop = RNA_def_property(srna, "tail_local", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "arm_tail"); RNA_def_property_array(prop, 3); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Armature-Relative Tail", "Location of tail end of the bone relative to armature"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); 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_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Head", "Location of head end of the bone relative to its parent"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); prop = RNA_def_property(srna, "head_local", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "arm_head"); RNA_def_property_array(prop, 3); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Armature-Relative Head", "Location of head end of the bone relative to armature"); RNA_def_property_ui_range(prop, -FLT_MAX, FLT_MAX, 1, RNA_TRANSLATION_PREC_DEFAULT); RNA_api_bone(srna); }
static void rna_def_keyblock(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "ShapeKey", NULL); RNA_def_struct_ui_text(srna, "Shape Key", "Shape key in a shape keys datablock"); RNA_def_struct_sdna(srna, "KeyBlock"); RNA_def_struct_path_func(srna, "rna_ShapeKey_path"); RNA_def_struct_ui_icon(srna, ICON_SHAPEKEY_DATA); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Name of Shape Key"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_ShapeKey_name_set"); RNA_def_struct_name_property(srna, prop); /* keys need to be sorted to edit this */ prop = RNA_def_property(srna, "frame", PROP_FLOAT, PROP_TIME); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_ui_text(prop, "Frame", "Frame for absolute keys"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); /* for now, this is editable directly, as users can set this even if they're not animating them * (to test results) */ prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "curval"); RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_value_set", "rna_ShapeKey_value_range"); RNA_def_property_ui_range(prop, -10.0f, 10.0f, 10, 3); RNA_def_property_ui_text(prop, "Value", "Value of shape key at the current frame"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, keyblock_type_items); RNA_def_property_ui_text(prop, "Interpolation", "Interpolation type for absolute shape keys"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "vgroup"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex weight group, to blend with basis shape"); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop = RNA_def_property(srna, "relative_key", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "ShapeKey"); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_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"); prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYBLOCK_MUTE); RNA_def_property_ui_text(prop, "Mute", "Mute this shape key"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop = RNA_def_property(srna, "slider_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "slidermin"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_min_set", "rna_ShapeKey_slider_min_range"); RNA_def_property_ui_text(prop, "Slider Min", "Minimum for slider"); prop = RNA_def_property(srna, "slider_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "slidermax"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ShapeKey_slider_max_set", "rna_ShapeKey_slider_max_range"); RNA_def_property_ui_text(prop, "Slider Max", "Maximum for slider"); prop = RNA_def_property(srna, "data", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "data", "totelem"); RNA_def_property_struct_type(prop, "UnknownType"); RNA_def_property_ui_text(prop, "Data", ""); RNA_def_property_collection_funcs(prop, "rna_ShapeKey_data_begin", NULL, NULL, "rna_ShapeKey_data_get", "rna_ShapeKey_data_length", NULL, NULL, NULL); }
static void rna_def_armature(BlenderRNA *brna) { StructRNA *srna; FunctionRNA *func; PropertyRNA *prop; static EnumPropertyItem prop_drawtype_items[] = { {ARM_OCTA, "OCTAHEDRAL", 0, "Octahedral", "Display bones as octahedral shape (default)"}, {ARM_LINE, "STICK", 0, "Stick", "Display bones as simple 2D lines with dots"}, {ARM_B_BONE, "BBONE", 0, "B-Bone", "Display bones as boxes, showing subdivision and B-Splines"}, {ARM_ENVELOPE, "ENVELOPE", 0, "Envelope", "Display bones as extruded spheres, showing deformation influence volume"}, {ARM_WIRE, "WIRE", 0, "Wire", "Display bones as thin wires, showing subdivision and B-Splines"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem prop_vdeformer[] = { {ARM_VDEF_BLENDER, "BLENDER", 0, "Blender", "Use Blender's armature vertex deformation"}, {ARM_VDEF_BGE_CPU, "BGE_CPU", 0, "BGE", "Use vertex deformation code optimized for the BGE"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem prop_ghost_type_items[] = { {ARM_GHOST_CUR, "CURRENT_FRAME", 0, "Around Frame", "Display Ghosts of poses within a fixed number of frames around the current frame"}, {ARM_GHOST_RANGE, "RANGE", 0, "In Range", "Display Ghosts of poses within specified range"}, {ARM_GHOST_KEYS, "KEYS", 0, "On Keyframes", "Display Ghosts of poses on Keyframes"}, {0, NULL, 0, NULL, NULL} }; static const EnumPropertyItem prop_pose_position_items[] = { {0, "POSE", 0, "Pose Position", "Show armature in posed state"}, {ARM_RESTPOS, "REST", 0, "Rest Position", "Show Armature in binding pose state (no posing possible)"}, {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "Armature", "ID"); RNA_def_struct_ui_text(srna, "Armature", "Armature datablock containing a hierarchy of bones, usually used for rigging characters"); RNA_def_struct_ui_icon(srna, ICON_ARMATURE_DATA); RNA_def_struct_sdna(srna, "bArmature"); func = RNA_def_function(srna, "transform", "rna_Armature_transform"); RNA_def_function_ui_description(func, "Transform armature bones by a matrix"); prop = RNA_def_float_matrix(func, "matrix", 4, 4, NULL, 0.0f, 0.0f, "", "Matrix", 0.0f, 0.0f); RNA_def_property_flag(prop, PROP_REQUIRED); /* Animation Data */ rna_def_animdata_common(srna); /* Collections */ prop = RNA_def_property(srna, "bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "bonebase", NULL); RNA_def_property_collection_funcs(prop, NULL, "rna_Armature_bones_next", NULL, NULL, NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "Bone"); RNA_def_property_ui_text(prop, "Bones", ""); rna_def_armature_bones(brna, prop); prop = RNA_def_property(srna, "edit_bones", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "edbo", NULL); RNA_def_property_struct_type(prop, "EditBone"); RNA_def_property_ui_text(prop, "Edit Bones", ""); rna_def_armature_edit_bones(brna, prop); /* Enum values */ prop = RNA_def_property(srna, "pose_position", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "flag"); RNA_def_property_enum_items(prop, prop_pose_position_items); RNA_def_property_ui_text(prop, "Pose Position", "Show armature in binding pose or final posed state"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "draw_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "drawtype"); RNA_def_property_enum_items(prop, prop_drawtype_items); RNA_def_property_ui_text(prop, "Draw Type", ""); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "gevertdeformer"); RNA_def_property_enum_items(prop, prop_vdeformer); RNA_def_property_ui_text(prop, "Vertex Deformer", "Vertex Deformer Method (Game Engine only)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); /* XXX deprecated ....... old animviz for armatures only */ prop = RNA_def_property(srna, "ghost_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ghosttype"); RNA_def_property_enum_items(prop, prop_ghost_type_items); RNA_def_property_ui_text(prop, "Ghost Type", "Method of Onion-skinning for active Action"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); /* XXX deprecated ....... old animviz for armatures only */ /* Boolean values */ /* layer */ prop = RNA_def_property(srna, "layers", PROP_BOOLEAN, PROP_LAYER_MEMBER); RNA_def_property_boolean_sdna(prop, NULL, "layer", 1); RNA_def_property_array(prop, 32); RNA_def_property_ui_text(prop, "Visible Layers", "Armature layer visibility"); RNA_def_property_boolean_funcs(prop, NULL, "rna_Armature_layer_set"); RNA_def_property_update(prop, NC_OBJECT | ND_POSE, "rna_Armature_update_layers"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); /* layer protection */ prop = RNA_def_property(srna, "layers_protected", PROP_BOOLEAN, PROP_LAYER); RNA_def_property_boolean_sdna(prop, NULL, "layer_protected", 1); RNA_def_property_array(prop, 32); RNA_def_property_ui_text(prop, "Layer Proxy Protection", "Protected layers in Proxy Instances are restored to Proxy settings " "on file reload and undo"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* flag */ prop = RNA_def_property(srna, "show_axes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWAXES); RNA_def_property_ui_text(prop, "Draw Axes", "Draw bone axes"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "show_names", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DRAWNAMES); RNA_def_property_ui_text(prop, "Draw Names", "Draw bone names"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "use_deform_delay", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_DELAYDEFORM); RNA_def_property_ui_text(prop, "Delay Deform", "Don't deform children when manipulating bones in Pose Mode"); RNA_def_property_update(prop, 0, "rna_Armature_update_data"); prop = RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_MIRROR_EDIT); RNA_def_property_ui_text(prop, "X-Axis Mirror", "Apply changes to matching bone on opposite side of X-Axis"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "use_auto_ik", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_AUTO_IK); RNA_def_property_ui_text(prop, "Auto IK", "Add temporary IK constraints while grabbing bones in Pose Mode"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "show_bone_custom_shapes", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", ARM_NO_CUSTOM); RNA_def_property_ui_text(prop, "Draw Custom Bone Shapes", "Draw bones with their custom shapes"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); prop = RNA_def_property(srna, "show_group_colors", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_COL_CUSTOM); RNA_def_property_ui_text(prop, "Draw Bone Group Colors", "Draw bone group colors"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); /* XXX deprecated ....... old animviz for armatures only */ prop = RNA_def_property(srna, "show_only_ghost_selected", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ARM_GHOST_ONLYSEL); RNA_def_property_ui_text(prop, "Draw Ghosts on Selected Bones Only", ""); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); /* XXX deprecated ....... old animviz for armatures only */ /* Number fields */ /* XXX deprecated ....... old animviz for armatures only */ /* ghost/onionskining settings */ prop = RNA_def_property(srna, "ghost_step", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostep"); RNA_def_property_range(prop, 0, 30); RNA_def_property_ui_text(prop, "Ghosting Step", "Number of frame steps on either side of current frame to show as ghosts " "(only for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "ghost_size", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "ghostsize"); RNA_def_property_range(prop, 1, 20); RNA_def_property_ui_text(prop, "Ghosting Frame Step", "Frame step for Ghosts (not for 'On Keyframes' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "ghost_frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghostsf"); RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_start_frame_set", NULL); RNA_def_property_ui_text(prop, "Ghosting Start Frame", "Starting frame of range of Ghosts to display (not for " "'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); prop = RNA_def_property(srna, "ghost_frame_end", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "ghostef"); RNA_def_property_int_funcs(prop, NULL, "rna_Armature_ghost_end_frame_set", NULL); RNA_def_property_ui_text(prop, "Ghosting End Frame", "End frame of range of Ghosts to display " "(not for 'Around Current Frame' Onion-skinning method)"); RNA_def_property_update(prop, 0, "rna_Armature_redraw_data"); RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); /* XXX deprecated ....... old animviz for armatures only */ prop = RNA_def_property(srna, "is_editmode", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_funcs(prop, "rna_Armature_is_editmode_get", NULL); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Is Editmode", "True when used in editmode"); }
static void rna_def_py_component_property(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem empty_items[] = { {0, "EMPTY", 0, "Empty", ""}, {0, NULL, 0, NULL, NULL} }; /* Base Python Component Property */ srna = RNA_def_struct(brna, "PythonComponentProperty", NULL); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Property", "A property of a Python Component"); RNA_def_struct_refine_func(srna, "rna_PythonComponentProperty_refine"); prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_ui_text(prop, "Name", ""); RNA_def_struct_name_property(srna, prop); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Boolean */ srna = RNA_def_struct(brna, "ComponentBooleanProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Boolean Property", "A boolean property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "boolval", 1); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Int */ srna = RNA_def_struct(brna, "ComponentIntProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Integer Property", "An integer property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "intval"); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Float */ srna = RNA_def_struct(brna, "ComponentFloatProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Float Property", "A float property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "floatval"); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* String */ srna = RNA_def_struct(brna, "ComponentStringProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component String Property", "A string property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "strval"); RNA_def_property_string_maxlength(prop, MAX_PROPSTRING); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Set */ srna = RNA_def_struct(brna, "ComponentSetProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Set Property", "A set property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, empty_items); RNA_def_property_enum_funcs(prop, "rna_ComponentSetProperty_get", "rna_ComponentSetProperty_set", "rna_ComponentSetProperty_itemf"); RNA_def_property_enum_default(prop, 0); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Vector 2D */ srna = RNA_def_struct(brna, "ComponentVector2DProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Vector 2D Property", "A 2D vector property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_COORDS); RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 2); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Vector 3D */ srna = RNA_def_struct(brna, "ComponentVector3DProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Vector 3D Property", "A 3D vector property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_COORDS); RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); /* Vector 4D */ srna = RNA_def_struct(brna, "ComponentVector4DProperty", "PythonComponentProperty"); RNA_def_struct_sdna(srna, "PythonComponentProperty"); RNA_def_struct_ui_text(srna, "Python Component Vector 4D Property", "A 4D vector property of a Python Component"); prop = RNA_def_property(srna, "value", PROP_FLOAT, PROP_COORDS); RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Value", "Property value"); RNA_def_property_update(prop, NC_LOGIC, NULL); }
static void rna_def_lamp(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "Lamp", "ID"); RNA_def_struct_refine_func(srna, "rna_Lamp_refine"); RNA_def_struct_ui_text(srna, "Lamp", "Lamp data-block for lighting a scene"); RNA_def_struct_ui_icon(srna, ICON_LAMP_DATA); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, rna_enum_lamp_type_items); RNA_def_property_ui_text(prop, "Type", "Type of Lamp"); RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_LAMP); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_range(prop, 0, INT_MAX); RNA_def_property_ui_range(prop, 0, 1000, 1, 3); RNA_def_property_ui_text(prop, "Distance", "Falloff distance - the light is at half the original intensity at this point"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); RNA_def_property_ui_range(prop, 0, 10, 1, 3); RNA_def_property_ui_text(prop, "Energy", "Amount of light that the lamp emits"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Color", "Light color"); RNA_def_property_update(prop, 0, "rna_Lamp_draw_update"); prop = RNA_def_property(srna, "use_own_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_LAYER); RNA_def_property_ui_text(prop, "Layer", "Illuminate objects only on the same layers the lamp is on"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "use_negative", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_NEG); RNA_def_property_ui_text(prop, "Negative", "Cast negative light"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "use_specular", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_SPEC); RNA_def_property_ui_text(prop, "Specular", "Create specular highlights"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); prop = RNA_def_property(srna, "use_diffuse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "mode", LA_NO_DIFF); RNA_def_property_ui_text(prop, "Diffuse", "Do diffuse shading"); RNA_def_property_update(prop, 0, "rna_Lamp_update"); /* 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 lamps"); 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 lamp"); RNA_def_property_update(prop, 0, "rna_Lamp_use_nodes_update"); /* common */ rna_def_animdata_common(srna); /* textures */ rna_def_mtex_common(brna, srna, "rna_Lamp_mtex_begin", "rna_Lamp_active_texture_get", "rna_Lamp_active_texture_set", NULL, "LampTextureSlot", "LampTextureSlots", "rna_Lamp_draw_update", "rna_Lamp_draw_update"); }
static void rna_def_cloth_sim_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "ClothSettings", NULL); RNA_def_struct_ui_text(srna, "Cloth Settings", "Cloth simulation settings for an object"); RNA_def_struct_sdna(srna, "ClothSimSettings"); RNA_def_struct_path_func(srna, "rna_ClothSettings_path"); /* goal */ prop= RNA_def_property(srna, "goal_min", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "mingoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Minimum", "Goal minimum, vertex group weights are scaled to match this range"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "maxgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Maximum", "Goal maximum, vertex group weights are scaled to match this range"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_default", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "defgoal"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Goal Default", "Default Goal (vertex target position) value, when no Vertex Group used"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_spring", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 0.999f); RNA_def_property_ui_text(prop, "Goal Stiffness", "Goal (vertex target position) spring stiffness"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "goal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalfrict"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Goal Damping", "Goal (vertex target position) friction"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "internal_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "velocity_smooth"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Internal Friction", ""); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "collider_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "collider_friction"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Collider Friction", ""); RNA_def_property_update(prop, 0, "rna_cloth_update"); /* mass */ prop= RNA_def_property(srna, "mass", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Mass", "Mass of cloth material"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "vertex_group_mass", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_mass_vgroup_get", "rna_ClothSettings_mass_vgroup_length", "rna_ClothSettings_mass_vgroup_set"); RNA_def_property_ui_text(prop, "Mass Vertex Group", "Vertex Group for pinning of vertices"); RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed"); prop= RNA_def_property(srna, "gravity", PROP_FLOAT, PROP_ACCELERATION); RNA_def_property_array(prop, 3); RNA_def_property_range(prop, -100.0, 100.0); RNA_def_property_float_funcs(prop, "rna_ClothSettings_gravity_get", "rna_ClothSettings_gravity_set", NULL); RNA_def_property_ui_text(prop, "Gravity", "Gravity or external force vector"); RNA_def_property_update(prop, 0, "rna_cloth_update"); /* various */ prop= RNA_def_property(srna, "air_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cvi"); RNA_def_property_range(prop, 0.0f, 10.0f); RNA_def_property_ui_text(prop, "Air Damping", "Air has normally some thickness which slows falling things down"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "use_pin_cloth", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_GOAL); RNA_def_property_ui_text(prop, "Pin Cloth", "Enable pinning of cloth vertices to other objects/positions"); RNA_def_property_update(prop, 0, "rna_cloth_pinning_changed"); prop= RNA_def_property(srna, "pin_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "goalspring"); RNA_def_property_range(prop, 0.0f, 50.0); RNA_def_property_ui_text(prop, "Pin Stiffness", "Pin (vertex target position) spring stiffness"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "stepsPerFrame"); RNA_def_property_range(prop, 4, 80); RNA_def_property_ui_text(prop, "Quality", "Quality of the simulation in steps per frame. (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); /* springs */ prop= RNA_def_property(srna, "use_stiffness_scale", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_SCALING); RNA_def_property_ui_text(prop, "Stiffness Scaling", "If enabled, stiffness can be scaled along a weight painted vertex group"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "spring_damping", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "Cdis"); RNA_def_property_range(prop, 0.0f, 50.0f); RNA_def_property_ui_text(prop, "Spring Damping", "Damping of cloth velocity. (higher = more smooth, less jiggling)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "structural"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Structural Stiffness", "Overall stiffness of structure"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "structural_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_struct"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_struct_set", NULL); RNA_def_property_ui_text(prop, "Structural Stiffness Maximum", "Maximum structural stiffness value"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "vertex_group_structural_stiffness", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_struct_vgroup_get", "rna_ClothSettings_struct_vgroup_length", "rna_ClothSettings_struct_vgroup_set"); RNA_def_property_ui_text(prop, "Structural Stiffness Vertex Group", "Vertex group for fine control over structural stiffness"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "bending"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_ui_text(prop, "Bending Stiffness", "Wrinkle coefficient. (higher = less smaller but more big wrinkles)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "bending_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_bend"); RNA_def_property_range(prop, 0.0f, 10000.0f); RNA_def_property_float_funcs(prop, NULL, "rna_ClothSettings_max_bend_set", NULL); RNA_def_property_ui_text(prop, "Bending Stiffness Maximum", "Maximum bending stiffness value"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "vertex_group_bending", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ClothSettings_bend_vgroup_get", "rna_ClothSettings_bend_vgroup_length", "rna_ClothSettings_bend_vgroup_set"); RNA_def_property_ui_text(prop, "Bending Stiffness Vertex Group", "Vertex group for fine control over bending stiffness"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "EffectorWeights"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Weights", ""); prop= RNA_def_property(srna, "pre_roll", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "preroll"); RNA_def_property_range(prop, 0, 200); RNA_def_property_ui_text(prop, "Pre Roll", "Simulation starts on this frame"); RNA_def_property_update(prop, 0, "rna_cloth_reset"); 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, 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"); /* unused */ /* unused still prop= RNA_def_property(srna, "shear_stiffness", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "shear"); RNA_def_property_range(prop, 0.0f, 1000.0f); RNA_def_property_ui_text(prop, "Shear Stiffness", "Shear spring stiffness"); */ /* unused still prop= RNA_def_property(srna, "shear_stiffness_max", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "max_shear"); RNA_def_property_range(prop, 0.0f, upperLimitf); RNA_def_property_ui_text(prop, "Shear Stiffness Maximum", "Maximum shear scaling value"); */ /* unused still prop= RNA_def_property(srna, "effector_force_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "eff_force_scale"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Effector Force Scale", ""); */ /* unused still prop= RNA_def_property(srna, "effector_wind_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "eff_wind_scale"); RNA_def_property_range(prop, 0.0f, 100.0f); RNA_def_property_ui_text(prop, "Effector Wind Scale", ""); */ /* unused still prop= RNA_def_property(srna, "tearing", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_SIMSETTINGS_FLAG_TEARING); RNA_def_property_ui_text(prop, "Tearing", "");*/ /* unused still prop= RNA_def_property(srna, "max_spring_extensions", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxspringlen"); RNA_def_property_range(prop, 1.0, 1000.0); RNA_def_property_ui_text(prop, "Maximum Spring Extension", "Maximum extension before spring gets cut"); */ }
static void rna_def_smoke_domain_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_noise_type_items[] = { {MOD_SMOKE_NOISEWAVE, "NOISEWAVE", 0, "Wavelet", ""}, #ifdef WITH_FFTW3 {MOD_SMOKE_NOISEFFT, "NOISEFFT", 0, "FFT", ""}, #endif /* {MOD_SMOKE_NOISECURL, "NOISECURL", 0, "Curl", ""}, */ {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem smoke_cache_comp_items[] = { {SM_CACHE_LIGHT, "CACHELIGHT", 0, "Light", "Fast but not so effective compression"}, {SM_CACHE_HEAVY, "CACHEHEAVY", 0, "Heavy", "Effective but slow compression"}, {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem smoke_domain_colli_items[] = { {SM_BORDER_OPEN, "BORDEROPEN", 0, "Open", "Smoke doesn't collide with any border"}, {SM_BORDER_VERTICAL, "BORDERVERTICAL", 0, "Vertically Open", "Smoke doesn't collide with top and bottom sides"}, {SM_BORDER_CLOSED, "BORDERCLOSED", 0, "Collide All", "Smoke collides with every side"}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "SmokeDomainSettings", NULL); RNA_def_struct_ui_text(srna, "Domain Settings", "Smoke domain settings"); RNA_def_struct_sdna(srna, "SmokeDomainSettings"); RNA_def_struct_path_func(srna, "rna_SmokeDomainSettings_path"); prop= RNA_def_property(srna, "resolution_max", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "maxres"); RNA_def_property_range(prop, 24, 512); RNA_def_property_ui_range(prop, 24, 512, 2, 0); RNA_def_property_ui_text(prop, "Max Res", "Maximal resolution used in the fluid domain"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "amplify", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "amplify"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_range(prop, 1, 10, 1, 0); RNA_def_property_ui_text(prop, "Amplification", "Enhance the resolution of smoke by this factor using noise"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "use_high_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGHRES); RNA_def_property_ui_text(prop, "High res", "Enable high resolution (using amplification)"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "show_high_resolution", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "viewsettings", MOD_SMOKE_VIEW_SHOWBIG); RNA_def_property_ui_text(prop, "Show High Resolution", "Show high resolution (using amplification)"); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); prop= RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "noise"); RNA_def_property_enum_items(prop, prop_noise_type_items); RNA_def_property_ui_text(prop, "Noise Method", "Noise method which is used for creating the high resolution"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Density", "How much density effects smoke motion, higher value results in faster rising smoke"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "beta", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "beta"); RNA_def_property_range(prop, -5.0, 5.0); RNA_def_property_ui_range(prop, -5.0, 5.0, 0.02, 5); RNA_def_property_ui_text(prop, "Heat", "How much heat effects smoke motion, higher value results in faster rising smoke"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "collision_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "coll_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Collision Group", "Limit collisions to this group"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); prop= RNA_def_property(srna, "fluid_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "fluid_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Fluid Group", "Limit fluid objects to this group"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); prop= RNA_def_property(srna, "effector_group", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "eff_group"); RNA_def_property_struct_type(prop, "Group"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Group", "Limit effectors to this group"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset_dependancy"); prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "strength"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.0, 10.0, 1, 2); RNA_def_property_ui_text(prop, "Strength", "Strength of noise"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "dissolve_speed", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "diss_speed"); RNA_def_property_range(prop, 1.0, 10000.0); RNA_def_property_ui_range(prop, 1.0, 10000.0, 1, 0); RNA_def_property_ui_text(prop, "Dissolve Speed", "Dissolve Speed"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "use_dissolve_smoke", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE); RNA_def_property_ui_text(prop, "Dissolve Smoke", "Enable smoke to disappear over time"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "use_dissolve_smoke_log", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_DISSOLVE_LOG); RNA_def_property_ui_text(prop, "Logarithmic dissolve", "Using 1/x "); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "point_cache", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "point_cache[0]"); RNA_def_property_ui_text(prop, "Point Cache", ""); prop= RNA_def_property(srna, "point_cache_compress_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "cache_comp"); RNA_def_property_enum_items(prop, smoke_cache_comp_items); RNA_def_property_ui_text(prop, "Cache Compression", "Compression method to be used"); prop= RNA_def_property(srna, "collision_extents", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "border_collisions"); RNA_def_property_enum_items(prop, smoke_domain_colli_items); RNA_def_property_ui_text(prop, "Border Collisions", "Selects which domain border will be treated as collision object."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "effector_weights", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "EffectorWeights"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Effector Weights", ""); prop= RNA_def_property(srna, "smooth_emitter", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_HIGH_SMOOTH); RNA_def_property_ui_text(prop, "Smooth Emitter", "Smoothens emitted smoke to avoid blockiness."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "time_scale", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "time_scale"); RNA_def_property_range(prop, 0.2, 1.5); RNA_def_property_ui_range(prop, 0.2, 1.5, 0.02, 5); RNA_def_property_ui_text(prop, "Time Scale", "Adjust simulation speed."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop= RNA_def_property(srna, "vorticity", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vorticity"); RNA_def_property_range(prop, 0.01, 4.0); RNA_def_property_ui_range(prop, 0.01, 4.0, 0.02, 5); RNA_def_property_ui_text(prop, "Vorticity", "Amount of turbulence/rotation in fluid."); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); }
static void rna_def_render_pass(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem pass_type_items[]= { {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""}, {SCE_PASS_Z, "Z", 0, "Z", ""}, {SCE_PASS_RGBA, "COLOR", 0, "Color", ""}, {SCE_PASS_DIFFUSE, "DIFFUSE", 0, "Diffuse", ""}, {SCE_PASS_SPEC, "SPECULAR", 0, "Specular", ""}, {SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""}, {SCE_PASS_AO, "AO", 0, "AO", ""}, {SCE_PASS_REFLECT, "REFLECTION", 0, "Reflection", ""}, {SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""}, {SCE_PASS_VECTOR, "VECTOR", 0, "Vector", ""}, {SCE_PASS_REFRACT, "REFRACTION", 0, "Refraction", ""}, {SCE_PASS_INDEXOB, "OBJECT_INDEX", 0, "Object Index", ""}, {SCE_PASS_UV, "UV", 0, "UV", ""}, {SCE_PASS_MIST, "MIST", 0, "Mist", ""}, {SCE_PASS_EMIT, "EMIT", 0, "Emit", ""}, {SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""}, {SCE_PASS_INDEXMA, "MATERIAL_INDEX", 0, "Material Index", ""}, {SCE_PASS_DIFFUSE_DIRECT, "DIFFUSE_DIRECT", 0, "Diffuse Direct", ""}, {SCE_PASS_DIFFUSE_INDIRECT, "DIFFUSE_INDIRECT", 0, "Diffuse Indirect", ""}, {SCE_PASS_DIFFUSE_COLOR, "DIFFUSE_COLOR", 0, "Diffuse Color", ""}, {SCE_PASS_GLOSSY_DIRECT, "GLOSSY_DIRECT", 0, "Glossy Direct", ""}, {SCE_PASS_GLOSSY_INDIRECT, "GLOSSY_INDIRECT", 0, "Glossy Indirect", ""}, {SCE_PASS_GLOSSY_COLOR, "GLOSSY_COLOR", 0, "Glossy Color", ""}, {SCE_PASS_TRANSM_DIRECT, "TRANSMISSION_DIRECT", 0, "Transmission Direct", ""}, {SCE_PASS_TRANSM_INDIRECT, "TRANSMISSION_INDIRECT", 0, "Transmission Indirect", ""}, {SCE_PASS_TRANSM_COLOR, "TRANSMISSION_COLOR", 0, "Transmission Color", ""}, {0, NULL, 0, NULL, NULL}}; srna= RNA_def_struct(brna, "RenderPass", NULL); RNA_def_struct_ui_text(srna, "Render Pass", ""); RNA_define_verify_sdna(0); prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "name"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_struct_name_property(srna, prop); prop= RNA_def_property(srna, "channel_id", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "chan_id"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "channels", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "channels"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "passtype"); RNA_def_property_enum_items(prop, pass_type_items); RNA_def_property_clear_flag(prop, PROP_EDITABLE); prop= RNA_def_property(srna, "rect", PROP_FLOAT, PROP_NONE); RNA_def_property_flag(prop, PROP_DYNAMIC); RNA_def_property_multi_array(prop, 2, NULL); RNA_def_property_dynamic_array_funcs(prop, "rna_RenderPass_rect_get_length"); RNA_def_property_float_funcs(prop, "rna_RenderPass_rect_get", "rna_RenderPass_rect_set", NULL); RNA_define_verify_sdna(1); }