Notifications
Clear all

[Closed] how to use the "collect "command?

the problem of the method above is that you can have in the scene multiple bitmap texture equivalents… so using of finditem is not trustworthy method. you have to write more correct search by using pathConfig.pathsResolveEquivalent

maybe if i describe the situation

I have an mxs tool that compiles the textures of single mesh and converts them for game use.

imagine a max file for a game character, a knight.
with meshes for : body , sword, shield, bow, cloak
there’s a material for the body, another for the cloak, but all 3 weapon accessories share a third material

I only need to pass 3 of the 5 meshes to my tool to get all the materials converted,
so how to narrow the available number to only unique materials?

(yes there is a smarter way to do this but now I’m curious)

2 Replies
(@denist)
Joined: 11 months ago

Posts: 0

if objects have the same material you have to search them by material instead of by texture…

(@denist)
Joined: 11 months ago

Posts: 0

something like this:

nodes = #() 
for mat in scenematerials where (node = refs.dependentnodes mat firstOnly:on) != undefined do appendifunique nodes node
nodes

i don’t know in what order refs.dependentnodes returns dependent nodes… maybe you have to get them all and sort the list (by anim handle, or inode handle, or name… orwhatever you like) to define which one you want to see the first.

Page 3 / 3