[Closed] Determining invisible objects
Is there a way to determine if an object is invisible to the “select by name” dialog via maxscript?
For example : Particle flow events and operators, RPM property holders etc. all exist as objects in the scene but are not selectable via the “select by name” dialog.
Any help would be greatly appreciated.
Yes.
It is quite hacky actually, the Select By Name checks for the class ID of the object and if the second component of the ID is 515064320, the object becomes invisible.
For example, create a Standard PFlow and check a couple of its operators:
$Position_Icon_01.classid
#(1962490631, 515064320)
$Speed_01.classid
#(1962490632, 515064320)
$Shape_01.classid
#(1395943169, 515064320)
Now open the MAXScript help on the page “Scripted Geometry Plug-ins” and copy the example of Cuboid into a MAXScript Editor. Evaluate, go to Create > Geometry >Scripted Plugins and create a Cuboid object. Look in the Select By Name and it will be there.
Now edit the code by changing the class name to Cuboid2 and the second element of the ClassID to 515064320. Evaluate, create a Cuboid2 object in the scene and look in Select By Name – the new object is NOT displayed!
This method seems to work well for most objects, but does not encompass particle flow events, and a few others.
Below is what I came up with to encompass the extra objects.
fn getVisibleObjects objs =
(
objs = for obj in objs where obj.classid[2] != 515064320 and obj.classid[2] != 515064576 and obj.classid[2] != 1460709121 collect obj
objs
)
Thanks for your quick response Bobo.
Good job, these seem to be the other classIDs being filtered.
I just created a cuboid3 class using 515064576 and it got filtered out, so the above code should work.