Direct access the material properties via pymxs

Direct access the material properties via pymxs

Carlo3000
Contributor Contributor
610 Views
7 Replies
Message 1 of 8

Direct access the material properties via pymxs

Carlo3000
Contributor
Contributor

Screenshot 2022-05-23 140535.jpgHi, I'm completely lost on this seemingly simple task.

I need to access the existing Octane's mix_material_001 and change the amount_value from 0 to 1 in Pymxs.

I know how to create the box, create the material and assigned it.

from pymxs import runtime as rt

t = rt.box()
m = rt.Mix_material()
t.material=m
m.amount_value = rt.float(1)



But how to directly access the already created "mix_material_001" without creating one?

m = rt.getClassInstances("mix_material_001") is not working.


Is there some lean code to directly access the scene material?

0 Likes
Accepted solutions (2)
611 Views
7 Replies
Replies (7)
Message 2 of 8

denisT.MaxDoctor
Advisor
Advisor
0 Likes
Message 3 of 8

Carlo3000
Contributor
Contributor

still searching for the solution

0 Likes
Message 4 of 8

Carlo3000
Contributor
Contributor

sorry, but I searched this help page before and I didn't find the solution on how to get specific material properties directly by material name. Is there a solution to access the material by its name without loops?

like the function to get the object by its name :
rt.getNodeByName('object_name')

the similar function, but for the material.

0 Likes
Message 6 of 8

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

@Swordslayer wrote:

 

 

updateSceneMaterialLib()

 

👍

0 Likes
Message 7 of 8

Carlo3000
Contributor
Contributor

it works and it's so simpler than going for loops for every scene material. 🙂 
thank you!

0 Likes
Message 8 of 8

Carlo3000
Contributor
Contributor

thank you!

0 Likes