Fix #116256: Unintentional override of node type property in API
Rename new noise node type to avoid conflict with node type. Pull Request: https://projects.blender.org/blender/blender/pulls/116278
This commit is contained in:
committed by
Brecht Van Lommel
parent
1a92fbf31a
commit
f7e8021b2a
@@ -936,7 +936,7 @@ static ShaderNode *add_node(Scene *scene,
|
||||
BL::ShaderNodeTexNoise b_noise_node(b_node);
|
||||
NoiseTextureNode *noise = graph->create_node<NoiseTextureNode>();
|
||||
noise->set_dimensions(b_noise_node.noise_dimensions());
|
||||
noise->set_type((NodeNoiseType)b_noise_node.type());
|
||||
noise->set_type((NodeNoiseType)b_noise_node.noise_type());
|
||||
noise->set_use_normalize(b_noise_node.normalize());
|
||||
BL::TexMapping b_texture_mapping(b_noise_node.texture_mapping());
|
||||
get_tex_mapping(noise, b_texture_mapping);
|
||||
|
||||
@@ -4920,7 +4920,7 @@ static void def_sh_tex_noise(StructRNA *srna)
|
||||
RNA_def_property_ui_text(prop, "Dimensions", "Number of dimensions to output noise for");
|
||||
RNA_def_property_update(prop, 0, "rna_ShaderNode_socket_update");
|
||||
|
||||
prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
|
||||
prop = RNA_def_property(srna, "noise_type", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "type");
|
||||
RNA_def_property_enum_items(prop, prop_noise_type);
|
||||
RNA_def_property_ui_text(prop, "Type", "Type of the Noise texture");
|
||||
|
||||
@@ -50,7 +50,7 @@ static void sh_node_tex_noise_declare(NodeDeclarationBuilder &b)
|
||||
static void node_shader_buts_tex_noise(uiLayout *layout, bContext * /*C*/, PointerRNA *ptr)
|
||||
{
|
||||
uiItemR(layout, ptr, "noise_dimensions", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
|
||||
uiItemR(layout, ptr, "type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
|
||||
uiItemR(layout, ptr, "noise_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE);
|
||||
if (ELEM(RNA_enum_get(ptr, "type"), SHD_NOISE_FBM)) {
|
||||
uiItemR(layout, ptr, "normalize", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user