static void rna_def_keydata(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "ShapeKeyPoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Point", "Point in a shape key"); RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_update(prop, 0, "rna_Key_update_data"); srna= RNA_def_struct(brna, "ShapeKeyCurvePoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Curve Point", "Point in a shape key for curves"); RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyPoint_co_get", "rna_ShapeKeyPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ShapeKeyCurvePoint_tilt_get", "rna_ShapeKeyCurvePoint_tilt_set", NULL); RNA_def_property_ui_text(prop, "Tilt", ""); RNA_def_property_update(prop, 0, "rna_Key_update_data"); srna= RNA_def_struct(brna, "ShapeKeyBezierPoint", NULL); RNA_def_struct_ui_text(srna, "Shape Key Bezier Point", "Point in a shape key for Bezier curves"); RNA_def_struct_path_func(srna, "rna_ShapeKeyPoint_path"); /* there's nothing type specific here, so this is fine for now */ prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_co_get", "rna_ShapeKeyBezierPoint_co_set", NULL); RNA_def_property_ui_text(prop, "Location", ""); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "handle_left", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_1_co_get", "rna_ShapeKeyBezierPoint_handle_1_co_set", NULL); RNA_def_property_ui_text(prop, "Handle 1 Location", ""); RNA_def_property_update(prop, 0, "rna_Key_update_data"); prop= RNA_def_property(srna, "handle_right", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_handle_2_co_get", "rna_ShapeKeyBezierPoint_handle_2_co_set", NULL); RNA_def_property_ui_text(prop, "Handle 2 Location", ""); RNA_def_property_update(prop, 0, "rna_Key_update_data"); /* appears to be unused currently prop= RNA_def_property(srna, "tilt", PROP_FLOAT, PROP_NONE); RNA_def_property_float_funcs(prop, "rna_ShapeKeyBezierPoint_tilt_get", "rna_ShapeKeyBezierPoint_tilt_set", NULL); RNA_def_property_ui_text(prop, "Tilt", ""); RNA_def_property_update(prop, 0, "rna_Key_update_data"); */ }
/* use for weight paint too */ static void rna_def_vertex_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "VertexPaint", "Paint"); RNA_def_struct_sdna(srna, "VPaint"); RNA_def_struct_path_func(srna, "rna_VertexPaint_path"); RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode"); /* vertex paint only */ prop = RNA_def_property(srna, "use_all_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA); RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush"); prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS); RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting"); prop = RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY); RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse"); /* weight paint only */ prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP); RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group"); }
static void rna_def_latticepoint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "LatticePoint", NULL); RNA_def_struct_sdna(srna, "BPoint"); RNA_def_struct_ui_text(srna, "LatticePoint", "Point in the lattice grid"); RNA_def_struct_path_func(srna, "rna_LatticePoint_path"); prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL); RNA_def_property_ui_text(prop, "Location", ""); prop= RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Deformed Location", ""); RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop= RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of"); }
static void rna_def_color_ramp_element(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "ColorRampElement", NULL); RNA_def_struct_sdna(srna, "CBData"); RNA_def_struct_path_func(srna, "rna_ColorRampElement_path"); RNA_def_struct_ui_text(srna, "Color Ramp Element", "Element defining a color at a position in the color ramp"); prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "r"); RNA_def_property_array(prop, 4); RNA_def_property_ui_text(prop, "Color", "Set color of selected color stop"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_COLOR); RNA_def_property_float_sdna(prop, NULL, "a"); RNA_def_property_ui_text(prop, "Alpha", "Set alpha of selected color stop"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); prop = RNA_def_property(srna, "position", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "pos"); RNA_def_property_range(prop, 0, 1); RNA_def_property_ui_text(prop, "Position", "Set position of selected color stop"); RNA_def_property_update(prop, 0, "rna_ColorRamp_update"); }
static void rna_def_color_ramp_element_api(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; PropertyRNA *parm; FunctionRNA *func; RNA_def_property_srna(cprop, "ColorRampElements"); srna = RNA_def_struct(brna, "ColorRampElements", NULL); RNA_def_struct_sdna(srna, "ColorBand"); RNA_def_struct_path_func(srna, "rna_ColorRampElement_path"); RNA_def_struct_ui_text(srna, "Color Ramp Elements", "Collection of Color Ramp Elements"); /* TODO, make these functions generic in texture.c */ func = RNA_def_function(srna, "new", "rna_ColorRampElement_new"); RNA_def_function_ui_description(func, "Add element to ColorRamp"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_float(func, "position", 0.0f, 0.0f, 1.0f, "Position", "Position to add element", 0.0f, 1.0f); RNA_def_property_flag(parm, PROP_REQUIRED); /* return type */ parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "New element"); RNA_def_function_return(func, parm); func = RNA_def_function(srna, "remove", "rna_ColorRampElement_remove"); RNA_def_function_ui_description(func, "Delete element from ColorRamp"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm = RNA_def_pointer(func, "element", "ColorRampElement", "", "Element to remove"); RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL | PROP_RNAPTR); RNA_def_property_clear_flag(parm, PROP_THICK_WRAP); }
/* use for weight paint too */ static void rna_def_vertex_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "VertexPaint", "Paint"); RNA_def_struct_sdna(srna, "VPaint"); RNA_def_struct_path_func(srna, "rna_VertexPaint_path"); RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode"); /* weight paint only */ prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_FLAG_VGROUP_RESTRICT); RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* Mirroring */ prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ); RNA_def_property_int_sdna(prop, NULL, "radial_symm"); RNA_def_property_int_default(prop, 1); RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_range(prop, 1, 32, 1, 1); RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface"); }
static void rna_def_uv_sculpt(BlenderRNA *brna) { StructRNA *srna; srna = RNA_def_struct(brna, "UvSculpt", "Paint"); RNA_def_struct_path_func(srna, "rna_UvSculpt_path"); RNA_def_struct_ui_text(srna, "UV Sculpting", ""); }
static void rna_def_cloth_collision_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "ClothCollisionSettings", NULL); RNA_def_struct_ui_text(srna, "Cloth Collision Settings", "Cloth simulation settings for self collision and collision with other objects."); RNA_def_struct_sdna(srna, "ClothCollSettings"); RNA_def_struct_path_func(srna, "rna_ClothCollisionSettings_path"); /* general collision */ prop= RNA_def_property(srna, "enable_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_ENABLED); RNA_def_property_ui_text(prop, "Enable Collision", "Enable collisions with other objects."); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "epsilon"); RNA_def_property_range(prop, 0.001f, 1.0f); RNA_def_property_ui_text(prop, "Minimum Distance", "Minimum distance between collision objects before collision response takes in."); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Friction", "Friction force if a collision happened. (higher = less movement)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "loop_count"); RNA_def_property_range(prop, 1, 20); RNA_def_property_ui_text(prop, "Collision Quality", "How many collision iterations should be done. (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); /* self collision */ prop= RNA_def_property(srna, "enable_self_collision", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", CLOTH_COLLSETTINGS_FLAG_SELF); RNA_def_property_ui_text(prop, "Enable Self Collision", "Enable self collisions."); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_min_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "selfepsilon"); RNA_def_property_range(prop, 0.5f, 1.0f); RNA_def_property_ui_text(prop, "Self Minimum Distance", "0.5 means no distance at all, 1.0 is maximum distance."); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_friction", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0f, 80.0f); RNA_def_property_ui_text(prop, "Self Friction", "Friction/damping with self contact."); RNA_def_property_update(prop, 0, "rna_cloth_update"); prop= RNA_def_property(srna, "self_collision_quality", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "self_loop_count"); RNA_def_property_range(prop, 1, 10); RNA_def_property_ui_text(prop, "Self Collision Quality", "How many self collision iterations should be done. (higher is better quality but slower)"); RNA_def_property_update(prop, 0, "rna_cloth_update"); }
static void rna_def_smoke_coll_settings(BlenderRNA *brna) { StructRNA *srna; srna = RNA_def_struct(brna, "SmokeCollSettings", NULL); RNA_def_struct_ui_text(srna, "Collision Settings", "Smoke collision settings"); RNA_def_struct_sdna(srna, "SmokeCollSettings"); RNA_def_struct_path_func(srna, "rna_SmokeCollSettings_path"); }
static void rna_def_image_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "ImagePaint", "Paint"); RNA_def_struct_sdna(srna, "ImagePaintSettings"); RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path"); RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode"); /* booleans */ prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY); RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE); RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT); RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL); RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL_INV); RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE); RNA_def_property_ui_text(prop, "Clone Map", "Use another UV map as clone source, otherwise use the 3D cursor as the source"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* integers */ prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL); RNA_def_property_ui_range(prop, 0, 8, 0, -1); RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)"); prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED); RNA_def_property_range(prop, 0, 90); RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle"); prop = RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size", "Size to capture the image for re-projecting", 0, 0); RNA_def_property_range(prop, 512, 16384); }
static void rna_def_imageuser(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna= RNA_def_struct(brna, "ImageUser", NULL); RNA_def_struct_ui_text(srna, "Image User", "Parameters defining how an Image datablock is used by another datablock"); RNA_def_struct_path_func(srna, "rna_ImageUser_path"); prop= RNA_def_property(srna, "use_auto_refresh", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMA_ANIM_ALWAYS); RNA_def_property_ui_text(prop, "Auto Refresh", "Always refresh image on frame changes"); RNA_def_property_update(prop, 0, "rna_ImageUser_update"); /* animation */ prop= RNA_def_property(srna, "use_cyclic", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "cycl", 0); RNA_def_property_ui_text(prop, "Cyclic", "Cycle the images in the movie"); RNA_def_property_update(prop, 0, "rna_ImageUser_update"); prop= RNA_def_property(srna, "frame_duration", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "frames"); RNA_def_property_range(prop, 0, MAXFRAMEF); RNA_def_property_ui_text(prop, "Frames", "Sets the number of images of a movie to use"); RNA_def_property_update(prop, 0, "rna_ImageUser_update"); prop= RNA_def_property(srna, "frame_offset", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "offset"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Offset", "Offsets the number of the frame to use in the animation"); RNA_def_property_update(prop, 0, "rna_ImageUser_update"); prop= RNA_def_property(srna, "frame_start", PROP_INT, PROP_TIME); RNA_def_property_int_sdna(prop, NULL, "sfra"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); RNA_def_property_ui_text(prop, "Start Frame", "Sets the global starting frame of the movie/sequence, assuming first picture has a #1"); RNA_def_property_update(prop, 0, "rna_ImageUser_update"); prop= RNA_def_property(srna, "fields_per_frame", PROP_INT, PROP_NONE); RNA_def_property_int_sdna(prop, NULL, "fie_ima"); RNA_def_property_range(prop, 1, 200); RNA_def_property_ui_text(prop, "Fields per Frame", "The number of fields per rendered frame (2 fields is 1 image)"); RNA_def_property_update(prop, 0, "rna_ImageUser_update"); prop= RNA_def_property(srna, "multilayer_layer", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "layer"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */ RNA_def_property_ui_text(prop, "Layer", "Layer in multilayer image"); prop= RNA_def_property(srna, "multilayer_pass", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "pass"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); /* image_multi_cb */ RNA_def_property_ui_text(prop, "Pass", "Pass in multilayer image"); }
static void rna_def_smoke_flow_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "SmokeFlowSettings", NULL); RNA_def_struct_ui_text(srna, "Flow Settings", "Smoke flow settings"); RNA_def_struct_sdna(srna, "SmokeFlowSettings"); RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path"); prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "density"); RNA_def_property_range(prop, 0.001, 1); RNA_def_property_ui_range(prop, 0.001, 1.0, 1.0, 4); RNA_def_property_ui_text(prop, "Density", ""); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "temp"); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_range(prop, -10, 10, 1, 1); RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "psys"); RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object"); RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependancy"); prop = RNA_def_property(srna, "use_outflow", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "type", MOD_SMOKE_FLOW_TYPE_OUTFLOW); RNA_def_property_ui_text(prop, "Outflow", "Delete smoke from simulation"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "initial_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY); RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke inherits its velocity from the emitter particle"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vel_multi"); RNA_def_property_range(prop, -2.0, 2.0); RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5); RNA_def_property_ui_text(prop, "Multiplier", "Multiplier to adjust velocity passed to smoke"); RNA_def_property_update(prop, NC_OBJECT|ND_MODIFIER, "rna_Smoke_reset"); }
static void rna_def_color_ramp(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; static EnumPropertyItem prop_interpolation_items[] = { {1, "EASE", 0, "Ease", ""}, {3, "CARDINAL", 0, "Cardinal", ""}, {0, "LINEAR", 0, "Linear", ""}, {2, "B_SPLINE", 0, "B-Spline", ""}, {4, "CONSTANT", 0, "Constant", ""}, {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", ""); 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); }
void RNA_def_fluidsim(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem prop_fluid_type_items[] = { {OB_FLUIDSIM_ENABLE, "NONE", 0, "None", ""}, {OB_FLUIDSIM_DOMAIN, "DOMAIN", 0, "Domain", "Bounding box of this object represents the computational domain of the " "fluid simulation"}, {OB_FLUIDSIM_FLUID, "FLUID", 0, "Fluid", "Object represents a volume of fluid in the simulation"}, {OB_FLUIDSIM_OBSTACLE, "OBSTACLE", 0, "Obstacle", "Object is a fixed obstacle"}, {OB_FLUIDSIM_INFLOW, "INFLOW", 0, "Inflow", "Object adds fluid to the simulation"}, {OB_FLUIDSIM_OUTFLOW, "OUTFLOW", 0, "Outflow", "Object removes fluid from the simulation"}, {OB_FLUIDSIM_PARTICLE, "PARTICLE", 0, "Particle", "Object is made a particle system to display particles generated by a " "fluidsim domain object"}, {OB_FLUIDSIM_CONTROL, "CONTROL", 0, "Control", "Object is made a fluid control mesh, which influences the fluid"}, {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "FluidSettings", NULL); RNA_def_struct_sdna(srna, "FluidsimSettings"); RNA_def_struct_refine_func(srna, "rna_FluidSettings_refine"); RNA_def_struct_path_func(srna, "rna_FluidSettings_path"); RNA_def_struct_ui_text(srna, "Fluid Simulation Settings", "Fluid simulation settings for an object taking part in the simulation"); prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_fluid_type_items); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Type", "Type of participation in the fluid simulation"); RNA_def_property_update(prop, 0, "rna_FluidSettings_update_type"); /*prop = RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE); */ /*RNA_def_property_ui_text(prop, "IPO Curves", "IPO curves used by fluid simulation settings"); */ /* types */ rna_def_fluidsim_domain(brna); rna_def_fluidsim_fluid(brna); rna_def_fluidsim_obstacle(brna); rna_def_fluidsim_inflow(brna); rna_def_fluidsim_outflow(brna); rna_def_fluidsim_particle(brna); rna_def_fluidsim_control(brna); }
static void rna_def_boidrule(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; /* data */ srna = RNA_def_struct(brna, "BoidRule", NULL); RNA_def_struct_ui_text(srna, "Boid Rule", ""); RNA_def_struct_refine_func(srna, "rna_BoidRule_refine"); RNA_def_struct_path_func(srna, "rna_BoidRule_path"); /* strings */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Boid rule name"); RNA_def_struct_name_property(srna, prop); /* enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, boidrule_type_items); RNA_def_property_ui_text(prop, "Type", ""); /* flags */ prop = RNA_def_property(srna, "use_in_air", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_IN_AIR); RNA_def_property_ui_text(prop, "In Air", "Use rule when boid is flying"); RNA_def_property_update(prop, 0, "rna_Boids_reset"); prop = RNA_def_property(srna, "use_on_land", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", BOIDRULE_ON_LAND); RNA_def_property_ui_text(prop, "On Land", "Use rule when boid is on land"); RNA_def_property_update(prop, 0, "rna_Boids_reset"); /*prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); */ /*RNA_def_property_boolean_sdna(prop, NULL, "mode", eModifierMode_Expanded); */ /*RNA_def_property_ui_text(prop, "Expanded", "Set modifier expanded in the user interface"); */ /* types */ rna_def_boidrule_goal(brna); rna_def_boidrule_avoid(brna); rna_def_boidrule_avoid_collision(brna); rna_def_boidrule_follow_leader(brna); rna_def_boidrule_average_speed(brna); rna_def_boidrule_fight(brna); }
static void rna_def_dynamic_paint_canvas_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "DynamicPaintCanvasSettings", NULL); RNA_def_struct_ui_text(srna, "Canvas Settings", "Dynamic Paint canvas settings"); RNA_def_struct_sdna(srna, "DynamicPaintCanvasSettings"); RNA_def_struct_path_func(srna, "rna_DynamicPaintCanvasSettings_path"); /* * Surface Slots */ prop= RNA_def_property(srna, "canvas_surfaces", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_DynamicPaint_surfaces_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "DynamicPaintSurface"); RNA_def_property_ui_text(prop, "Paint Surface List", "Paint surface list"); rna_def_canvas_surfaces(brna, prop); }
static void rna_def_latticepoint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "LatticePoint", NULL); RNA_def_struct_sdna(srna, "BPoint"); RNA_def_struct_ui_text(srna, "LatticePoint", "Point in the lattice grid"); RNA_def_struct_path_func(srna, "rna_LatticePoint_path"); prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "f1", 0); RNA_def_property_ui_text(prop, "Point selected", "Selection status"); prop = RNA_def_property(srna, "co", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_array(prop, 3); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_float_funcs(prop, "rna_LatticePoint_co_get", NULL, NULL); RNA_def_property_ui_text(prop, "Location", "Original undeformed location used to calculate the strength of the deform effect " "(edit/animate the Deformed Location instead)"); prop = RNA_def_property(srna, "co_deform", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "vec"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Deformed Location", ""); RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop = RNA_def_property(srna, "weight_softbody", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "weight"); RNA_def_property_range(prop, 0.01f, 100.0f); RNA_def_property_ui_text(prop, "Weight", "Softbody goal weight"); RNA_def_property_update(prop, 0, "rna_Lattice_update_data"); prop = RNA_def_property(srna, "groups", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_LatticePoint_groups_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "VertexGroupElement"); RNA_def_property_ui_text(prop, "Groups", "Weights for the vertex groups this point is member of"); }
static void rna_def_smoke_coll_settings(BlenderRNA *brna) { static EnumPropertyItem smoke_coll_type_items[] = { {SM_COLL_STATIC, "COLLSTATIC", 0, "Static", "Non moving obstacle"}, {SM_COLL_RIGID, "COLLRIGID", 0, "Rigid", "Rigid obstacle"}, {SM_COLL_ANIMATED, "COLLANIMATED", 0, "Animated", "Animated obstacle"}, {0, NULL, 0, NULL, NULL} }; StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "SmokeCollSettings", NULL); RNA_def_struct_ui_text(srna, "Collision Settings", "Smoke collision settings"); RNA_def_struct_sdna(srna, "SmokeCollSettings"); RNA_def_struct_path_func(srna, "rna_SmokeCollSettings_path"); prop = RNA_def_property(srna, "collision_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, smoke_coll_type_items); RNA_def_property_ui_text(prop, "Collision type", "Collision type"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); }
static void rna_def_colormanage(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem display_device_items[] = { {0, "DEFAULT", 0, "Default", ""}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem look_items[] = { {0, "NONE", 0, "None", "Do not modify image in an artistic manner"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem view_transform_items[] = { {0, "NONE", 0, "None", "Do not perform any color transform on display, use old non-color managed technique for display"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem color_space_items[] = { {0, "NONE", 0, "None", "Do not perform any color transform on load, treat colors as in scene linear space already"}, {0, NULL, 0, NULL, NULL} }; /* ** Display Settings ** */ srna = RNA_def_struct(brna, "ColorManagedDisplaySettings", NULL); RNA_def_struct_path_func(srna, "rna_ColorManagedDisplaySettings_path"); RNA_def_struct_ui_text(srna, "ColorManagedDisplaySettings", "Color management specific to display device"); prop = RNA_def_property(srna, "display_device", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, display_device_items); RNA_def_property_enum_funcs(prop, "rna_ColorManagedDisplaySettings_display_device_get", "rna_ColorManagedDisplaySettings_display_device_set", "rna_ColorManagedDisplaySettings_display_device_itemf"); RNA_def_property_ui_text(prop, "Display Device", "Display device name"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagedDisplaySettings_display_device_update"); /* ** View Settings ** */ srna = RNA_def_struct(brna, "ColorManagedViewSettings", NULL); RNA_def_struct_path_func(srna, "rna_ColorManagedViewSettings_path"); RNA_def_struct_ui_text(srna, "ColorManagedViewSettings", "Color management settings used for displaying images on the display"); prop = RNA_def_property(srna, "look", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, look_items); RNA_def_property_enum_funcs(prop, "rna_ColorManagedViewSettings_look_get", "rna_ColorManagedViewSettings_look_set", "rna_ColorManagedViewSettings_look_itemf"); RNA_def_property_ui_text(prop, "Look", "Additional transform applied before view transform for an artistic needs"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update"); prop = RNA_def_property(srna, "view_transform", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, view_transform_items); RNA_def_property_enum_funcs(prop, "rna_ColorManagedViewSettings_view_transform_get", "rna_ColorManagedViewSettings_view_transform_set", "rna_ColorManagedViewSettings_view_transform_itemf"); RNA_def_property_ui_text(prop, "View Transform", "View used when converting image to a display space"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update"); prop = RNA_def_property(srna, "exposure", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "exposure"); RNA_def_property_range(prop, -10.0f, 10.0f); RNA_def_property_float_default(prop, 0.0f); RNA_def_property_ui_text(prop, "Exposure", "Exposure (stops) applied before display transform"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update"); prop = RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "gamma"); RNA_def_property_float_default(prop, 1.0f); RNA_def_property_range(prop, 0.0f, 5.0f); RNA_def_property_ui_text(prop, "Gamma", "Amount of gamma modification applied after display transform"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update"); prop = RNA_def_property(srna, "curve_mapping", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "curve_mapping"); RNA_def_property_ui_text(prop, "Curve", "Color curve mapping applied before display transform"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update"); prop = RNA_def_property(srna, "use_curve_mapping", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", COLORMANAGE_VIEW_USE_CURVES); RNA_def_property_boolean_funcs(prop, NULL, "rna_ColorManagedViewSettings_use_curves_set"); RNA_def_property_ui_text(prop, "Use Curves", "Use RGB curved for pre-display transformation"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagement_update"); /* ** Colorspace ** */ srna = RNA_def_struct(brna, "ColorManagedInputColorspaceSettings", NULL); RNA_def_struct_path_func(srna, "rna_ColorManagedInputColorspaceSettings_path"); RNA_def_struct_ui_text(srna, "ColorManagedInputColorspaceSettings", "Input color space settings"); prop = RNA_def_property(srna, "name", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); RNA_def_property_enum_items(prop, color_space_items); RNA_def_property_enum_funcs(prop, "rna_ColorManagedColorspaceSettings_colorspace_get", "rna_ColorManagedColorspaceSettings_colorspace_set", "rna_ColorManagedColorspaceSettings_colorspace_itemf"); RNA_def_property_ui_text(prop, "Input Color Space", "Color space of the image or movie on disk"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagedColorspaceSettings_reload_update"); // srna = RNA_def_struct(brna, "ColorManagedSequencerColorspaceSettings", NULL); RNA_def_struct_path_func(srna, "rna_ColorManagedSequencerColorspaceSettings_path"); RNA_def_struct_ui_text(srna, "ColorManagedSequencerColorspaceSettings", "Input color space settings"); prop = RNA_def_property(srna, "name", PROP_ENUM, PROP_NONE); RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); RNA_def_property_enum_items(prop, color_space_items); RNA_def_property_enum_funcs(prop, "rna_ColorManagedColorspaceSettings_colorspace_get", "rna_ColorManagedColorspaceSettings_colorspace_set", "rna_ColorManagedColorspaceSettings_colorspace_itemf"); RNA_def_property_ui_text(prop, "Color Space", "Color space that the sequencer operates in"); RNA_def_property_update(prop, NC_WINDOW, "rna_ColorManagedColorspaceSettings_reload_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"); }
/* 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_mask_layer(BlenderRNA *brna) { static EnumPropertyItem masklay_blend_mode_items[] = { {MASK_BLEND_MERGE_ADD, "MERGE_ADD", 0, "Merge Add", ""}, {MASK_BLEND_MERGE_SUBTRACT, "MERGE_SUBTRACT", 0, "Merge Subtract", ""}, {MASK_BLEND_ADD, "ADD", 0, "Add", ""}, {MASK_BLEND_SUBTRACT, "SUBTRACT", 0, "Subtract", ""}, {MASK_BLEND_LIGHTEN, "LIGHTEN", 0, "Lighten", ""}, {MASK_BLEND_DARKEN, "DARKEN", 0, "Darken", ""}, {MASK_BLEND_MUL, "MUL", 0, "Multiply", ""}, {MASK_BLEND_REPLACE, "REPLACE", 0, "Replace", ""}, {MASK_BLEND_DIFFERENCE, "DIFFERENCE", 0, "Difference", ""}, {0, NULL, 0, NULL, NULL} }; StructRNA *srna; PropertyRNA *prop; rna_def_maskSpline(brna); rna_def_mask_splines(brna); rna_def_maskSplinePoints(brna); srna = RNA_def_struct(brna, "MaskLayer", NULL); RNA_def_struct_ui_text(srna, "Mask Layer", "Single layer used for masking pixels"); RNA_def_struct_path_func(srna, "rna_MaskLayer_path"); /* name */ prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Unique name of layer"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_MaskLayer_name_set"); RNA_def_property_string_maxlength(prop, MAX_ID_NAME - 2); RNA_def_property_update(prop, 0, "rna_Mask_update_data"); RNA_def_struct_name_property(srna, prop); /* splines */ prop = RNA_def_property(srna, "splines", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_funcs(prop, "rna_MaskLayer_splines_begin", "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", NULL, NULL, NULL, NULL); RNA_def_property_struct_type(prop, "MaskSpline"); RNA_def_property_ui_text(prop, "Splines", "Collection of splines which defines this layer"); RNA_def_property_srna(prop, "MaskSplines"); /* restrict */ prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", MASK_RESTRICT_VIEW); RNA_def_property_ui_text(prop, "Restrict View", "Restrict visibility in the viewport"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, 1); RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL); prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", MASK_RESTRICT_SELECT); RNA_def_property_ui_text(prop, "Restrict Select", "Restrict selection in the viewport"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, 1); RNA_def_property_update(prop, NC_MASK | ND_DRAW, NULL); prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "restrictflag", MASK_RESTRICT_RENDER); RNA_def_property_ui_text(prop, "Restrict Render", "Restrict renderability"); RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, 1); RNA_def_property_update(prop, NC_MASK | NA_EDITED, NULL); /* select (for dopesheet)*/ prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MASK_LAYERFLAG_SELECT); RNA_def_property_ui_text(prop, "Select", "Layer is selected for editing in the Dope Sheet"); // RNA_def_property_update(prop, NC_SCREEN | ND_MASK, NULL); /* render settings */ prop = RNA_def_property(srna, "alpha", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "alpha"); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.1, 3); RNA_def_property_ui_text(prop, "Opacity", "Render Opacity"); RNA_def_property_update(prop, NC_MASK | NA_EDITED, NULL); /* weight interpolation */ prop = RNA_def_property(srna, "blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "blend"); RNA_def_property_enum_items(prop, masklay_blend_mode_items); RNA_def_property_ui_text(prop, "Blend", "Method of blending mask layers"); RNA_def_property_update(prop, 0, "rna_Mask_update_data"); RNA_def_property_update(prop, NC_MASK | NA_EDITED, NULL); prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "blend_flag", MASK_BLENDFLAG_INVERT); RNA_def_property_ui_text(prop, "Restrict View", "Invert the mask black/white"); RNA_def_property_update(prop, NC_MASK | NA_EDITED, NULL); prop = RNA_def_property(srna, "falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "falloff"); RNA_def_property_enum_items(prop, proportional_falloff_curve_only_items); RNA_def_property_ui_text(prop, "Falloff", "Falloff type the feather"); RNA_def_property_translation_context(prop, BLF_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */ RNA_def_property_update(prop, NC_MASK | NA_EDITED, NULL); }
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_flow_settings(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem smoke_flow_types[] = { {MOD_SMOKE_FLOW_TYPE_OUTFLOW, "OUTFLOW", 0, "Outflow", "Delete smoke from simulation"}, {MOD_SMOKE_FLOW_TYPE_SMOKE, "SMOKE", 0, "Smoke", "Add smoke"}, {MOD_SMOKE_FLOW_TYPE_SMOKEFIRE, "BOTH", 0, "Fire + Smoke", "Add fire and smoke"}, {MOD_SMOKE_FLOW_TYPE_FIRE, "FIRE", 0, "Fire", "Add fire"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem smoke_flow_sources[] = { {MOD_SMOKE_FLOW_SOURCE_PARTICLES, "PARTICLES", ICON_PARTICLES, "Particle System", "Emit smoke from particles"}, {MOD_SMOKE_FLOW_SOURCE_MESH, "MESH", ICON_META_CUBE, "Mesh", "Emit smoke from mesh surface or volume"}, {0, NULL, 0, NULL, NULL} }; static EnumPropertyItem smoke_flow_texture_types[] = { {MOD_SMOKE_FLOW_TEXTURE_MAP_AUTO, "AUTO", 0, "Generated", "Generated coordinates centered to flow object"}, {MOD_SMOKE_FLOW_TEXTURE_MAP_UV, "UV", 0, "UV", "Use UV layer for texture coordinates"}, {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "SmokeFlowSettings", NULL); RNA_def_struct_ui_text(srna, "Flow Settings", "Smoke flow settings"); RNA_def_struct_sdna(srna, "SmokeFlowSettings"); RNA_def_struct_path_func(srna, "rna_SmokeFlowSettings_path"); prop = RNA_def_property(srna, "density", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "density"); RNA_def_property_range(prop, 0.0, 1); RNA_def_property_ui_range(prop, 0.0, 1.0, 1.0, 4); RNA_def_property_ui_text(prop, "Density", ""); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "smoke_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_float_sdna(prop, NULL, "color"); RNA_def_property_array(prop, 3); RNA_def_property_ui_text(prop, "Smoke Color", "Color of smoke"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "fuel_amount", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10); RNA_def_property_ui_range(prop, 0.0, 5.0, 1.0, 4); RNA_def_property_ui_text(prop, "Flame Rate", ""); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "temperature", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "temp"); RNA_def_property_range(prop, -10, 10); RNA_def_property_ui_range(prop, -10, 10, 1, 1); RNA_def_property_ui_text(prop, "Temp. Diff.", "Temperature difference to ambient temperature"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "psys"); RNA_def_property_struct_type(prop, "ParticleSystem"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Particle Systems", "Particle systems emitted from the object"); RNA_def_property_update(prop, 0, "rna_Smoke_reset_dependency"); prop = RNA_def_property(srna, "smoke_flow_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, smoke_flow_types); RNA_def_property_ui_text(prop, "Flow Type", "Change how flow affects the simulation"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "smoke_flow_source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "source"); RNA_def_property_enum_items(prop, smoke_flow_sources); RNA_def_property_ui_text(prop, "Source", "Change how smoke is emitted"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_absolute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_ABSOLUTE); RNA_def_property_ui_text(prop, "Absolute Density", "Only allow given density value in emitter area"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_initial_velocity", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_INITVELOCITY); RNA_def_property_ui_text(prop, "Initial Velocity", "Smoke has some initial velocity when it is emitted"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "velocity_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vel_multi"); RNA_def_property_range(prop, -100.0, 100.0); RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5); RNA_def_property_ui_text(prop, "Source", "Multiplier of source velocity passed to smoke"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "velocity_normal", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vel_normal"); RNA_def_property_range(prop, -100.0, 100.0); RNA_def_property_ui_range(prop, -2.0, 2.0, 0.05, 5); RNA_def_property_ui_text(prop, "Normal", "Amount of normal directional velocity"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "velocity_random", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "vel_random"); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.0, 2.0, 0.05, 5); RNA_def_property_ui_text(prop, "Random", "Amount of random velocity"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "volume_density", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_ui_range(prop, 0.0, 1.0, 0.05, 5); RNA_def_property_ui_text(prop, "Volume", "Factor for smoke emitted from inside the mesh volume"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "surface_distance", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 10.0); RNA_def_property_ui_range(prop, 0.5, 5.0, 0.05, 5); RNA_def_property_ui_text(prop, "Surface", "Maximum distance from mesh surface to emit smoke"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "particle_size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.1, 20.0); RNA_def_property_ui_range(prop, 0.5, 5.0, 0.05, 5); RNA_def_property_ui_text(prop, "Size", "Particle size in simulation cells"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_particle_size", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_USE_PART_SIZE); RNA_def_property_ui_text(prop, "Set Size", "Set particle size in simulation cells or use nearest cell"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "subframes", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 50); RNA_def_property_ui_range(prop, 0, 10, 1, -1); RNA_def_property_ui_text(prop, "Subframes", "Number of additional samples to take between frames to improve quality of fast moving flows"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "density_vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_SmokeFlow_density_vgroup_get", "rna_SmokeFlow_density_vgroup_length", "rna_SmokeFlow_density_vgroup_set"); RNA_def_property_ui_text(prop, "Vertex Group", "Name of vertex group which determines surface emission rate"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "use_texture", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_SMOKE_FLOW_TEXTUREEMIT); RNA_def_property_ui_text(prop, "Use Texture", "Use a texture to control emission strength"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "texture_map_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "texture_type"); RNA_def_property_enum_items(prop, smoke_flow_texture_types); RNA_def_property_ui_text(prop, "Mapping", "Texture mapping type"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "uv_layer", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "uvlayer_name"); RNA_def_property_ui_text(prop, "UV Map", "UV map name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_SmokeFlow_uvlayer_set"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "noise_texture", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Texture", "Texture that controls emission strength"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "texture_size", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.01, 10.0); RNA_def_property_ui_range(prop, 0.1, 5.0, 0.05, 5); RNA_def_property_ui_text(prop, "Size", "Size of texture mapping"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); prop = RNA_def_property(srna, "texture_offset", PROP_FLOAT, PROP_NONE); RNA_def_property_range(prop, 0.0, 200.0); RNA_def_property_ui_range(prop, 0.0, 100.0, 0.05, 5); RNA_def_property_ui_text(prop, "Offset", "Z-offset of texture mapping"); RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, "rna_Smoke_reset"); }
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"); }
void RNA_def_view_layer(BlenderRNA *brna) { FunctionRNA *func; StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "ViewLayer", NULL); RNA_def_struct_ui_text(srna, "View Layer", "View layer"); RNA_def_struct_ui_icon(srna, ICON_RENDER_RESULT); RNA_def_struct_path_func(srna, "rna_ViewLayer_path"); RNA_def_struct_idprops_func(srna, "rna_ViewLayer_idprops"); rna_def_view_layer_common(srna, true); func = RNA_def_function(srna, "update_render_passes", "rna_ViewLayer_update_render_passes"); RNA_def_function_ui_description(func, "Requery the enabled render passes from the render engine"); RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_NO_SELF); prop = RNA_def_property(srna, "layer_collection", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "LayerCollection"); RNA_def_property_pointer_sdna(prop, NULL, "layer_collections.first"); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_ui_text( prop, "Layer Collection", "Root of collections hierarchy of this view layer," "its 'collection' pointer property is the same as the scene's master collection"); prop = RNA_def_property(srna, "active_layer_collection", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "LayerCollection"); RNA_def_property_pointer_funcs(prop, "rna_ViewLayer_active_layer_collection_get", "rna_ViewLayer_active_layer_collection_set", NULL, NULL); RNA_def_property_flag(prop, PROP_EDITABLE | PROP_NEVER_NULL); RNA_def_property_ui_text( prop, "Active Layer Collection", "Active layer collection in this view layer's hierarchy"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL); RNA_def_property_struct_type(prop, "Object"); RNA_def_property_collection_funcs( prop, NULL, NULL, NULL, "rna_ViewLayer_objects_get", NULL, NULL, NULL, NULL); RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer"); rna_def_layer_objects(brna, prop); /* layer options */ prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VIEW_LAYER_RENDER); RNA_def_property_ui_text(prop, "Enabled", "Enable or disable rendering of this View Layer"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VIEW_LAYER_FREESTYLE); RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer"); RNA_def_property_update(prop, NC_SCENE | ND_LAYER, NULL); /* Freestyle */ rna_def_freestyle_settings(brna); prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config"); RNA_def_property_struct_type(prop, "FreestyleSettings"); RNA_def_property_ui_text(prop, "Freestyle Settings", ""); /* debug update routine */ func = RNA_def_function(srna, "update", "rna_ViewLayer_update_tagged"); RNA_def_function_flag(func, FUNC_USE_SELF_ID | FUNC_USE_MAIN); RNA_def_function_ui_description( func, "Update data tagged to be updated from previous access to data or operators"); /* Dependency Graph */ prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Depsgraph"); RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data"); RNA_def_property_pointer_funcs(prop, "rna_ViewLayer_depsgraph_get", NULL, NULL, NULL); /* Nested Data */ /* *** Non-Animated *** */ RNA_define_animate_sdna(false); rna_def_layer_collection(brna); rna_def_object_base(brna); RNA_define_animate_sdna(true); /* *** Animated *** */ }
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", ""); }
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_sculpt(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "Sculpt", "Paint"); RNA_def_struct_path_func(srna, "rna_Sculpt_path"); RNA_def_struct_ui_text(srna, "Sculpt", ""); prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ); RNA_def_property_int_sdna(prop, NULL, "radial_symm"); RNA_def_property_int_default(prop, 1); RNA_def_property_range(prop, 1, 64); RNA_def_property_ui_range(prop, 0, 32, 1, 1); RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis", "Number of times to copy strokes across the surface"); prop = RNA_def_property(srna, "use_symmetry_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_X); RNA_def_property_ui_text(prop, "Symmetry X", "Mirror brush across the X axis"); prop = RNA_def_property(srna, "use_symmetry_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Y); RNA_def_property_ui_text(prop, "Symmetry Y", "Mirror brush across the Y axis"); prop = RNA_def_property(srna, "use_symmetry_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMM_Z); RNA_def_property_ui_text(prop, "Symmetry Z", "Mirror brush across the Z axis"); prop = RNA_def_property(srna, "lock_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_X); RNA_def_property_ui_text(prop, "Lock X", "Disallow changes to the X axis of vertices"); prop = RNA_def_property(srna, "lock_y", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Y); RNA_def_property_ui_text(prop, "Lock Y", "Disallow changes to the Y axis of vertices"); prop = RNA_def_property(srna, "lock_z", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_LOCK_Z); RNA_def_property_ui_text(prop, "Lock Z", "Disallow changes to the Z axis of vertices"); prop = RNA_def_property(srna, "use_symmetry_feather", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SYMMETRY_FEATHER); RNA_def_property_ui_text(prop, "Symmetry Feathering", "Reduce the strength of the brush where it overlaps symmetrical daubs"); prop = RNA_def_property(srna, "use_threaded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_USE_OPENMP); RNA_def_property_ui_text(prop, "Use OpenMP", "Take advantage of multiple CPU cores to improve sculpting performance"); prop = RNA_def_property(srna, "use_deform_only", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_ONLY_DEFORM); RNA_def_property_ui_text(prop, "Use Deform Only", "Use only deformation modifiers (temporary disable all " "constructive modifiers except multi-resolution)"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update"); prop = RNA_def_property(srna, "show_diffuse_color", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_SHOW_DIFFUSE); RNA_def_property_ui_text(prop, "Show Diffuse Color", "Show diffuse color of object and overlay sculpt mask on top of it"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_ShowDiffuseColor_update"); prop = RNA_def_property(srna, "detail_size", PROP_INT, PROP_NONE); RNA_def_property_ui_range(prop, 2, 100, 0, -1); RNA_def_property_ui_text(prop, "Detail Size", "Maximum edge length for dynamic topology sculpting (in pixels)"); prop = RNA_def_property(srna, "use_smooth_shading", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DYNTOPO_SMOOTH_SHADING); RNA_def_property_ui_text(prop, "Smooth Shading", "Show faces in dynamic-topology mode with smooth " "shading rather than flat shaded"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Sculpt_update"); prop = RNA_def_property(srna, "use_edge_collapse", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", SCULPT_DYNTOPO_COLLAPSE); RNA_def_property_ui_text(prop, "Collapse Short Edges", "In dynamic-topology mode, collapse short edges " "in addition to subdividing long ones"); prop = RNA_def_property(srna, "symmetrize_direction", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, symmetrize_direction_items); RNA_def_property_ui_text(prop, "Direction", "Source and destination for symmetrize operator"); }
static void rna_def_image_paint(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; static EnumPropertyItem paint_type_items[] = { {IMAGEPAINT_MODE_MATERIAL, "MATERIAL", 0, "Material", "Detect image slots from the material"}, {IMAGEPAINT_MODE_IMAGE, "IMAGE", 0, "Image", "Set image for texture painting directly"}, {0, NULL, 0, NULL, NULL} }; srna = RNA_def_struct(brna, "ImagePaint", "Paint"); RNA_def_struct_sdna(srna, "ImagePaintSettings"); RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path"); RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode"); /* booleans */ prop = RNA_def_property(srna, "use_occlude", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_XRAY); RNA_def_property_ui_text(prop, "Occlude", "Only paint onto the faces directly under the brush (slower)"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_BACKFACE); RNA_def_property_ui_text(prop, "Cull", "Ignore faces pointing away from the view (faster)"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_FLAT); RNA_def_property_ui_text(prop, "Normal", "Paint most on faces pointing towards the view"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "use_stencil_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL); RNA_def_property_ui_text(prop, "Stencil Layer", "Set the mask layer from the UV map buttons"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); prop = RNA_def_property(srna, "invert_stencil", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_STENCIL_INV); RNA_def_property_ui_text(prop, "Invert", "Invert the stencil layer"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); prop = RNA_def_property(srna, "stencil_image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "stencil"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Stencil Image", "Image used as stencil"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); prop = RNA_def_property(srna, "canvas", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Canvas", "Image used as canvas"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_canvas_update"); prop = RNA_def_property(srna, "clone_image", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "clone"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Clone Image", "Image used as clone source"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); prop = RNA_def_property(srna, "stencil_color", PROP_FLOAT, PROP_COLOR_GAMMA); RNA_def_property_range(prop, 0.0, 1.0); RNA_def_property_float_sdna(prop, NULL, "stencil_col"); RNA_def_property_ui_text(prop, "Stencil Color", "Stencil color in the viewport"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_viewport_update"); prop = RNA_def_property(srna, "use_clone_layer", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", IMAGEPAINT_PROJECT_LAYER_CLONE); RNA_def_property_ui_text(prop, "Clone Map", "Use another UV map as clone source, otherwise use the 3D cursor as the source"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* integers */ prop = RNA_def_property(srna, "seam_bleed", PROP_INT, PROP_PIXEL); RNA_def_property_ui_range(prop, 0, 8, 0, -1); RNA_def_property_ui_text(prop, "Bleed", "Extend paint beyond the faces UVs to reduce seams (in pixels, slower)"); prop = RNA_def_property(srna, "normal_angle", PROP_INT, PROP_UNSIGNED); RNA_def_property_range(prop, 0, 90); RNA_def_property_ui_text(prop, "Angle", "Paint most on faces pointing towards the view according to this angle"); prop = RNA_def_int_array(srna, "screen_grab_size", 2, NULL, 0, 0, "screen_grab_size", "Size to capture the image for re-projecting", 0, 0); RNA_def_property_range(prop, 512, 16384); prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, paint_type_items); RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update"); }