[Closed] Xref Scene override material/properties
If you’re using Vray, check out the multiMatteElement, it does just that for MaterialID’s or Gbuffer Id’s… no Material changes required… it’s F’n Sweet… downside, only three matte’s per image…
tnXref = xrefs.getxreffile 2
for i = 1 to tnXref.tree.children.count do
(
tnXref.tree.children[i].primaryVisibility = off
tnXref.tree.children[i].inheritVisibility = on
)
Why doesn’t this work? Some of my objects are still visible whereas some are invisible.
tnXref.tree.children.count = 122
But the number of objects in the Xreffed scene is 192, it appears to be ignoring objects in groups or objects that have references in.
I’m using 3dsmax 9 32bit (no SP)
What do you mean by “have references in?” Do you have X-ref objects or a nested xref-Scene that you are then X-ref’n?
Setup:
“Nine Boxes.max” xref’d into max file Nine Spheres.
“Nine Spheres.max” then Xref’d into fresh session of max.
Listener:
NineSpheres=xrefs.getXRefFile 1
XRefScene:"Nine_Spheres.max"
NineBoxes= xrefs.getXRefFile 1 root:NineSpheres
XRefScene:"Nine_Boxes.max"
NineBoxes.tree.children
#children($Box01, $Box02, $Box03, $Box04, $Box05, $Box06, $Box07, $Box08, $Box09)
Just tried the group thing too… yes applying a material to the group head does NOT apply the material to the entire group… So you’ll have to check each object to see if they have children… if so then recurse to apply to those, while checking to see if those objects have children… Ya gotta round up all the kids, manually…
ns = xrefs.getXRefFile 1
XRefScene:"Nine_Spheres.max"
ns.tree.children
#children($Sphere01, $Sphere02, $Sphere05, $Sphere08, $Group01)
ns.tree.children[5].material = standardMAterial()
Standardmaterial:Standard
ns.tree.children[5].children[3].material
[color=white]undefined
[/color]