Notifications
Clear all

[Closed] Get all textures that are classof VrayDirt

Hello,
I need some help with collecting all the scene’s vrayDirt textures. I get stuck on the class of “textures”

for t in textures where classof t == VRayDirt do t.subdivs = 100

I’m not sure how the class “textures” is called.

Any help would be appreciated
Thanks

5 Replies
2 Replies
(@gazybara)
Joined: 10 months ago

Posts: 0
fn setDirtValue value: =
(
	if (dirt = getclassinstances VRayDirt).count > 0 do 
	(
		for d in dirt do d.subdivs = value
	)
)
setDirtValue value:100
(@zarko)
Joined: 10 months ago

Posts: 0

Thanks a lot. Very elegant and simple solution

 lo1

May I suggest a reduction

(getClassInstances VRayDirt).subdivs = value
2 Replies
(@gazybara)
Joined: 10 months ago

Posts: 0

What if we not have VrayDirt map in the scene?
That’s way I recommended this fn

 lo1
(@lo1)
Joined: 10 months ago

Posts: 0

Then it will just do nothing.