diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-19 13:26:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-03-19 13:26:15 +0300 |
commit | ff1656175ac6a408bef1b77abd91406cdf895c93 (patch) | |
tree | bda36efec5bcced971d99687cb223e0ac050f3b4 | |
parent | e9005b985ef283d952aaaa7486d42ad6a48fb117 (diff) |
Fix #26543: lamp sky settings were missing soft/linear light blend types,
made enum items shared with material ramp and mix node.
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_lamp.c | 22 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 46 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 24 | ||||
-rw-r--r-- | source/blender/nodes/intern/node_util.c | 2 |
5 files changed, 30 insertions, 67 deletions
diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index b9fb7c89468..d156387eaba 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -102,11 +102,12 @@ extern EnumPropertyItem viewport_shade_items[]; extern EnumPropertyItem node_socket_type_items[]; -extern EnumPropertyItem node_blend_type_items[]; extern EnumPropertyItem node_math_items[]; extern EnumPropertyItem node_vec_math_items[]; extern EnumPropertyItem node_filter_items[]; +extern EnumPropertyItem ramp_blend_items[]; + struct bContext; struct PointerRNA; EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, int *free); diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 225a72bb073..5f274a09f5d 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -30,6 +30,7 @@ #include <stdlib.h> #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -217,25 +218,6 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) {2, "CIE", 0, "CIE", ""}, {0, NULL, 0, NULL, NULL}}; - static EnumPropertyItem prop_blendmode_items[] = { - {0, "MIX", 0, "Mix", ""}, - {1, "ADD", 0, "Add", ""}, - {2, "MULTIPLY", 0, "Multiply", ""}, - {3, "SUBTRACT", 0, "Subtract", ""}, - {4, "SCREEN", 0, "Screen", ""}, - {5, "DIVIDE", 0, "Divide", ""}, - {6, "DIFFERENCE", 0, "Difference", ""}, - {7, "DARKEN", 0, "Darken", ""}, - {8, "LIGHTEN", 0, "Lighten", ""}, - {9, "OVERLAY", 0, "Overlay", ""}, - {10, "DODGE", 0, "Dodge", ""}, - {11, "BURN", 0, "Burn", ""}, - {12, "HUE", 0, "Hue", ""}, - {13, "SATURATION", 0, "Saturation", ""}, - {14, "VALUE", 0, "Value", ""}, - {15, "COLOR", 0, "Color", ""}, - {0, NULL, 0, NULL, NULL}}; - srna= RNA_def_struct(brna, "LampSkySettings", NULL); RNA_def_struct_sdna(srna, "Lamp"); RNA_def_struct_nested(brna, srna, "SunLamp"); @@ -249,7 +231,7 @@ static void rna_def_lamp_sky_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "sky_blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "skyblendtype"); - RNA_def_property_enum_items(prop, prop_blendmode_items); + RNA_def_property_enum_items(prop, ramp_blend_items); RNA_def_property_ui_text(prop, "Sky Blend Mode", "Blend mode for combining sun sky with world sky"); RNA_def_property_update(prop, 0, "rna_Lamp_sky_update"); diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index e593f305094..e65bc020334 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -54,6 +54,27 @@ static EnumPropertyItem prop_texture_coordinates_items[] = { {TEXCO_TANGENT, "TANGENT", 0, "Tangent", "Uses the optional tangent vector as texture coordinates"}, {0, NULL, 0, NULL, NULL}}; +EnumPropertyItem ramp_blend_items[] = { +{MA_RAMP_BLEND, "MIX", 0, "Mix", ""}, +{MA_RAMP_ADD, "ADD", 0, "Add", ""}, +{MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""}, +{MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""}, +{MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""}, +{MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""}, +{MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""}, +{MA_RAMP_DARK, "DARKEN", 0, "Darken", ""}, +{MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""}, +{MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""}, +{MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""}, +{MA_RAMP_BURN, "BURN", 0, "Burn", ""}, +{MA_RAMP_HUE, "HUE", 0, "Hue", ""}, +{MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""}, +{MA_RAMP_VAL, "VALUE", 0, "Value", ""}, +{MA_RAMP_COLOR, "COLOR", 0, "Color", ""}, +{MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""}, +{MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""}, +{0, NULL, 0, NULL, NULL}}; + #ifdef RNA_RUNTIME #include "MEM_guardedalloc.h" @@ -711,27 +732,6 @@ static void rna_def_material_mtex(BlenderRNA *brna) static void rna_def_material_colors(StructRNA *srna) { PropertyRNA *prop; - - static EnumPropertyItem prop_ramp_blend_diffuse_items[] = { - {MA_RAMP_BLEND, "MIX", 0, "Mix", ""}, - {MA_RAMP_ADD, "ADD", 0, "Add", ""}, - {MA_RAMP_MULT, "MULTIPLY", 0, "Multiply", ""}, - {MA_RAMP_SUB, "SUBTRACT", 0, "Subtract", ""}, - {MA_RAMP_SCREEN, "SCREEN", 0, "Screen", ""}, - {MA_RAMP_DIV, "DIVIDE", 0, "Divide", ""}, - {MA_RAMP_DIFF, "DIFFERENCE", 0, "Difference", ""}, - {MA_RAMP_DARK, "DARKEN", 0, "Darken", ""}, - {MA_RAMP_LIGHT, "LIGHTEN", 0, "Lighten", ""}, - {MA_RAMP_OVERLAY, "OVERLAY", 0, "Overlay", ""}, - {MA_RAMP_DODGE, "DODGE", 0, "Dodge", ""}, - {MA_RAMP_BURN, "BURN", 0, "Burn", ""}, - {MA_RAMP_HUE, "HUE", 0, "Hue", ""}, - {MA_RAMP_SAT, "SATURATION", 0, "Saturation", ""}, - {MA_RAMP_VAL, "VALUE", 0, "Value", ""}, - {MA_RAMP_COLOR, "COLOR", 0, "Color", ""}, - {MA_RAMP_SOFT, "SOFT_LIGHT", 0, "Soft Light", ""}, - {MA_RAMP_LINEAR, "LINEAR_LIGHT", 0, "Linear Light", ""}, - {0, NULL, 0, NULL, NULL}}; static EnumPropertyItem prop_ramp_input_items[] = { {MA_RAMP_IN_SHADER, "SHADER", 0, "Shader", ""}, @@ -796,13 +796,13 @@ static void rna_def_material_colors(StructRNA *srna) prop= RNA_def_property(srna, "diffuse_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_col"); - RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items); + RNA_def_property_enum_items(prop, ramp_blend_items); RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); RNA_def_property_update(prop, 0, "rna_Material_update"); prop= RNA_def_property(srna, "specular_ramp_blend", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "rampblend_spec"); - RNA_def_property_enum_items(prop, prop_ramp_blend_diffuse_items); + RNA_def_property_enum_items(prop, ramp_blend_items); RNA_def_property_ui_text(prop, "Diffuse Ramp Blend", ""); RNA_def_property_update(prop, 0, "rna_Material_update"); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0ebf606e7fa..a043b7b17da 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -31,6 +31,7 @@ #include <string.h> #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -59,27 +60,6 @@ EnumPropertyItem node_socket_type_items[] = { {SOCK_RGBA, "RGBA", 0, "RGBA", ""}, {0, NULL, 0, NULL, NULL}}; -EnumPropertyItem node_blend_type_items[] = { -{ 0, "MIX", 0, "Mix", ""}, -{ 1, "ADD", 0, "Add", ""}, -{ 3, "SUBTRACT", 0, "Subtract", ""}, -{ 2, "MULTIPLY", 0, "Multiply", ""}, -{ 4, "SCREEN", 0, "Screen", ""}, -{ 9, "OVERLAY", 0, "Overlay", ""}, -{ 5, "DIVIDE", 0, "Divide", ""}, -{ 6, "DIFFERENCE", 0, "Difference", ""}, -{ 7, "DARKEN", 0, "Darken", ""}, -{ 8, "LIGHTEN", 0, "Lighten", ""}, -{10, "DODGE", 0, "Dodge", ""}, -{11, "BURN", 0, "Burn", ""}, -{15, "COLOR", 0, "Color", ""}, -{14, "VALUE", 0, "Value", ""}, -{13, "SATURATION", 0, "Saturation", ""}, -{12, "HUE", 0, "Hue", ""}, -{16, "SOFT_LIGHT", 0, "Soft Light", ""}, -{17, "LINEAR_LIGHT", 0, "Linear Light",""}, -{0, NULL, 0, NULL, NULL}}; - EnumPropertyItem node_math_items[] = { { 0, "ADD", 0, "Add", ""}, { 1, "SUBTRACT", 0, "Subtract", ""}, @@ -896,7 +876,7 @@ static void def_mix_rgb(StructRNA *srna) prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "custom1"); - RNA_def_property_enum_items(prop, node_blend_type_items); + RNA_def_property_enum_items(prop, ramp_blend_items); RNA_def_property_ui_text(prop, "Blend Type", ""); RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update"); diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c index 76c469ee8f8..1cc8c282179 100644 --- a/source/blender/nodes/intern/node_util.c +++ b/source/blender/nodes/intern/node_util.c @@ -61,7 +61,7 @@ void node_copy_standard_storage(bNode *orig_node, bNode *new_node) const char *node_blend_label(bNode *node) { const char *name; - RNA_enum_name(node_blend_type_items, node->custom1, &name); + RNA_enum_name(ramp_blend_items, node->custom1, &name); return name; } |