I want to link geometries from 3ds max files which have lights and cameras. I found code to link all assets from a 3ds Max file. I am stuck with linking only a specific type from a file. Is there a way to do this?
Here is the code so far,
obj_names = getMAXFileObjectNames "filename.max"
xref_objs = #()
for obj in obj_names do(
if matchpattern obj pattern:"Cam*"ignoreCase:false do continue
if matchpattern obj pattern:"VRayLight*"ignoreCase:false do continue
append xref_objs obj
)
xrefs.addnewXrefObject "filename.max" xref_objs
objXRefMgr.getAutoUpdate = true
The above code works for most cases but it is not reliable when the linking file doesn’t follow a pattern in cameras and lights.