Notifications
Clear all

[Closed] check for hide geometry

hello, i need to check this two things in a model, I search in the forum but cant find a solution

  1. i need to find a way to check if an object have hiden geometry before to export it
  2. check if the object need to use the modifier xform, this becuase the exporter that i use export the object wihout the parameters of the scale transform or rotate transform, so the exported object result in something rotated and scaled different of the viewport.

thanks

4 Replies
 JHN

So what have you come up with already? Any pieces of code you can share etc.

-Johan

1 Reply
(@ecarter)
Joined: 11 months ago

Posts: 0

nope, i don’t find any command to start with

actually i have made these to clean up the name before export

fn clean_name =
    (
        for s in selection do  
            (  
                oldname = filterString s.name " \",!#$%&/()"  
                temp = oldname[1]  
                for i = 2 to oldname.count do  
                    (  
                        temp = temp + oldname[i]  
                    )          
                s.name = temp    
            )      
    )

and this to check for isolated vertexs:

fn GetNumIsoVerts =
(
if isKindOf $ Editable_Poly then
(
check_isoverts = (((#{1…(polyop.getnumverts $)}) – (polyop.getvertsusingface $ #all)).numberset)
if check_isoverts > 0 then
(
if querybox (“your model have ” + check_isoverts as string + ” isolated vertexs, remove them?”) == true do
(
messagebox (“removed ” + check_isoverts as string + ” isolated vertexs”)
$.EditablePoly.deleteIsoVerts ()
)
)
)
)

but i can’t find something to start with the code for check xform and hide geometry

if the object in question is an editable poly you can use:

polyop.getHiddenVerts <poly poly>

and

polyop.getHiddenFaces <poly poly>

both return bitarrays that list the indices of the corresponding hidden verts/faces. If you don’t care which verts/faces are hidden and simply want to un-hide all you can use

polyOp.unHideAllFaces <poly poly>

and

polyOp.unHideAllVerts <poly poly>

To check for the xform modifier you could use a simple function that returned a boolean like:

fn checkXForm obj =
(
	bool = false
	for m in obj.modifiers where classof m == XForm do 
	(
		bool = true
		exit
	)
	bool
)
1 Reply
(@ecarter)
Joined: 11 months ago

Posts: 0

thanks, the code to check for hide geometry work very well,

     if (polyop.getHiddenFaces $).numberset &gt; 0 or (polyop.getHiddenVerts $).numberset &gt; 0 then 
         (
             if querybox ("this mesh have hiden geometry, do you want to unhide all geometry and export it?") == true then
                 (
                     polyOp.unHideAllFaces $
                     polyOp.unHideAllVerts $
                     redrawViews()
                 )
             else(continue)
         )

but i have problem with the xform code,
i think that the script you gave me are to check if the object have the modifier added.
but what i need is to check if the object need to apply an xform modifier or not.

still looking

i found this script, but i need to check how this work to have an idea of hot to check if the object need the xform apply

http://paulneale.com/scripts/resetXform/PEN_resetXform.htm