Hide the hierarchy of objects

Hide the hierarchy of objects

dg3duy
Collaborator Collaborator
1,471 Views
3 Replies
Message 1 of 4

Hide the hierarchy of objects

dg3duy
Collaborator
Collaborator

I am hiding all the objects in a hierarchy but I need to not hide the objects that are editable poly and mesh that are still visible.
I am currently using a function that selects the entire hierarchy and hides the objects.

hide.gif

 

 

	

fn getChildren obj includeParent:false selectObjs:false =
(
children = for c in obj.children collect c
for c in children do join children (for c in c.children collect c)
if includeParent do append children obj
if selectObjs do select children
children
hide children obj
)
getChildren $Character_root_Ctrl





fn getChildreninverse obj includeParent:false selectObjs:false =
(
children = for c in obj.children collect c
for c in children do join children (for c in c.children collect c)
if includeParent do append children obj
if selectObjs do select children
children
unhide children obj
clearselection()
)

getChildreninverse $Character_root_Ctrl

 


 

0 Likes
Accepted solutions (1)
1,472 Views
3 Replies
Replies (3)
Message 2 of 4

denisT.MaxDoctor
Advisor
Advisor

here is all you need:

fn getHierarchy root = (join #() root)
fn isEditablePolyMesh node = (iskindof node Editable_Poly or iskindof node Editable_Mesh)
fn excludeEdidablePolyMesh nodes = 
(
	for node in nodes where not isEditablePolyMesh node collect node  
)
fn collectEdidablePolyMesh nodes = 
(
	for node in nodes where isEditablePolyMesh node collect node  
)

/*
nodes = getHierarchy $
are_epms = collectEdidablePolyMesh nodes
not_epms = excludeEdidablePolyMesh nodes
*/

 

0 Likes
Message 3 of 4

denisT.MaxDoctor
Advisor
Advisor
Accepted solution
fn getHierarchy root = (join #() root)
fn isEditablePolyMesh node = (iskindof node Editable_Poly or iskindof node Editable_Mesh)
fn excludeEditablePolyMesh nodes = 
(
	for node in nodes where not isEditablePolyMesh node collect node  
)
fn collectEditablePolyMesh nodes = 
(
	for node in nodes where isEditablePolyMesh node collect node  
)

/*
nodes = getHierarchy $
are_epms = collectEditablePolyMesh nodes
not_epms = excludeEditablePolyMesh nodes
*/

 

PS. Fixed some misspellings

Message 4 of 4

dg3duy
Collaborator
Collaborator

Thank you very much!

0 Likes