Notifications
Clear all

[Closed] Changing Maps and Properties by script

Hello everybody,

I have a question concerning maxscript.
In the past we used a map called “f-Edge” in the bump slot for creating the effect of rounded edges.
Nowadays we prefer using VRayEdgesTex because f-Edge is not working properly anymore. It causes too much errors during rendering.

Because of the huge amount of f-Edge scenes I try to replace all f-Edge maps by VRayEdgesTex maps by script. I use the following line for that:

for c in (getclassinstances f_Edge) do replaceinstances c (VRayEdgesTex name:c.name)

It works just perfect for me. The only problem is that it creates VRayEdgesTex maps with its default properties. But I need to change two values in order to look good.
The listener gives me the following output for the necessary changes:

rootScene[#SME][#VRayMtlView][#Map__25____VRayEdgesTex].Properties.reference.widthType = 0
rootScene[#SME][#VRayMtlView][#Map__25____VRayEdgesTex].Properties.reference.thickness = 0.12

Unfortunately I am a real noobie when it comes to scripting.
Can you please give me a hint how to combine these two scripts?

So in a nutshell:
replace f_Edge by VRayEdgesTex with widthType = 0 and thickness = 0.12

Thank you in advance!

Joe

2 Replies


f_edges_array = getClassInstances f_edge

for f_edge_tex in f_edges_array do
(
	 v_edge_tex = VRayEdgesTex name:f_edge_tex.name
	 v_edge_tex.widthType = 0
	 v_edge_tex.thickness = 0.12
	 replaceInstaces f_edge_tex v_edge_tex
)


Thanks a lot!
I will give it a try tomorrow