Commit: bab887fbfe3019a930beadbed2e493d8972caadf
Author: Bastien Montagne
Date:   Sun May 27 18:23:14 2018 +0200
Branches: temp-dynamic-overrides
https://developer.blender.org/rBbab887fbfe3019a930beadbed2e493d8972caadf

Fix 'broken' Multiply operation for Dynamic Overrides.

No reason to store operands of Multiply op in a separate property! Let's
keep things simple ;)

===================================================================

M       release/scripts/startup/bl_ui/properties_view_layer.py
M       source/blender/blenkernel/intern/layer.c
M       source/blender/makesdna/DNA_layer_types.h
M       source/blender/makesrna/intern/rna_dynamic_override.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/properties_view_layer.py 
b/release/scripts/startup/bl_ui/properties_view_layer.py
index 302264f15fd..a632d33a311 100644
--- a/release/scripts/startup/bl_ui/properties_view_layer.py
+++ b/release/scripts/startup/bl_ui/properties_view_layer.py
@@ -198,10 +198,7 @@ class VIEWLAYER_OT_overrides(ViewLayerButtonsPanel, Panel):
 
         if override_mode_support:
             subrow.prop(dyn_prop, "override_mode", text="")
-            if dyn_prop.override_mode == 'MULTIPLY':
-                subrow.prop(dyn_prop, "multiply_factor", text="")
-            else:
-                subrow.prop(dyn_prop, value_propname, text="")
+            subrow.prop(dyn_prop, value_propname, text="")
         elif value_propname is not None:
             subrow.prop(dyn_prop, value_propname, text="")
 
diff --git a/source/blender/blenkernel/intern/layer.c 
b/source/blender/blenkernel/intern/layer.c
index 68333ec6b36..c1978b5ec43 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -1131,7 +1131,6 @@ DynamicOverrideProperty 
*BKE_view_layer_override_property_add(
 
        DynamicOverrideProperty *dyn_prop = 
MEM_callocN(sizeof(DynamicOverrideProperty), __func__);
        dyn_prop->flag = DYN_OVERRIDE_PROP_USE;
-       dyn_prop->multiply_factor = 1.0f;
        dyn_prop->operation = IDOVERRIDESTATIC_OP_REPLACE;
        /* TODO: We want to store the id only when the rna path is only 
relevant to
         * this particular object (e.g., modifiers of an object) .*/
diff --git a/source/blender/makesdna/DNA_layer_types.h 
b/source/blender/makesdna/DNA_layer_types.h
index 4742c062424..ee6549f3f53 100644
--- a/source/blender/makesdna/DNA_layer_types.h
+++ b/source/blender/makesdna/DNA_layer_types.h
@@ -73,13 +73,12 @@ typedef struct DynamicOverrideProperty {
        struct ID *root;
        char *rna_path;
        struct ListBase data_path; /* runtime: (RNAProperty *)LinkData->data */
-       float multiply_factor;
        short flag;
        short property_type; /* eDynamicOverridePropertyType */
        short operation; /* See IDOVERRIDESTATIC_OP_ enums in DNA_ID.h */
        short id_type;
        short array_len;
-       short pad;
+       short pad[3];
 } DynamicOverrideProperty;
 
 typedef struct OverrideSet {
diff --git a/source/blender/makesrna/intern/rna_dynamic_override.c 
b/source/blender/makesrna/intern/rna_dynamic_override.c
index ca12dfd87f4..116c5031419 100644
--- a/source/blender/makesrna/intern/rna_dynamic_override.c
+++ b/source/blender/makesrna/intern/rna_dynamic_override.c
@@ -237,12 +237,6 @@ void RNA_def_dynamic_override(BlenderRNA *brna)
                                 "Method of override the original values");
        RNA_def_property_update(prop, NC_SCENE | ND_DYN_OVERRIDES, NULL);
 
-       prop = RNA_def_property(srna, "multiply_factor", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_range(prop, -FLT_MAX, FLT_MAX);
-       RNA_def_property_ui_range(prop, -10.0f, 10.0f, 5, 3);
-       RNA_def_property_ui_text(prop, "Factor", "Multiplication factor");
-       RNA_def_property_update(prop, NC_SCENE | ND_DYN_OVERRIDES, NULL);
-
        prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_items(prop, rna_enum_property_type_items);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to