diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-03 17:02:11 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-05-03 17:02:11 +0300 |
commit | 49407122ea6852704a43cc2df5de0f5179758491 (patch) | |
tree | fff5f06b52a4287ae251142985653f75ec73639b /source/blender/makesrna/intern | |
parent | 69710301cc69b534ee652a45d4749c2c2410426c (diff) | |
parent | b2b9efbe6d35566f67b95ab6273fe4dba728d807 (diff) |
Merge branch 'blender2.8' into tmp-static-override-insertion
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 183 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 14 |
2 files changed, 44 insertions, 153 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index 80f06cc52f3..f964550e30d 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -520,25 +520,31 @@ static void rna_def_constraint_headtail_common(StructRNA *srna) RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_update"); } -static void rna_def_constrainttarget(BlenderRNA *brna) +static void rna_def_constraint_target_common(StructRNA *srna) { - StructRNA *srna; PropertyRNA *prop; - srna = RNA_def_struct(brna, "ConstraintTarget", NULL); - RNA_def_struct_ui_text(srna, "Constraint Target", "Target object for multi-target constraints"); - RNA_def_struct_sdna(srna, "bConstraintTarget"); - 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"); + RNA_def_property_ui_text(prop, "Target", "Target object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); + 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"); +} + +static void rna_def_constrainttarget(BlenderRNA *brna) +{ + StructRNA *srna; + + srna = RNA_def_struct(brna, "ConstraintTarget", NULL); + RNA_def_struct_ui_text(srna, "Constraint Target", "Target object for multi-target constraints"); + RNA_def_struct_sdna(srna, "bConstraintTarget"); + + rna_def_constraint_target_common(srna); /* space, flag and type still to do */ } @@ -552,16 +558,7 @@ static void rna_def_constraint_childof(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Child Of Constraint", "Create constraint-based parent-child relationship"); RNA_def_struct_sdna_from(srna, "bChildOfConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "use_location_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", CHILDOF_LOCX); @@ -672,16 +669,7 @@ static void rna_def_constraint_kinematic(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Kinematic Constraint", "Inverse Kinematics"); RNA_def_struct_sdna_from(srna, "bKinematicConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "iterations", PROP_INT, PROP_NONE); RNA_def_property_range(prop, 0, 10000); @@ -828,16 +816,7 @@ static void rna_def_constraint_track_to(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bTrackToConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "reserved1"); @@ -869,17 +848,7 @@ static void rna_def_constraint_locate_like(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bLocateLikeConstraint", "data"); - prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tar"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Target", "Target Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LOCLIKE_X); @@ -926,16 +895,7 @@ static void rna_def_constraint_rotate_like(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Copy Rotation Constraint", "Copy the rotation of the target"); RNA_def_struct_sdna_from(srna, "bRotateLikeConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", ROTLIKE_X); @@ -982,17 +942,7 @@ static void rna_def_constraint_size_like(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Copy Scale Constraint", "Copy the scale of the target"); RNA_def_struct_sdna_from(srna, "bSizeLikeConstraint", "data"); - prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, NULL, "tar"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_ui_text(prop, "Target", "Target Object"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "use_x", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", SIZELIKE_X); @@ -1048,7 +998,6 @@ static void rna_def_constraint_same_volume(BlenderRNA *brna) static void rna_def_constraint_transform_like(BlenderRNA *brna) { StructRNA *srna; - PropertyRNA *prop; srna = RNA_def_struct(brna, "CopyTransformsConstraint", "Constraint"); RNA_def_struct_ui_text(srna, "Copy Transforms Constraint", "Copy all the transforms of the target"); @@ -1057,16 +1006,7 @@ static void rna_def_constraint_transform_like(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bTransLikeConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); } static void rna_def_constraint_minmax(BlenderRNA *brna) @@ -1088,16 +1028,7 @@ static void rna_def_constraint_minmax(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Floor Constraint", "Use the target object for location limitation"); RNA_def_struct_sdna_from(srna, "bMinMaxConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "floor_location", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "minmaxflag"); @@ -1143,16 +1074,7 @@ static void rna_def_constraint_action(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Action Constraint", "Map an action to the transform axes of a bone"); RNA_def_struct_sdna_from(srna, "bActionConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "transform_channel", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "type"); @@ -1232,16 +1154,7 @@ static void rna_def_constraint_locked_track(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bLockTrackConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); @@ -1285,7 +1198,7 @@ static void rna_def_constraint_follow_path(BlenderRNA *brna) prop = RNA_def_property(srna, "target", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "tar"); RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_Curve_object_poll"); - RNA_def_property_ui_text(prop, "Target", "Target Object"); + RNA_def_property_ui_text(prop, "Target", "Target Curve object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); @@ -1356,16 +1269,7 @@ static void rna_def_constraint_stretch_to(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bStretchToConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "volume", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "volmode"); @@ -1470,16 +1374,7 @@ static void rna_def_constraint_transform(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Transformation Constraint", "Map transformations of the target to the object"); RNA_def_struct_sdna_from(srna, "bTransformConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "map_from", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "from"); @@ -1976,16 +1871,7 @@ static void rna_def_constraint_distance_limit(BlenderRNA *brna) RNA_def_struct_sdna_from(srna, "bDistLimitConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "distance", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "dist"); @@ -2027,7 +1913,7 @@ static void rna_def_constraint_shrinkwrap(BlenderRNA *brna) 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"); - RNA_def_property_ui_text(prop, "Target", "Target Object"); + RNA_def_property_ui_text(prop, "Target", "Target Mesh object"); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); @@ -2087,16 +1973,7 @@ rna_def_constraint_headtail_common(srna); RNA_def_struct_sdna_from(srna, "bDampTrackConstraint", "data"); - 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"); - RNA_def_property_flag(prop, PROP_EDITABLE); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); - - prop = RNA_def_property(srna, "subtarget", PROP_STRING, PROP_NONE); - RNA_def_property_string_sdna(prop, NULL, "subtarget"); - RNA_def_property_ui_text(prop, "Sub-Target", ""); - RNA_def_property_update(prop, NC_OBJECT | ND_CONSTRAINT, "rna_Constraint_dependency_update"); + rna_def_constraint_target_common(srna); prop = RNA_def_property(srna, "track_axis", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "trackflag"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 8cef700e934..6feec355808 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2201,6 +2201,14 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) {V3D_DRAWOPTION_RANDOMIZE, "RANDOM", 0, "Random", "Show random object color"}, {0, NULL, 0, NULL, NULL} }; + static const EnumPropertyItem studio_lighting_items[] = { + {0, "01", ICON_STUDIOLIGHT_01, "", ""}, + {1, "02", ICON_STUDIOLIGHT_02, "", ""}, + {2, "03", ICON_STUDIOLIGHT_03, "", ""}, + {3, "04", ICON_STUDIOLIGHT_04, "", ""}, + {4, "05", ICON_STUDIOLIGHT_05, "", ""}, + {0, NULL, 0, NULL, NULL} + }; srna = RNA_def_struct(brna, "View3DShading", NULL); RNA_def_struct_sdna(srna, "View3D"); @@ -2228,6 +2236,12 @@ static void rna_def_space_view3d_shading(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Object Overlap", "Show Object Overlap"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + prop = RNA_def_property(srna, "studiolight", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "drawtype_studiolight"); + RNA_def_property_enum_items(prop, studio_lighting_items); + RNA_def_property_ui_text(prop, "Studiolight", "Studio lighting setup"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, "rna_3DViewShading_type_update"); + prop = RNA_def_property(srna, "single_color_mode", PROP_ENUM, PROP_NONE); RNA_def_property_enum_items(prop, single_color_mode_items); RNA_def_property_enum_funcs(prop, "rna_View3DShading_single_color_mode_get", |