diff options
author | YimingWu <xp8110@outlook.com> | 2020-06-04 13:57:28 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2020-06-04 13:57:28 +0300 |
commit | bfbf0bb7f7a0191b65fc724d5dfea225e6293c6b (patch) | |
tree | 042f37d28c9e1cf0ce5a0fb4fd4235288f62d36e /source/blender/makesrna/intern | |
parent | 3b52dfe549f0c2fca7e0cd499b85fb098e9b4da9 (diff) | |
parent | 78017916f7c7a8ec8907c9b993214ff8ec3c3557 (diff) |
Merge remote-tracking branch 'origin/master' into temp-lanpr-reviewtemp-lanpr-review
# Conflicts:
# release/datafiles/locale
# release/scripts/addons
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 34 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 138 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_define.c | 206 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_fluid.c | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 9 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_light.c | 60 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 242 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_render.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sequencer.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 17 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 2 |
14 files changed, 584 insertions, 158 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 85bd17c737e..f87e8824bc2 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -637,7 +637,7 @@ static char *rna_def_property_get_func( if (!manualfunc) { if (!dp->dnastructname || !dp->dnaname) { CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } @@ -654,7 +654,7 @@ static char *rna_def_property_get_func( prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } } @@ -667,7 +667,7 @@ static char *rna_def_property_get_func( prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } } @@ -679,7 +679,7 @@ static char *rna_def_property_get_func( prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } } @@ -1020,7 +1020,7 @@ static char *rna_def_property_set_func( if (!dp->dnastructname || !dp->dnaname) { if (prop->flag & PROP_EDITABLE) { CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } return NULL; } @@ -1263,7 +1263,7 @@ static char *rna_def_property_length_func( if (!manualfunc) { if (!dp->dnastructname || !dp->dnaname) { CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } } @@ -1289,7 +1289,7 @@ static char *rna_def_property_length_func( if (prop->type == PROP_COLLECTION && (!(dp->dnalengthname || dp->dnalengthfixed) || !dp->dnaname)) { CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } } @@ -1338,7 +1338,7 @@ static char *rna_def_property_begin_func( if (!manualfunc) { if (!dp->dnastructname || !dp->dnaname) { CLOG_ERROR(&LOG, "%s.%s has no valid dna info.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } } @@ -1848,7 +1848,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) if (!pprop->type) { CLOG_ERROR( &LOG, "%s.%s, pointer must have a struct type.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } break; } @@ -1896,21 +1896,21 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) "%s.%s, collection must have a begin function.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } if (!cprop->next) { CLOG_ERROR(&LOG, "%s.%s, collection must have a next function.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } if (!cprop->get) { CLOG_ERROR(&LOG, "%s.%s, collection must have a get function.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } } if (!cprop->item_type) { @@ -1918,7 +1918,7 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) "%s.%s, collection must have a struct type.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } break; } @@ -3656,7 +3656,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr errnest, prop->identifier, eprop->defaultvalue & ~totflag); - DefRNA.error = 1; + DefRNA.error = true; } } else { @@ -3666,7 +3666,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr srna->identifier, errnest, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } } } @@ -3676,7 +3676,7 @@ static void rna_generate_property(FILE *f, StructRNA *srna, const char *nest, Pr srna->identifier, errnest, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } break; } @@ -4218,7 +4218,7 @@ static void rna_generate_struct(BlenderRNA *UNUSED(brna), StructRNA *srna, FILE if (srna->reg && !srna->refine) { CLOG_ERROR( &LOG, "%s has a register function, must also have refine function.", srna->identifier); - DefRNA.error = 1; + DefRNA.error = true; } func = srna->functions.first; diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 9e78eec9c25..209e5a1ff8b 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1978,6 +1978,11 @@ static void rna_def_brush(BlenderRNA *brna) 0, "Face Sets", "Creates a pose segment per face sets, starting from the active face set"}, + {BRUSH_POSE_ORIGIN_FACE_SETS_FK, + "FACE_SETS_FK", + 0, + "Face Sets FK", + "Simulates an FK deformation using the Face Set under the cursor as control"}, {0, NULL, 0, NULL, NULL}, }; diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 47a09233769..79ee9619e36 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -193,6 +193,8 @@ static void rna_def_camera_background_image(BlenderRNA *brna) RNA_def_struct_ui_text( srna, "Background Image", "Image and settings for display in the 3D View background"); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "source", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "source"); RNA_def_property_enum_items(prop, bgpic_source_items); @@ -301,6 +303,8 @@ static void rna_def_camera_background_image(BlenderRNA *brna) RNA_def_property_enum_items(prop, bgpic_camera_frame_items); RNA_def_property_ui_text(prop, "Frame Method", "How the image fits in the camera frame"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + RNA_define_lib_overridable(false); } static void rna_def_camera_background_images(BlenderRNA *brna, PropertyRNA *cprop) @@ -356,6 +360,8 @@ static void rna_def_camera_stereo_data(BlenderRNA *brna) RNA_def_struct_nested(brna, srna, "Camera"); RNA_def_struct_ui_text(srna, "Stereo", "Stereoscopy settings for a Camera data-block"); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "convergence_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, convergence_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); @@ -409,6 +415,8 @@ static void rna_def_camera_stereo_data(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Pole Merge End Angle", "Angle at which interocular distance is 0"); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL); + + RNA_define_lib_overridable(false); } static void rna_def_camera_dof_settings_data(BlenderRNA *brna) @@ -421,6 +429,8 @@ static void rna_def_camera_dof_settings_data(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_CameraDOFSettings_path"); RNA_def_struct_ui_text(srna, "Depth of Field", "Depth of Field settings"); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_dof", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_DOF_ENABLED); RNA_def_property_ui_text(prop, "Depth of Field", "Use Depth of Field"); @@ -469,6 +479,8 @@ static void rna_def_camera_dof_settings_data(BlenderRNA *brna) RNA_def_property_range(prop, 0.01f, FLT_MAX); RNA_def_property_ui_range(prop, 1.0f, 2.0f, 0.1, 3); RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_dof_update"); + + RNA_define_lib_overridable(false); } void RNA_def_camera(BlenderRNA *brna) @@ -505,6 +517,8 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Camera", "Camera data-block for storing camera settings"); RNA_def_struct_ui_icon(srna, ICON_CAMERA_DATA); + RNA_define_lib_overridable(true); + /* Enums */ prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_type_items); @@ -736,6 +750,8 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Background Images", "List of background images"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + RNA_define_lib_overridable(false); + rna_def_animdata_common(srna); rna_def_camera_background_image(brna); diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index dc0cde953f4..07ad8cbb37d 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -824,6 +824,8 @@ static void rna_def_constraint_headtail_common(StructRNA *srna) { PropertyRNA *prop; + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "head_tail", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, "bConstraint", "headtail"); RNA_def_property_ui_text(prop, "Head/Tail", "Target along length of bone: Head=0, Tail=1"); @@ -835,12 +837,16 @@ static void rna_def_constraint_headtail_common(StructRNA *srna) "Follow B-Bone", "Follow shape of B-Bone segments when calculating Head/Tail position"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_target_common(StructRNA *srna) { PropertyRNA *prop; + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target object"); @@ -852,6 +858,8 @@ static void rna_def_constraint_target_common(StructRNA *srna) RNA_def_property_string_sdna(prop, NULL, "subtarget"); RNA_def_property_ui_text(prop, "Sub-Target", "Armature bone, mesh or lattice vertex group, ..."); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constrainttarget(BlenderRNA *brna) @@ -864,6 +872,8 @@ static void rna_def_constrainttarget(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path"); RNA_def_struct_sdna(srna, "bConstraintTarget"); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target object"); @@ -879,6 +889,8 @@ static void rna_def_constrainttarget(BlenderRNA *brna) prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_dependency_update"); /* space, flag and type still to do */ + + RNA_define_lib_overridable(false); } static void rna_def_constrainttarget_bone(BlenderRNA *brna) @@ -892,6 +904,8 @@ static void rna_def_constrainttarget_bone(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_ConstraintTarget_path"); RNA_def_struct_sdna(srna, "bConstraintTarget"); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_ui_text(prop, "Target", "Target armature"); @@ -913,6 +927,8 @@ static void rna_def_constrainttarget_bone(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Blend Weight", "Blending weight of this bone"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_ConstraintTarget_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_childof(BlenderRNA *brna) @@ -928,6 +944,8 @@ static void rna_def_constraint_childof(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCX); RNA_def_property_ui_text(prop, "Location X", "Use X Location of Parent"); @@ -985,6 +1003,8 @@ static void rna_def_constraint_childof(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_ui_text(prop, "Inverse Matrix", "Transformation matrix to apply before"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_python(BlenderRNA *brna) @@ -996,6 +1016,8 @@ static void rna_def_constraint_python(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Python Constraint", "Use Python script for constraint evaluation"); RNA_def_struct_sdna_from(srna, "bPythonConstraint", "data"); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "targets", NULL); RNA_def_property_struct_type(prop, "ConstraintTarget"); @@ -1021,6 +1043,8 @@ static void rna_def_constraint_python(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", PYCON_SCRIPTERROR); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Script Error", "The linked Python script has thrown an error"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_armature_deform_targets(BlenderRNA *brna, PropertyRNA *cprop) @@ -1065,6 +1089,8 @@ static void rna_def_constraint_armature_deform(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bArmatureConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_ARMATURE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "targets", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "targets", NULL); RNA_def_property_struct_type(prop, "ConstraintTargetBone"); @@ -1095,6 +1121,8 @@ static void rna_def_constraint_armature_deform(BlenderRNA *brna) "Use the current bone location for envelopes and choosing B-Bone " "segments instead of rest position"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_kinematic(BlenderRNA *brna) @@ -1121,6 +1149,8 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 10000); RNA_def_property_ui_text(prop, "Iterations", "Maximum number of solving iterations"); @@ -1240,6 +1270,8 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna) RNA_def_property_range(prop, 0.0, 100.f); RNA_def_property_ui_text(prop, "Distance", "Radius of limiting sphere"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_track_to(BlenderRNA *brna) @@ -1266,6 +1298,8 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_CON_TRACKTO); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "reserved1"); RNA_def_property_enum_items(prop, track_axis_items); @@ -1283,6 +1317,8 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Target Z", "Target's Z axis, not World Z axis, will constraint the Up direction"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_locate_like(BlenderRNA *brna) @@ -1300,6 +1336,8 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X); RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X location"); @@ -1334,6 +1372,8 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_OFFSET); RNA_def_property_ui_text(prop, "Offset", "Add original location into copied location"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_rotate_like(BlenderRNA *brna) @@ -1370,6 +1410,8 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X); RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X rotation"); @@ -1420,6 +1462,8 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Offset", "DEPRECATED: Add original rotation into copied rotation"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_size_like(BlenderRNA *brna) @@ -1434,6 +1478,8 @@ static void rna_def_constraint_size_like(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X); RNA_def_property_ui_text(prop, "Copy X", "Copy the target's X scale"); @@ -1476,6 +1522,8 @@ static void rna_def_constraint_size_like(BlenderRNA *brna) "Additive", "Use addition instead of multiplication to combine scale (2.7 compatibility)"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_same_volume(BlenderRNA *brna) @@ -1518,6 +1566,8 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bSameVolumeConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_SAMEVOL); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "free_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "free_axis"); RNA_def_property_enum_items(prop, axis_items); @@ -1535,6 +1585,8 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna) RNA_def_property_range(prop, 0.001f, 100.0f); RNA_def_property_ui_text(prop, "Volume", "Volume of the bone at rest"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_transform_like(BlenderRNA *brna) @@ -1575,12 +1627,16 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mix_mode"); RNA_def_property_enum_items(prop, mix_mode_items); RNA_def_property_ui_text( prop, "Mix Mode", "Specify how the copied and existing transformations are combined"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_minmax(BlenderRNA *brna) @@ -1606,6 +1662,8 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "minmaxflag"); RNA_def_property_enum_items(prop, minmax_items); @@ -1622,6 +1680,8 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) RNA_def_property_ui_range(prop, -100.0f, 100.0f, 1, -1); RNA_def_property_ui_text(prop, "Offset", "Offset of floor from object origin"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_action(BlenderRNA *brna) @@ -1673,6 +1733,8 @@ static void rna_def_constraint_action(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "mix_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mix_mode"); RNA_def_property_enum_items(prop, mix_mode_items); @@ -1733,6 +1795,8 @@ static void rna_def_constraint_action(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Minimum", "Minimum value for target channel range"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_property_float_funcs(prop, NULL, NULL, "rna_ActionConstraint_minmax_range"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_locked_track(BlenderRNA *brna) @@ -1760,6 +1824,8 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, track_axis_items); @@ -1771,6 +1837,8 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) RNA_def_property_enum_items(prop, lock_items); RNA_def_property_ui_text(prop, "Locked Axis", "Axis that points upward"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_follow_path(BlenderRNA *brna) @@ -1800,6 +1868,8 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bFollowPathConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWPATH); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); @@ -1852,6 +1922,8 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "followflag", FOLLOWPATH_RADIUS); RNA_def_property_ui_text(prop, "Curve Radius", "Object is scaled by the curve radius"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_stretch_to(BlenderRNA *brna) @@ -1888,6 +1960,8 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "volmode"); RNA_def_property_enum_items(prop, volume_items); @@ -1941,6 +2015,8 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Volume Variation Smoothness", "Strength of volume stretching clamping"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_clamp_to(BlenderRNA *brna) @@ -1964,6 +2040,8 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bClampToConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_CLAMPTO); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); @@ -1983,6 +2061,8 @@ static void rna_def_constraint_clamp_to(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Cyclic", "Treat curve as cyclic curve (no clamping to curve bounding box)"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_transform(BlenderRNA *brna) @@ -2033,6 +2113,8 @@ static void rna_def_constraint_transform(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "from"); RNA_def_property_enum_items(prop, transform_items); @@ -2323,6 +2405,8 @@ static void rna_def_constraint_transform(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Scale Mix Mode", "Specify how to combine the new scale with original"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_location_limit(BlenderRNA *brna) @@ -2336,6 +2420,8 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bLocLimitConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_LOCLIMIT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value"); @@ -2407,6 +2493,8 @@ static void rna_def_constraint_location_limit(BlenderRNA *brna) RNA_def_property_ui_text( prop, "For Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_rotation_limit(BlenderRNA *brna) @@ -2420,6 +2508,8 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bRotLimitConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_ROTLIMIT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_limit_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XROT); RNA_def_property_ui_text(prop, "Limit X", "Use the minimum X value"); @@ -2476,6 +2566,8 @@ static void rna_def_constraint_rotation_limit(BlenderRNA *brna) RNA_def_property_ui_text( prop, "For Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_size_limit(BlenderRNA *brna) @@ -2489,6 +2581,8 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bSizeLimitConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_SIZELIMIT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_min_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIMIT_XMIN); RNA_def_property_ui_text(prop, "Minimum X", "Use the minimum X value"); @@ -2560,6 +2654,8 @@ static void rna_def_constraint_size_limit(BlenderRNA *brna) RNA_def_property_ui_text( prop, "For Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_distance_limit(BlenderRNA *brna) @@ -2578,6 +2674,8 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); RNA_def_property_ui_range(prop, 0.0f, 100.0f, 10, 3); @@ -2596,6 +2694,8 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) RNA_def_property_ui_text( prop, "For Transform", "Transforms are affected by this constraint as well"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) @@ -2649,6 +2749,8 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bShrinkwrapConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_SHRINKWRAP); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "target"); /* TODO, mesh type */ RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll"); @@ -2734,6 +2836,8 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) RNA_def_property_enum_items(prop, track_axis_items); RNA_def_property_ui_text(prop, "Track Axis", "Axis that is aligned to the normal"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_damped_track(BlenderRNA *brna) @@ -2752,11 +2856,15 @@ static void rna_def_constraint_damped_track(BlenderRNA *brna) rna_def_constraint_target_common(srna); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); RNA_def_property_enum_items(prop, track_axis_items); RNA_def_property_ui_text(prop, "Track Axis", "Axis that points to the target object"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_spline_ik(BlenderRNA *brna) @@ -2804,6 +2912,8 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bSplineIKConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_SPLINEIK); + RNA_define_lib_overridable(true); + /* target chain */ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); @@ -2922,6 +3032,8 @@ static void rna_def_constraint_spline_ik(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Volume Variation Smoothness", "Strength of volume stretching clamping"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_pivot(BlenderRNA *brna) @@ -2973,6 +3085,8 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) RNA_def_struct_ui_icon(srna, ICON_CON_PIVOT); + RNA_define_lib_overridable(true); + /* target-defined pivot */ prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); @@ -3011,6 +3125,8 @@ static void rna_def_constraint_pivot(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Enabled Rotation Range", "Rotation range on which pivoting should occur"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_follow_track(BlenderRNA *brna) @@ -3031,6 +3147,8 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bFollowTrackConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_FOLLOWTRACK); + RNA_define_lib_overridable(true); + /* movie clip */ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "clip"); @@ -3106,6 +3224,8 @@ static void rna_def_constraint_follow_track(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", FOLLOWTRACK_USE_UNDISTORTION); RNA_def_property_ui_text(prop, "Undistort", "Parent to undistorted position of 2D track"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_camera_solver(BlenderRNA *brna) @@ -3119,6 +3239,8 @@ static void rna_def_constraint_camera_solver(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bCameraSolverConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_CAMERASOLVER); + RNA_define_lib_overridable(true); + /* movie clip */ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "clip"); @@ -3132,6 +3254,8 @@ static void rna_def_constraint_camera_solver(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", CAMERASOLVER_ACTIVECLIP); RNA_def_property_ui_text(prop, "Active Clip", "Use active clip defined in scene"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_object_solver(BlenderRNA *brna) @@ -3145,6 +3269,8 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bObjectSolverConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_OBJECTSOLVER); + RNA_define_lib_overridable(true); + /* movie clip */ prop = RNA_def_property(srna, "clip", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "clip"); @@ -3184,6 +3310,8 @@ static void rna_def_constraint_object_solver(BlenderRNA *brna) "rna_Constraint_objectSolver_camera_set", NULL, "rna_Constraint_cameraObject_poll"); + + RNA_define_lib_overridable(false); } static void rna_def_constraint_transform_cache(BlenderRNA *brna) @@ -3197,6 +3325,8 @@ static void rna_def_constraint_transform_cache(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bTransformCacheConstraint", "data"); RNA_def_struct_ui_icon(srna, ICON_CON_TRANSFORM_CACHE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "cache_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "cache_file"); RNA_def_property_struct_type(prop, "CacheFile"); @@ -3211,6 +3341,8 @@ static void rna_def_constraint_transform_cache(BlenderRNA *brna) "Object Path", "Path to the object in the Alembic archive used to lookup the transform matrix"); RNA_def_property_update(prop, 0, "rna_Constraint_update"); + + RNA_define_lib_overridable(false); } /* base struct for constraints */ @@ -3241,6 +3373,8 @@ void RNA_def_constraint(BlenderRNA *brna) RNA_def_property_enum_items(prop, rna_enum_constraint_type_items); RNA_def_property_ui_text(prop, "Type", ""); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "owner_space", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "ownspace"); RNA_def_property_enum_items(prop, owner_space_pchan_items); @@ -3258,7 +3392,6 @@ void RNA_def_constraint(BlenderRNA *brna) /* flags */ prop = RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_OFF); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Disable", "Enable/Disable Constraint"); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1); @@ -3266,7 +3399,6 @@ void RNA_def_constraint(BlenderRNA *brna) prop = RNA_def_property(srna, "show_expanded", PROP_BOOLEAN, PROP_NONE); RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CONSTRAINT_EXPAND); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Expanded", "Constraint's panel is expanded in UI"); RNA_def_property_ui_icon(prop, ICON_DISCLOSURE_TRI_RIGHT, 1); @@ -3315,6 +3447,8 @@ void RNA_def_constraint(BlenderRNA *brna) "Rot error", "Amount of residual error in radians for constraints that work on orientation"); + RNA_define_lib_overridable(false); + /* pointers */ rna_def_constrainttarget(brna); rna_def_constrainttarget_bone(brna); diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 7a439a11a54..f59a1790e7b 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -61,7 +61,18 @@ static CLG_LogRef LOG = {"rna.define"}; /* Global used during defining */ -BlenderDefRNA DefRNA = {NULL, {NULL, NULL}, {NULL, NULL}, NULL, 0, 0, 0, 1, 1}; +BlenderDefRNA DefRNA = { + .sdna = NULL, + .structs = {NULL, NULL}, + .allocs = {NULL, NULL}, + .laststruct = NULL, + .error = 0, + .silent = false, + .preprocess = false, + .verify = true, + .animate = true, + .make_overridable = false, +}; #ifndef RNA_RUNTIME static struct { @@ -691,13 +702,13 @@ BlenderRNA *RNA_create(void) BLI_listbase_clear(&DefRNA.structs); brna->structs_map = BLI_ghash_str_new_ex(__func__, 2048); - DefRNA.error = 0; - DefRNA.preprocess = 1; + DefRNA.error = false; + DefRNA.preprocess = true; DefRNA.sdna = DNA_sdna_from_data(DNAstr, DNAlen, false, false, &error_message); if (DefRNA.sdna == NULL) { CLOG_ERROR(&LOG, "Failed to decode SDNA: %s.", error_message); - DefRNA.error = 1; + DefRNA.error = true; } /* We need both alias and static (on-disk) DNA names. */ @@ -737,7 +748,7 @@ void RNA_define_free(BlenderRNA *UNUSED(brna)) DefRNA.sdna = NULL; } - DefRNA.error = 0; + DefRNA.error = false; } void RNA_define_verify_sdna(bool verify) @@ -745,6 +756,15 @@ void RNA_define_verify_sdna(bool verify) DefRNA.verify = verify; } +/** + * Properties defined when this is enabled are lib-overridable by default (except for Pointer + * ones). + */ +void RNA_define_lib_overridable(const bool make_overridable) +{ + DefRNA.make_overridable = make_overridable; +} + #ifndef RNA_RUNTIME void RNA_define_animate_sdna(bool animate) { @@ -910,7 +930,7 @@ StructRNA *RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRN if (rna_validate_identifier(identifier, error, false) == 0) { CLOG_ERROR(&LOG, "struct identifier \"%s\" error - %s", identifier, error); - DefRNA.error = 1; + DefRNA.error = true; } } @@ -1040,7 +1060,7 @@ StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char * srnafrom = BLI_ghash_lookup(brna->structs_map, from); if (!srnafrom) { CLOG_ERROR(&LOG, "struct %s not found to define %s.", from, identifier); - DefRNA.error = 1; + DefRNA.error = true; } } @@ -1065,7 +1085,7 @@ void RNA_def_struct_sdna(StructRNA *srna, const char *structname) if (DNA_struct_find_nr_wrapper(DefRNA.sdna, structname) == -1) { if (!DefRNA.silent) { CLOG_ERROR(&LOG, "%s not found.", structname); - DefRNA.error = 1; + DefRNA.error = true; } return; } @@ -1093,7 +1113,7 @@ void RNA_def_struct_sdna_from(StructRNA *srna, const char *structname, const cha if (DNA_struct_find_nr_wrapper(DefRNA.sdna, structname) == -1) { if (!DefRNA.silent) { CLOG_ERROR(&LOG, "%s not found.", structname); - DefRNA.error = 1; + DefRNA.error = true; } return; } @@ -1106,7 +1126,7 @@ void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *pr { if (prop->type != PROP_STRING) { CLOG_ERROR(&LOG, "\"%s.%s\", must be a string property.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } else { srna->nameproperty = prop; @@ -1121,7 +1141,7 @@ void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *struct srnafrom = BLI_ghash_lookup(brna->structs_map, structname); if (!srnafrom) { CLOG_ERROR(&LOG, "struct %s not found for %s.", structname, srna->identifier); - DefRNA.error = 1; + DefRNA.error = true; } srna->nested = srnafrom; @@ -1271,7 +1291,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, if (rna_validate_identifier(identifier, error, true) == 0) { CLOG_ERROR( &LOG, "property identifier \"%s.%s\" - %s", CONTAINER_RNA_ID(cont), identifier, error); - DefRNA.error = 1; + DefRNA.error = true; } dcont = rna_find_container_def(cont); @@ -1279,7 +1299,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, /* XXX - toto, detect supertype collisions */ if (rna_findlink(&dcont->properties, identifier)) { CLOG_ERROR(&LOG, "duplicate identifier \"%s.%s\"", CONTAINER_RNA_ID(cont), identifier); - DefRNA.error = 1; + DefRNA.error = true; } dprop = MEM_callocN(sizeof(PropertyDefRNA), "PropertyDefRNA"); @@ -1294,7 +1314,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, CONTAINER_RNA_ID(cont), identifier, error); - DefRNA.error = 1; + DefRNA.error = true; } #endif } @@ -1309,7 +1329,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, "subtype does not apply to 'PROP_BOOLEAN' \"%s.%s\"", CONTAINER_RNA_ID(cont), identifier); - DefRNA.error = 1; + DefRNA.error = true; } } break; @@ -1322,7 +1342,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, "subtype does not apply to 'PROP_INT' \"%s.%s\"", CONTAINER_RNA_ID(cont), identifier); - DefRNA.error = 1; + DefRNA.error = true; } #endif @@ -1371,7 +1391,7 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, break; default: CLOG_ERROR(&LOG, "\"%s.%s\", invalid property type.", CONTAINER_RNA_ID(cont), identifier); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } @@ -1404,6 +1424,14 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, } } +#ifndef RNA_RUNTIME + if (type != PROP_POINTER) { + if (DefRNA.make_overridable) { + prop->flag_override |= PROPOVERRIDE_OVERRIDABLE_LIBRARY; + } + } +#endif + if (type == PROP_STRING) { /* used so generated 'get/length/set' functions skip a NULL check * in some cases we want it */ @@ -1413,42 +1441,42 @@ PropertyRNA *RNA_def_property(StructOrFunctionRNA *cont_, if (DefRNA.preprocess) { switch (type) { case PROP_BOOLEAN: - DefRNA.silent = 1; + DefRNA.silent = true; RNA_def_property_boolean_sdna(prop, NULL, identifier, 0); - DefRNA.silent = 0; + DefRNA.silent = false; break; case PROP_INT: { - DefRNA.silent = 1; + DefRNA.silent = true; RNA_def_property_int_sdna(prop, NULL, identifier); - DefRNA.silent = 0; + DefRNA.silent = false; break; } case PROP_FLOAT: { - DefRNA.silent = 1; + DefRNA.silent = true; RNA_def_property_float_sdna(prop, NULL, identifier); - DefRNA.silent = 0; + DefRNA.silent = false; break; } case PROP_STRING: { - DefRNA.silent = 1; + DefRNA.silent = true; RNA_def_property_string_sdna(prop, NULL, identifier); - DefRNA.silent = 0; + DefRNA.silent = false; break; } case PROP_ENUM: - DefRNA.silent = 1; + DefRNA.silent = true; RNA_def_property_enum_sdna(prop, NULL, identifier); - DefRNA.silent = 0; + DefRNA.silent = false; break; case PROP_POINTER: - DefRNA.silent = 1; + DefRNA.silent = true; RNA_def_property_pointer_sdna(prop, NULL, identifier); - DefRNA.silent = 0; + DefRNA.silent = false; break; case PROP_COLLECTION: - DefRNA.silent = 1; + DefRNA.silent = true; RNA_def_property_collection_sdna(prop, NULL, identifier, NULL); - DefRNA.silent = 0; + DefRNA.silent = false; break; } } @@ -1543,7 +1571,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length) "\"%s.%s\", array length must be zero of greater.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -1553,7 +1581,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length) srna->identifier, prop->identifier, RNA_MAX_ARRAY_LENGTH); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -1563,7 +1591,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length) srna->identifier, prop->identifier, prop->arraydimension); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -1580,7 +1608,7 @@ void RNA_def_property_array(PropertyRNA *prop, int length) "\"%s.%s\", only boolean/int/float can be array.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1606,7 +1634,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le srna->identifier, prop->identifier, RNA_MAX_ARRAY_DIMENSION); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -1620,7 +1648,7 @@ void RNA_def_property_multi_array(PropertyRNA *prop, int dimension, const int le "\"%s.%s\", only boolean/int/float can be array.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } @@ -1680,22 +1708,22 @@ void RNA_def_property_ui_range( #ifndef NDEBUG if (min > max) { CLOG_ERROR(&LOG, "\"%s.%s\", min > max.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } if (step < 0 || step > 100) { CLOG_ERROR(&LOG, "\"%s.%s\", step outside range.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } if (step == 0) { CLOG_ERROR(&LOG, "\"%s.%s\", step is zero.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } if (precision < -1 || precision > UI_PRECISION_FLOAT_MAX) { CLOG_ERROR(&LOG, "\"%s.%s\", precision outside range.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } #endif @@ -1718,7 +1746,7 @@ void RNA_def_property_ui_range( default: CLOG_ERROR( &LOG, "\"%s.%s\", invalid type for ui range.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1730,7 +1758,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max) #ifdef DEBUG if (min > max) { CLOG_ERROR(&LOG, "\"%s.%s\", min > max.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } #endif @@ -1753,7 +1781,7 @@ void RNA_def_property_range(PropertyRNA *prop, double min, double max) } default: CLOG_ERROR(&LOG, "\"%s.%s\", invalid type for range.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1781,7 +1809,7 @@ void RNA_def_property_struct_type(PropertyRNA *prop, const char *type) default: CLOG_ERROR( &LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1814,7 +1842,7 @@ void RNA_def_property_struct_runtime(PropertyRNA *prop, StructRNA *type) default: CLOG_ERROR( &LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1831,7 +1859,7 @@ void RNA_def_property_enum_native_type(PropertyRNA *prop, const char *native_enu default: CLOG_ERROR( &LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1856,7 +1884,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item "\"%s.%s\", enum identifiers must not contain spaces.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } else if (item[i].value == eprop->defaultvalue) { @@ -1879,7 +1907,7 @@ void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item default: CLOG_ERROR( &LOG, "\"%s.%s\", invalid type for struct type.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1896,7 +1924,7 @@ void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1920,7 +1948,7 @@ void RNA_def_property_boolean_default(PropertyRNA *prop, bool value) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1937,7 +1965,7 @@ void RNA_def_property_boolean_array_default(PropertyRNA *prop, const bool *array } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1959,7 +1987,7 @@ void RNA_def_property_int_default(PropertyRNA *prop, int value) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -1981,7 +2009,7 @@ void RNA_def_property_int_array_default(PropertyRNA *prop, const int *array) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -2003,7 +2031,7 @@ void RNA_def_property_float_default(PropertyRNA *prop, float value) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -2025,7 +2053,7 @@ void RNA_def_property_float_array_default(PropertyRNA *prop, const float *array) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -2043,7 +2071,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value) "\"%s.%s\", NULL string passed (dont call in this case).", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } @@ -2052,7 +2080,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value) "\"%s.%s\", empty string passed (dont call in this case).", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; // BLI_assert(0); break; } @@ -2066,7 +2094,7 @@ void RNA_def_property_string_default(PropertyRNA *prop, const char *value) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -2096,7 +2124,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) srna->identifier, prop->identifier, eprop->defaultvalue & ~totflag); - DefRNA.error = 1; + DefRNA.error = true; } } else { @@ -2113,7 +2141,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) else { CLOG_ERROR( &LOG, "\"%s.%s\", default is not in items.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; } } } @@ -2122,7 +2150,7 @@ void RNA_def_property_enum_default(PropertyRNA *prop, int value) } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not enum.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -2175,7 +2203,7 @@ static PropertyDefRNA *rna_def_property_sdna(PropertyRNA *prop, structname, propname, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return NULL; } } @@ -2219,13 +2247,13 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, if (prop->type != PROP_BOOLEAN) { CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } if ((dp = rna_def_property_sdna(prop, structname, propname))) { - if (DefRNA.silent == 0) { + if (!DefRNA.silent) { /* error check to ensure floats are not wrapped as ints/bools */ if (dp->dnatype && *dp->dnatype && IS_DNATYPE_BOOLEAN_COMPAT(dp->dnatype) == 0) { CLOG_ERROR(&LOG, @@ -2234,7 +2262,7 @@ void RNA_def_property_boolean_sdna(PropertyRNA *prop, prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); - DefRNA.error = 1; + DefRNA.error = true; return; } } @@ -2323,14 +2351,14 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const if (prop->type != PROP_INT) { CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } if ((dp = rna_def_property_sdna(prop, structname, propname))) { /* error check to ensure floats are not wrapped as ints/bools */ - if (DefRNA.silent == 0) { + if (!DefRNA.silent) { if (dp->dnatype && *dp->dnatype && IS_DNATYPE_INT_COMPAT(dp->dnatype) == 0) { CLOG_ERROR(&LOG, "%s.%s is a '%s' but wrapped as type '%s'.", @@ -2338,7 +2366,7 @@ void RNA_def_property_int_sdna(PropertyRNA *prop, const char *structname, const prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); - DefRNA.error = 1; + DefRNA.error = true; return; } } @@ -2470,13 +2498,13 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons if (prop->type != PROP_FLOAT) { CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } if ((dp = rna_def_property_sdna(prop, structname, propname))) { /* silent is for internal use */ - if (DefRNA.silent == 0) { + if (!DefRNA.silent) { if (dp->dnatype && *dp->dnatype && IS_DNATYPE_FLOAT_COMPAT(dp->dnatype) == 0) { /* Colors are an exception. these get translated. */ if (prop->subtype != PROP_COLOR_GAMMA) { @@ -2486,7 +2514,7 @@ void RNA_def_property_float_sdna(PropertyRNA *prop, const char *structname, cons prop->identifier, dp->dnatype, RNA_property_typename(prop->type)); - DefRNA.error = 1; + DefRNA.error = true; return; } } @@ -2578,7 +2606,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const if (prop->type != PROP_ENUM) { CLOG_ERROR(&LOG, "\"%s.%s\", type is not enum.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -2589,7 +2617,7 @@ void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const if (!DefRNA.silent) { CLOG_ERROR(&LOG, "\"%s.%s\", array not supported for enum type.", structname, propname); - DefRNA.error = 1; + DefRNA.error = true; } } @@ -2672,7 +2700,7 @@ void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, con if (prop->type != PROP_STRING) { CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -2716,7 +2744,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co if (prop->type != PROP_POINTER) { CLOG_ERROR(&LOG, "\"%s.%s\", type is not pointer.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -2727,7 +2755,7 @@ void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, co if (!DefRNA.silent) { CLOG_ERROR(&LOG, "\"%s.%s\", array not supported for pointer type.", structname, propname); - DefRNA.error = 1; + DefRNA.error = true; } } } @@ -2749,7 +2777,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, if (prop->type != PROP_COLLECTION) { CLOG_ERROR(&LOG, "\"%s.%s\", type is not collection.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -2760,7 +2788,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, if (!DefRNA.silent) { CLOG_ERROR(&LOG, "\"%s.%s\", array of collections not supported.", structname, propname); - DefRNA.error = 1; + DefRNA.error = true; } } @@ -2806,7 +2834,7 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, else { if (!DefRNA.silent) { CLOG_ERROR(&LOG, "\"%s.%s\" not found.", structname, lengthpropname); - DefRNA.error = 1; + DefRNA.error = true; } } } @@ -2904,7 +2932,7 @@ void RNA_def_property_dynamic_array_funcs(PropertyRNA *prop, const char *getleng if (!(prop->flag & PROP_DYNAMIC)) { CLOG_ERROR(&LOG, "property is a not dynamic array."); - DefRNA.error = 1; + DefRNA.error = true; return; } @@ -2946,7 +2974,7 @@ void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const ch } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not boolean.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -3036,7 +3064,7 @@ void RNA_def_property_int_funcs(PropertyRNA *prop, } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not int.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -3134,7 +3162,7 @@ void RNA_def_property_float_funcs(PropertyRNA *prop, } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not float.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -3222,7 +3250,7 @@ void RNA_def_property_enum_funcs(PropertyRNA *prop, } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not enum.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -3289,7 +3317,7 @@ void RNA_def_property_string_funcs(PropertyRNA *prop, } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not string.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -3351,7 +3379,7 @@ void RNA_def_property_pointer_funcs( } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not pointer.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -3405,7 +3433,7 @@ void RNA_def_property_collection_funcs(PropertyRNA *prop, } default: CLOG_ERROR(&LOG, "\"%s.%s\", type is not collection.", srna->identifier, prop->identifier); - DefRNA.error = 1; + DefRNA.error = true; break; } } @@ -4170,7 +4198,7 @@ static FunctionRNA *rna_def_function(StructRNA *srna, const char *identifier) if (rna_validate_identifier(identifier, error, false) == 0) { CLOG_ERROR(&LOG, "function identifier \"%s\" - %s", identifier, error); - DefRNA.error = 1; + DefRNA.error = true; } } diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index 93c7c1f3480..43d2234ddf2 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -227,8 +227,11 @@ static void rna_Fluid_flip_parts_update(Main *bmain, Scene *scene, PointerRNA *p mmd = (FluidModifierData *)BKE_modifiers_findby_type(ob, eModifierType_Fluid); bool exists = rna_Fluid_parts_exists(ptr, PART_FLUID_FLIP); - /* Only create a particle system in liquid domain mode. */ + /* Only create a particle system in liquid domain mode. + * Remove any remainings of a liquid sim when switching to gas. */ if (mmd->domain->type != FLUID_DOMAIN_TYPE_LIQUID) { + rna_Fluid_parts_delete(ptr, PART_FLUID_FLIP); + mmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FLIP; rna_Fluid_domain_reset(bmain, scene, ptr); return; } diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 9faf589fe8a..6afa740fec3 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -118,7 +118,14 @@ typedef struct BlenderDefRNA { ListBase structs; ListBase allocs; struct StructRNA *laststruct; - int error, silent, preprocess, verify, animate; + bool error; + bool silent; + bool preprocess; + bool verify; + bool animate; + /** Whether RNA properties defined should be overridable or not by default. */ + bool make_overridable; + /* Keep last. */ #ifndef RNA_RUNTIME struct { diff --git a/source/blender/makesrna/intern/rna_light.c b/source/blender/makesrna/intern/rna_light.c index c19dafb3bc6..2caf315e09e 100644 --- a/source/blender/makesrna/intern/rna_light.c +++ b/source/blender/makesrna/intern/rna_light.c @@ -186,25 +186,45 @@ static void rna_def_light(BlenderRNA *brna) rna_def_animdata_common(srna); } -static void rna_def_light_energy(StructRNA *srna, bool distant) +static void rna_def_light_energy(StructRNA *srna, const short light_type) { PropertyRNA *prop; - if (distant) { - /* Distant light strength has no unit defined, it's proportional to - * Watt/m^2 and is not sensitive to scene unit scale. */ - prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); - RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); - RNA_def_property_ui_text(prop, "Strength", "Amount of light emitted"); - RNA_def_property_update(prop, 0, "rna_Light_draw_update"); - } - else { - /* Lights with a location have power in Watt, which is sensitive to - * scene unit scale. */ - prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_POWER); - RNA_def_property_ui_range(prop, 0.0f, 1000000.0f, 10, 5); - RNA_def_property_ui_text(prop, "Power", "Amount of light emitted"); - RNA_def_property_update(prop, 0, "rna_Light_draw_update"); + switch (light_type) { + case LA_SUN: { + /* Distant light strength has no unit defined, + * it's proportional to 'watt/m^2' and is not sensitive to scene unit scale. */ + prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_NONE); + RNA_def_property_ui_range(prop, 0.0f, 10.0f, 1, 3); + RNA_def_property_ui_text( + prop, "Strength", "Sunlight strength in watts per meter squared (W/m^2)"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); + break; + } + case LA_SPOT: { + /* Lights with a location have power in Watts, + * which is sensitive to scene unit scale. */ + prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_POWER); + RNA_def_property_ui_range(prop, 0.0f, 1000000.0f, 10, 5); + RNA_def_property_ui_text(prop, + "Power", + "The energy this light would emit over its entire area " + "if it wasn't limited by the spot angle"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); + break; + } + default: { + /* Lights with a location have power in Watts, + * which is sensitive to scene unit scale. */ + prop = RNA_def_property(srna, "energy", PROP_FLOAT, PROP_POWER); + RNA_def_property_ui_range(prop, 0.0f, 1000000.0f, 10, 5); + RNA_def_property_ui_text( + prop, + "Power", + "Light energy emitted over the entire area of the light in all directions"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); + break; + } } } @@ -395,7 +415,7 @@ static void rna_def_point_light(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Point Light", "Omnidirectional point Light"); RNA_def_struct_ui_icon(srna, ICON_LIGHT_POINT); - rna_def_light_energy(srna, false); + rna_def_light_energy(srna, LA_LOCAL); rna_def_light_falloff(srna); rna_def_light_shadow(srna, false); } @@ -418,7 +438,7 @@ static void rna_def_area_light(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Area Light", "Directional area Light"); RNA_def_struct_ui_icon(srna, ICON_LIGHT_AREA); - rna_def_light_energy(srna, false); + rna_def_light_energy(srna, LA_AREA); rna_def_light_shadow(srna, false); rna_def_light_falloff(srna); @@ -457,7 +477,7 @@ static void rna_def_spot_light(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Spot Light", "Directional cone Light"); RNA_def_struct_ui_icon(srna, ICON_LIGHT_SPOT); - rna_def_light_energy(srna, false); + rna_def_light_energy(srna, LA_SPOT); rna_def_light_falloff(srna); rna_def_light_shadow(srna, false); @@ -503,7 +523,7 @@ static void rna_def_sun_light(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Angle", "Angular diameter of the Sun as seen from the Earth"); RNA_def_property_update(prop, 0, "rna_Light_update"); - rna_def_light_energy(srna, true); + rna_def_light_energy(srna, LA_SUN); rna_def_light_shadow(srna, true); } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index f5a437b7892..1e21278c8eb 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1682,6 +1682,8 @@ static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const c PropertyRNA *prop; + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "uv_smooth", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "uv_smooth"); RNA_def_property_enum_items(prop, prop_uv_smooth_items); @@ -1702,6 +1704,8 @@ static PropertyRNA *rna_def_property_subdivision_common(StructRNA *srna, const c RNA_def_property_ui_text(prop, "Subdivision Type", "Select type of subdivision algorithm"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + RNA_define_lib_overridable(false); + return prop; } @@ -1717,6 +1721,8 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) rna_def_property_subdivision_common(srna, "subdivType"); + RNA_define_lib_overridable(true); + /* see CCGSUBSURF_LEVEL_MAX for max limit */ prop = RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED); RNA_def_property_int_sdna(prop, NULL, "levels"); @@ -1743,6 +1749,8 @@ static void rna_def_modifier_subsurf(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Use Creases", "Use mesh edge crease information to sharpen edges"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_generic_map_info(StructRNA *srna) @@ -1769,6 +1777,8 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna) PropertyRNA *prop; + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Texture", ""); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -1799,6 +1809,8 @@ static void rna_def_modifier_generic_map_info(StructRNA *srna) RNA_def_property_string_sdna(prop, NULL, "map_bone"); RNA_def_property_ui_text(prop, "Texture Coordinate Bone", "Bone to set the texture coordinates"); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_warp(BlenderRNA *brna) @@ -1811,6 +1823,8 @@ static void rna_def_modifier_warp(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WarpModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_WARP); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object_from", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "object_from"); RNA_def_property_ui_text(prop, "Object From", "Object to transform from"); @@ -1872,6 +1886,8 @@ static void rna_def_modifier_warp(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + RNA_define_lib_overridable(false); + rna_def_modifier_generic_map_info(srna); } @@ -1885,6 +1901,8 @@ static void rna_def_modifier_multires(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MultiresModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MULTIRES); + RNA_define_lib_overridable(true); + prop = rna_def_property_subdivision_common(srna, "simple"); RNA_def_property_enum_funcs(prop, NULL, "rna_MultiresModifier_type_set", NULL); @@ -1936,6 +1954,8 @@ static void rna_def_modifier_multires(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Use Creases", "Use mesh edge crease information to sharpen edges"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_lattice(BlenderRNA *brna) @@ -1948,6 +1968,8 @@ static void rna_def_modifier_lattice(BlenderRNA *brna) RNA_def_struct_sdna(srna, "LatticeModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_LATTICE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Lattice object to deform with"); RNA_def_property_pointer_funcs( @@ -1975,6 +1997,8 @@ static void rna_def_modifier_lattice(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 1, 10, 2); RNA_def_property_ui_text(prop, "Strength", "Strength of modifier effect"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_curve(BlenderRNA *brna) @@ -1997,6 +2021,8 @@ static void rna_def_modifier_curve(BlenderRNA *brna) RNA_def_struct_sdna(srna, "CurveModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_CURVE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Curve object to deform with"); RNA_def_property_pointer_funcs( @@ -2024,6 +2050,8 @@ static void rna_def_modifier_curve(BlenderRNA *brna) RNA_def_property_enum_items(prop, prop_deform_axis_items); RNA_def_property_ui_text(prop, "Deform Axis", "The axis that the curve deforms along"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_build(BlenderRNA *brna) @@ -2036,6 +2064,8 @@ static void rna_def_modifier_build(BlenderRNA *brna) RNA_def_struct_sdna(srna, "BuildModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_BUILD); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME); RNA_def_property_float_sdna(prop, NULL, "start"); RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF); @@ -2062,6 +2092,8 @@ static void rna_def_modifier_build(BlenderRNA *brna) RNA_def_property_range(prop, 1, MAXFRAMEF); RNA_def_property_ui_text(prop, "Seed", "Seed for random if used"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_mirror(BlenderRNA *brna) @@ -2074,6 +2106,8 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MirrorModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MIRROR); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_axis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_MIR_AXIS_X); RNA_def_property_array(prop, 3); @@ -2174,6 +2208,8 @@ static void rna_def_modifier_mirror(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_SELF_CHECK); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_decimate(BlenderRNA *brna) @@ -2199,6 +2235,8 @@ static void rna_def_modifier_decimate(BlenderRNA *brna) RNA_def_struct_sdna(srna, "DecimateModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_DECIM); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "decimate_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, modifier_decim_mode_items); @@ -2287,6 +2325,8 @@ static void rna_def_modifier_decimate(BlenderRNA *brna) RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text( prop, "Face Count", "The current number of faces in the decimated mesh"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_wave(BlenderRNA *brna) @@ -2299,6 +2339,8 @@ static void rna_def_modifier_wave(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WaveModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_WAVE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WAVE_X); RNA_def_property_ui_text(prop, "X", "X axis motion"); @@ -2426,6 +2468,8 @@ static void rna_def_modifier_wave(BlenderRNA *brna) "the more narrow the wave"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + RNA_define_lib_overridable(false); + rna_def_modifier_generic_map_info(srna); } @@ -2439,6 +2483,8 @@ static void rna_def_modifier_armature(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ArmatureModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_ARMATURE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Armature object to deform with"); RNA_def_property_pointer_funcs( @@ -2486,6 +2532,8 @@ static void rna_def_modifier_armature(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "deformflag", ARM_DEF_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_hook(BlenderRNA *brna) @@ -2501,6 +2549,8 @@ static void rna_def_modifier_hook(BlenderRNA *brna) RNA_def_struct_sdna(srna, "HookModifierData"); RNA_def_struct_ui_icon(srna, ICON_HOOK); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "strength", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "force"); RNA_def_property_range(prop, 0, 1); @@ -2595,6 +2645,8 @@ static void rna_def_modifier_hook(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_HOOK_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_softbody(BlenderRNA *brna) @@ -2645,6 +2697,8 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) RNA_def_struct_sdna(srna, "BooleanModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_BOOLEAN); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Mesh object to use for Boolean operation"); RNA_def_property_pointer_funcs( @@ -2687,6 +2741,8 @@ static void rna_def_modifier_boolean(BlenderRNA *brna) RNA_def_property_flag(prop, PROP_ENUM_FLAG); RNA_def_property_ui_text(prop, "Debug", "Debugging options, only when started with '-d'"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_array(BlenderRNA *brna) @@ -2714,6 +2770,8 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ArrayModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_ARRAY); + RNA_define_lib_overridable(true); + /* Length parameters */ prop = RNA_def_property(srna, "fit_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_fit_type_items); @@ -2836,6 +2894,8 @@ static void rna_def_modifier_array(BlenderRNA *brna) RNA_def_property_ui_range(prop, -1, 1, 2, 4); RNA_def_property_ui_text(prop, "V Offset", "Amount to offset array UVs on the V axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_edgesplit(BlenderRNA *brna) @@ -2849,6 +2909,8 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna) RNA_def_struct_sdna(srna, "EdgeSplitModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_EDGESPLIT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "split_angle", PROP_FLOAT, PROP_ANGLE); RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f)); RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 10, 2); @@ -2864,6 +2926,8 @@ static void rna_def_modifier_edgesplit(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_EDGESPLIT_FROMFLAG); RNA_def_property_ui_text(prop, "Use Sharp Edges", "Split edges that are marked as sharp"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_displace(BlenderRNA *brna) @@ -2917,6 +2981,8 @@ static void rna_def_modifier_displace(BlenderRNA *brna) RNA_def_struct_sdna(srna, "DisplaceModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_DISPLACE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text( @@ -2954,6 +3020,8 @@ static void rna_def_modifier_displace(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + RNA_define_lib_overridable(false); + rna_def_modifier_generic_map_info(srna); } @@ -3049,6 +3117,8 @@ static void rna_def_modifier_smooth(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SmoothModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_X); RNA_def_property_ui_text(prop, "X", "Smooth object along X axis"); @@ -3090,6 +3160,8 @@ static void rna_def_modifier_smooth(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SMOOTH_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_correctivesmooth(BlenderRNA *brna) @@ -3131,6 +3203,8 @@ static void rna_def_modifier_correctivesmooth(BlenderRNA *brna) RNA_def_struct_sdna(srna, "CorrectiveSmoothModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "lambda"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); @@ -3194,6 +3268,8 @@ static void rna_def_modifier_correctivesmooth(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Pin Boundaries", "Excludes boundary vertices from being smoothed"); RNA_def_property_update(prop, 0, "rna_CorrectiveSmoothModifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_laplaciansmooth(BlenderRNA *brna) @@ -3206,6 +3282,8 @@ static void rna_def_modifier_laplaciansmooth(BlenderRNA *brna) RNA_def_struct_sdna(srna, "LaplacianSmoothModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SMOOTH); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_LAPLACIANSMOOTH_X); RNA_def_property_ui_text(prop, "X", "Smooth object along X axis"); @@ -3264,6 +3342,8 @@ static void rna_def_modifier_laplaciansmooth(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_LAPLACIANSMOOTH_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_cast(BlenderRNA *brna) @@ -3283,6 +3363,8 @@ static void rna_def_modifier_cast(BlenderRNA *brna) RNA_def_struct_sdna(srna, "CastModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_CAST); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "cast_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_cast_type_items); @@ -3359,6 +3441,8 @@ static void rna_def_modifier_cast(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_CastModifier_defgrp_name_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_meshdeform(BlenderRNA *brna) @@ -3379,6 +3463,8 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MeshDeformModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Object", "Mesh object to deform with"); RNA_def_property_pointer_funcs( @@ -3423,6 +3509,8 @@ static void rna_def_modifier_meshdeform(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mode", "Method of binding vertices are bound to cage mesh"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); # endif + + RNA_define_lib_overridable(false); } static void rna_def_modifier_particlesystem(BlenderRNA *brna) @@ -3438,6 +3526,7 @@ static void rna_def_modifier_particlesystem(BlenderRNA *brna) prop = RNA_def_property(srna, "particle_system", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "psys"); + RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_ui_text(prop, "Particle System", "Particle System that this modifier controls"); } @@ -3465,6 +3554,8 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ParticleInstanceModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_PARTICLES); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Mesh_object_poll"); @@ -3592,6 +3683,8 @@ static void rna_def_modifier_particleinstance(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Value Layer Name", "Custom data layer name for the randomized value"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_explode(BlenderRNA *brna) @@ -3605,6 +3698,8 @@ static void rna_def_modifier_explode(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ExplodeModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_EXPLODE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_funcs(prop, "rna_ExplodeModifier_vgroup_get", @@ -3652,6 +3747,8 @@ static void rna_def_modifier_explode(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_cloth(BlenderRNA *brna) @@ -3664,6 +3761,8 @@ static void rna_def_modifier_cloth(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ClothModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_CLOTH); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "settings", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_NEVER_NULL); RNA_def_property_pointer_sdna(prop, NULL, "sim_parms"); @@ -3697,6 +3796,8 @@ static void rna_def_modifier_cloth(BlenderRNA *brna) RNA_def_property_int_sdna(prop, NULL, "hair_grid_res"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Hair Grid Resolution", ""); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_fluid(BlenderRNA *brna) @@ -3717,6 +3818,8 @@ static void rna_def_modifier_fluid(BlenderRNA *brna) RNA_def_struct_sdna(srna, "FluidModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_FLUIDSIM); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "domain_settings", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "domain"); RNA_def_property_ui_text(prop, "Domain Settings", ""); @@ -3735,6 +3838,8 @@ static void rna_def_modifier_fluid(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Type", ""); RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, 0, "rna_fluid_set_type"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_dynamic_paint(BlenderRNA *brna) @@ -3863,6 +3968,8 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_struct_sdna(srna, "BevelModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_BEVEL); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "width", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "value"); RNA_def_property_range(prop, 0, FLT_MAX); @@ -4000,6 +4107,8 @@ static void rna_def_modifier_bevel(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Vertex Mesh Method", "The method to use to create the mesh at intersections"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) @@ -4054,6 +4163,8 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ShrinkwrapModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SHRINKWRAP); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "wrap_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shrinkType"); RNA_def_property_enum_items(prop, shrink_type_items); @@ -4164,6 +4275,8 @@ static void rna_def_modifier_shrinkwrap(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "shrinkOpts", MOD_SHRINKWRAP_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_mask(BlenderRNA *brna) @@ -4182,6 +4295,8 @@ static void rna_def_modifier_mask(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MaskModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MASK); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, modifier_mask_mode_items); RNA_def_property_ui_text(prop, "Mode", ""); @@ -4213,6 +4328,8 @@ static void rna_def_modifier_mask(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0, 1, 0.1, 3); RNA_def_property_ui_text(prop, "Threshold", "Weights over this threshold remain"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_simpledeform(BlenderRNA *brna) @@ -4252,6 +4369,8 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SimpleDeformModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SIMPLEDEFORM); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "deform_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, simple_deform_mode_items); @@ -4316,6 +4435,8 @@ static void rna_def_modifier_simpledeform(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SIMPLEDEFORM_FLAG_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_surface(BlenderRNA *brna) @@ -4392,6 +4513,8 @@ static void rna_def_modifier_solidify(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SolidifyModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SOLIDIFY); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "solidify_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "mode"); RNA_def_property_enum_items(prop, mode_items); @@ -4562,6 +4685,8 @@ static void rna_def_modifier_solidify(BlenderRNA *brna) RNA_def_property_ui_range(prop, -1.0, 1.0, 0.1, 3); RNA_def_property_ui_text(prop, "Bevel Convex", "Edge bevel weight to be added to outside edges"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_screw(BlenderRNA *brna) @@ -4574,6 +4699,8 @@ static void rna_def_modifier_screw(BlenderRNA *brna) RNA_def_struct_sdna(srna, "ScrewModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SCREW); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_axis"); RNA_def_property_ui_text(prop, "Object", "Object to define the screw axis"); @@ -4672,6 +4799,8 @@ static void rna_def_modifier_screw(BlenderRNA *brna) prop, "Object Angle", "Use the angle between the objects rather than the fixed angle"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); # endif + + RNA_define_lib_overridable(false); } static void rna_def_modifier_uvwarp(BlenderRNA *brna) @@ -4684,6 +4813,8 @@ static void rna_def_modifier_uvwarp(BlenderRNA *brna) RNA_def_struct_sdna(srna, "UVWarpModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_UVPROJECT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "axis_u", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "axis_u"); RNA_def_property_enum_items(prop, rna_enum_axis_xyz_items); @@ -4756,10 +4887,13 @@ static void rna_def_modifier_uvwarp(BlenderRNA *brna) RNA_def_property_ui_text(prop, "UV Layer", "UV Layer name"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_UVWarpModifier_uvlayer_name_set"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_weightvg_mask(BlenderRNA *UNUSED(brna), StructRNA *srna, + const char *mask_flags, const char *mask_vgroup_setter, const char *mask_uvlayer_setter) { @@ -4789,6 +4923,8 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *UNUSED(brna), PropertyRNA *prop; + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "mask_constant", PROP_FLOAT, PROP_FACTOR); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); RNA_def_property_ui_range(prop, 0.0, 1.0, 1, -1); @@ -4802,6 +4938,11 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *UNUSED(brna), RNA_def_property_string_funcs(prop, NULL, NULL, mask_vgroup_setter); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, mask_flags, MOD_WVG_EDIT_INVERT_VGROUP_MASK); + RNA_def_property_ui_text(prop, "Invert", "Invert vertex group mask influence"); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); + prop = RNA_def_property(srna, "mask_texture", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Masking Tex", "Masking texture"); RNA_def_property_flag(prop, PROP_EDITABLE); @@ -4842,6 +4983,8 @@ static void rna_def_modifier_weightvg_mask(BlenderRNA *UNUSED(brna), RNA_def_property_ui_text( prop, "Texture Coordinate Bone", "Which bone to take texture coordinates from"); RNA_def_property_update(prop, 0, "rna_Modifier_dependency_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_weightvgedit(BlenderRNA *brna) @@ -4871,6 +5014,8 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WeightVGEditModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name"); @@ -4946,16 +5091,14 @@ static void rna_def_modifier_weightvgedit(BlenderRNA *brna) "to be removed from the vgroup"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + RNA_define_lib_overridable(false); + /* Common masking properties. */ rna_def_modifier_weightvg_mask(brna, srna, + "edit_flags", "rna_WeightVGEditModifier_mask_defgrp_name_set", "rna_WeightVGEditModifier_mask_tex_uvlayer_name_set"); - - prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "edit_flags", MOD_WVG_EDIT_INVERT_VGROUP_MASK); - RNA_def_property_ui_text(prop, "Invert", "Invert vertex group mask influence"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_weightvgmix(BlenderRNA *brna) @@ -5000,6 +5143,8 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WeightVGMixModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "vertex_group_a", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name_a"); RNA_def_property_ui_text(prop, "Vertex Group A", "First vertex group name"); @@ -5053,17 +5198,6 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Vertex Set", "Which vertices should be affected"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); - /* Common masking properties. */ - rna_def_modifier_weightvg_mask(brna, - srna, - "rna_WeightVGMixModifier_mask_defgrp_name_set", - "rna_WeightVGMixModifier_mask_tex_uvlayer_name_set"); - - prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WVG_MIX_INVERT_VGROUP_MASK); - RNA_def_property_ui_text(prop, "Invert", "Invert vertex group mask influence"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); - prop = RNA_def_property(srna, "normalize", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WVG_MIX_WEIGHTS_NORMALIZE); RNA_def_property_ui_text( @@ -5071,6 +5205,15 @@ static void rna_def_modifier_weightvgmix(BlenderRNA *brna) "Normalize Weights", "Normalize the resulting weights (otherwise they are only clamped within [0.0, 1.0] range)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); + + /* Common masking properties. */ + rna_def_modifier_weightvg_mask(brna, + srna, + "flag", + "rna_WeightVGMixModifier_mask_defgrp_name_set", + "rna_WeightVGMixModifier_mask_tex_uvlayer_name_set"); } static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) @@ -5124,6 +5267,8 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WeightVGProximityModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_VERTEX_WEIGHT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name"); @@ -5186,17 +5331,14 @@ static void rna_def_modifier_weightvgproximity(BlenderRNA *brna) "Normalize the resulting weights (otherwise they are only clamped within [0.0, 1.0] range)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + RNA_define_lib_overridable(false); + /* Common masking properties. */ rna_def_modifier_weightvg_mask(brna, srna, + "proximity_flags", "rna_WeightVGProximityModifier_mask_defgrp_name_set", "rna_WeightVGProximityModifier_mask_tex_uvlayer_name_set"); - - prop = RNA_def_property(srna, "invert_mask_vertex_group", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna( - prop, NULL, "proximity_flags", MOD_WVG_PROXIMITY_INVERT_VGROUP_MASK); - RNA_def_property_ui_text(prop, "Invert", "Invert vertex group mask influence"); - RNA_def_property_update(prop, 0, "rna_Modifier_update"); } static void rna_def_modifier_remesh(BlenderRNA *brna) @@ -5232,6 +5374,8 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) RNA_def_struct_sdna(srna, "RemeshModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_REMESH); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, mode_items); RNA_def_property_ui_text(prop, "Mode", ""); @@ -5300,6 +5444,8 @@ static void rna_def_modifier_remesh(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Smooth Shading", "Output faces with smooth shading rather than flat shaded"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_ocean(BlenderRNA *brna) @@ -5357,6 +5503,8 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_struct_sdna(srna, "OceanModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_OCEAN); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "geometry_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "geometry_mode"); RNA_def_property_enum_items(prop, geometry_items); @@ -5550,6 +5698,8 @@ static void rna_def_modifier_ocean(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Cache Path", "Path to a folder to store external baked images"); /*RNA_def_property_update(prop, 0, "rna_Modifier_update"); */ /* XXX how to update? */ + + RNA_define_lib_overridable(false); } static void rna_def_modifier_skin(BlenderRNA *brna) @@ -5562,6 +5712,8 @@ static void rna_def_modifier_skin(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SkinModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_SKIN); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "branch_smoothing", PROP_FLOAT, PROP_FACTOR); RNA_def_property_ui_text(prop, "Branch Smoothing", "Smooth complex geometry around branches"); RNA_def_property_ui_range(prop, 0, 1, 1, -1); @@ -5587,6 +5739,8 @@ static void rna_def_modifier_skin(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "symmetry_axes", MOD_SKIN_SYMM_Z); RNA_def_property_ui_text(prop, "Z", "Avoid making unsymmetrical quads across the Z axis"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_triangulate(BlenderRNA *brna) @@ -5599,6 +5753,8 @@ static void rna_def_modifier_triangulate(BlenderRNA *brna) RNA_def_struct_sdna(srna, "TriangulateModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_TRIANGULATE); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "quad_method", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "quad_method"); RNA_def_property_enum_items(prop, rna_enum_modifier_triangulate_quad_method_items); @@ -5629,6 +5785,8 @@ static void rna_def_modifier_triangulate(BlenderRNA *brna) "Try to preserve custom normals (WARNING: depending on chosen triangulation method, " "shading may not be fully preserved, 'Fixed' method usually gives the best result here)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_meshcache(BlenderRNA *brna) @@ -5695,6 +5853,8 @@ static void rna_def_modifier_meshcache(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MeshCacheModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM); /* XXX, needs own icon */ + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "cache_format", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); RNA_def_property_enum_items(prop, prop_format_type_items); @@ -5789,6 +5949,8 @@ static void rna_def_modifier_meshcache(BlenderRNA *brna) RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_ui_text(prop, "Evaluation Factor", "Evaluation time in seconds"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_meshseqcache(BlenderRNA *brna) @@ -5801,6 +5963,8 @@ static void rna_def_modifier_meshseqcache(BlenderRNA *brna) RNA_def_struct_sdna(srna, "MeshSeqCacheModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM); /* XXX, needs own icon */ + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "cache_file", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "cache_file"); RNA_def_property_struct_type(prop, "CacheFile"); @@ -5829,6 +5993,8 @@ static void rna_def_modifier_meshseqcache(BlenderRNA *brna) RNA_def_property_enum_sdna(prop, NULL, "read_flag"); RNA_def_property_enum_items(prop, read_flag_items); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_laplaciandeform(BlenderRNA *brna) @@ -5841,6 +6007,8 @@ static void rna_def_modifier_laplaciandeform(BlenderRNA *brna) RNA_def_struct_sdna(srna, "LaplacianDeformModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "anchor_grp_name"); RNA_def_property_ui_text( @@ -5864,6 +6032,8 @@ static void rna_def_modifier_laplaciandeform(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + RNA_define_lib_overridable(false); + RNA_def_property_update(prop, 0, "rna_Modifier_update"); } @@ -5877,6 +6047,8 @@ static void rna_def_modifier_weld(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WeldModifierData"); RNA_def_struct_ui_icon(srna, ICON_AUTOMERGE_OFF); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "merge_threshold", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "merge_dist"); RNA_def_property_range(prop, 0, FLT_MAX); @@ -5904,6 +6076,8 @@ static void rna_def_modifier_weld(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WELD_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_wireframe(BlenderRNA *brna) @@ -5916,6 +6090,8 @@ static void rna_def_modifier_wireframe(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WireframeModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_WIREFRAME); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "thickness", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "offset"); RNA_def_property_range(prop, -FLT_MAX, FLT_MAX); @@ -5987,6 +6163,8 @@ static void rna_def_modifier_wireframe(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WIREFRAME_INVERT_VGROUP); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_datatransfer(BlenderRNA *brna) @@ -6048,6 +6226,8 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna) RNA_def_struct_sdna(srna, "DataTransferModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_DATA_TRANSFER); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "ob_source"); RNA_def_property_ui_text(prop, "Source Object", "Object to transfer data from"); @@ -6348,6 +6528,8 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna) srna, "invert_vertex_group", false, "Invert", "Invert vertex group influence"); RNA_def_property_boolean_sdna(prop, NULL, "flags", MOD_DATATRANSFER_INVERT_VGROUP); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_normaledit(BlenderRNA *brna) @@ -6387,6 +6569,8 @@ static void rna_def_modifier_normaledit(BlenderRNA *brna) RNA_def_struct_sdna(srna, "NormalEditModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_NORMALEDIT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Mode", "How to affect (generate) normals"); @@ -6469,6 +6653,8 @@ static void rna_def_modifier_normaledit(BlenderRNA *brna) "Use same direction for all normals, from origin to target's center " "(Directional mode only)"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_surfacedeform(BlenderRNA *brna) @@ -6481,6 +6667,8 @@ static void rna_def_modifier_surfacedeform(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SurfaceDeformModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_MESHDEFORM); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Target", "Mesh object to deform with"); RNA_def_property_pointer_funcs( @@ -6517,6 +6705,8 @@ static void rna_def_modifier_surfacedeform(BlenderRNA *brna) RNA_def_property_ui_range(prop, -100, 100, 10, 2); RNA_def_property_ui_text(prop, "Strength", "Strength of modifier deformations"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_weightednormal(BlenderRNA *brna) @@ -6548,6 +6738,8 @@ static void rna_def_modifier_weightednormal(BlenderRNA *brna) RNA_def_struct_sdna(srna, "WeightedNormalModifierData"); RNA_def_struct_ui_icon(srna, ICON_MOD_NORMALEDIT); + RNA_define_lib_overridable(true); + prop = RNA_def_property(srna, "weight", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 1, 100); RNA_def_property_ui_range(prop, 1, 100, 1, -1); @@ -6594,6 +6786,8 @@ static void rna_def_modifier_weightednormal(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_WEIGHTEDNORMAL_FACE_INFLUENCE); RNA_def_property_ui_text(prop, "Face Influence", "Use influence of face for weighting"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } static void rna_def_modifier_simulation_access(BlenderRNA *brna) @@ -6606,6 +6800,8 @@ static void rna_def_modifier_simulation_access(BlenderRNA *brna) RNA_def_struct_sdna(srna, "SimulationModifierData"); RNA_def_struct_ui_icon(srna, ICON_PHYSICS); /* TODO: Use correct icon. */ + RNA_define_lib_overridable(true); + # ifdef WITH_NEW_SIMULATION_TYPE prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE); RNA_def_property_ui_text(prop, "Simulation", "Simulation to access"); @@ -6617,6 +6813,8 @@ static void rna_def_modifier_simulation_access(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Data Path", "Identifier of the simulation component that should be accessed"); RNA_def_property_update(prop, 0, "rna_Modifier_update"); + + RNA_define_lib_overridable(false); } void RNA_def_modifier(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 6c21e4ad01b..6af031eb7b0 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -131,7 +131,7 @@ static void engine_bind_display_space_shader(RenderEngine *UNUSED(engine), Scene GPUShader *shader = GPU_shader_get_builtin_shader(GPU_SHADER_2D_IMAGE); GPU_shader_bind(shader); - int img_loc = GPU_shader_get_uniform_ensure(shader, "image"); + int img_loc = GPU_shader_get_uniform(shader, "image"); GPU_shader_uniform_int(shader, img_loc, 0); } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index e65d3eb18b0..3dc1d05810c 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2201,12 +2201,12 @@ static void rna_Scene_update_active_object_data(bContext *C, PointerRNA *UNUSED( } } -static void rna_SceneCamera_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +static void rna_SceneCamera_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; Object *camera = scene->camera; - BKE_sequence_invalidate_scene_strips(bmain, scene); + BKE_sequencer_cache_cleanup(scene); if (camera && (camera->type == OB_CAMERA)) { DEG_id_tag_update(&camera->id, ID_RECALC_GEOMETRY); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 45d7bc24017..39ea054456f 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -2016,7 +2016,7 @@ static void rna_def_editor(BlenderRNA *brna) RNA_def_property_ui_text( prop, "Prefetch Frames", - "Render frames ahead of playhead in the background for faster playback"); + "Render frames ahead of current frame in the background for faster playback"); RNA_def_property_update(prop, NC_SCENE | ND_SEQUENCER, NULL); prop = RNA_def_property(srna, "recycle_max_cost", PROP_FLOAT, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 2a64ffa73cd..8d0e403aa2d 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -485,6 +485,21 @@ static void rna_uiTemplateAnyID(uiLayout *layout, uiTemplateAnyID(layout, ptr, propname, proptypename, name); } +static void rna_uiTemplateCacheFile(uiLayout *layout, + bContext *C, + PointerRNA *ptr, + const char *propname) +{ + PropertyRNA *prop = RNA_struct_find_property(ptr, propname); + + if (!prop) { + RNA_warning("property not found: %s.%s", RNA_struct_identifier(ptr->type), propname); + return; + } + + uiTemplateCacheFile(layout, C, ptr, propname); +} + static void rna_uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const char *propname, @@ -1577,7 +1592,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_float_array( func, "color", 4, node_socket_color_default, 0.0f, 1.0f, "Color", "", 0.0f, 1.0f); - func = RNA_def_function(srna, "template_cache_file", "uiTemplateCacheFile"); + func = RNA_def_function(srna, "template_cache_file", "rna_uiTemplateCacheFile"); RNA_def_function_ui_description( func, "Item(s). User interface for selecting cache files and their source paths"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 479d0a0d1a7..49a0121dadb 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -360,7 +360,7 @@ static void rna_userdef_load_ui_update(Main *UNUSED(bmain), Scene *UNUSED(scene) static void rna_userdef_anisotropic_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - GPU_set_anisotropic(bmain, U.anisotropic_filter); + GPU_set_anisotropic(U.anisotropic_filter); rna_userdef_update(bmain, scene, ptr); } |