Open pterusgithub opened 2 days ago
Hi,
Thanks for using my module.
node._bnode.color_ramp.elements
is the collection of stops.However, to make things easier, I just implemented the set_stops
method on the color ramp node in order to set up the stops.
When initializing a color ramp node, the key word argument stops
has been added:
snd.color_ramp(stops=list of stops)
(position, color)
To make the script work, your need to download the last version.
BR
with geon.ShaderNodes("snowman_texture"):
# ----- Principled BSDF
textu_coord = geon.snd.texture_coordinate().object
mapping = geon.snd.mapping(vector=textu_coord)
texture_01 = geon.snd.noise_texture(vector=mapping,scale=4).color
texture_02 = geon.snd.noise_texture(vector=mapping,scale=500,roughness=0,detail=0, distortion = 0).color
mix = geon.snd.mix(factor=0.1, a=texture_01,b=texture_02,data_type="RGBA").result
colorramp = geon.snd.color_ramp(fac=mix).color
colorramp.node.set_stops((0, (0, 0, 1)), (.5, 1), (.9, (1, 0, 0, .5)))
ped = geon.snd.principled_bsdf(base_color=colorramp)
# ----- To surface output
ped.out()
Hi al1brn, Thank you so much for this fix and the additional features you’ve provided. I truly appreciate your responsiveness and the effort you put into helping out. Wishing you a wonderful day!
Hi there, I'm trying to create a surface material for a snowman (Christmas spirit, of course!). However, I'm struggling to understand why my code isn't working. The links between the noise_texture and mix nodes don't function as expected, although the rest seems to work fine.
While I'm at it, could you provide an example of how to use the color_ramp node? Specifically, how to change the colors, add stops, and so on?
Here’s the relevant part of the code I’m using:
Thanks in advance!