I know there was already a post with a similar question, but it really beats me
Here is the original thread: viewtopic.php?f=73&t=37602
My problem:
I try to change a node from "Diffuse" to "Glossy", because the exporter of the DAZ Studio exports all materials as diffuse ones.
Here is my little piece of code, which does not work (in the output I can see that the type changed to "glossy"):
-- Get the selected mesh.
local mesh = octane.project.getSelection()[1]
assert(mesh:getProperties().type == octane.NT_GEO_MESH, "mesh expected")
local matNode = mesh:getConnectedNode('Torso')
if matNode then
print(string.format("material %s", matNode:getProperties().name))
matProps = matNode:getProperties()
-- change to glossy
matProps['type'] = octane.NT_MAT_GLOSSY
matNode:updateProperties(matProps)
octane.nodegraph.evaluate(matNode)
octane.changemanager.update()
print "---------- Properties ----------"
for key,value in pairs(matProps) do print(key,value) end
end
Any help or code snippet would be very appreciated
Thx,
Christian