Home Technical Talk

MaxScript check if editable poly

Hi guys,

I started maxScript today because my exams are over and I've written a few simple tools because I could use the maxScript listener to know certain commands. But now I am stuck, I want to check whether an object is still a primitive or whether it has been transformed to an editable poly already. Anyone that can help me please?

Kind regards

Replies

  • Revel
    Options
    Offline / Send Message
    Revel interpolator
    You can write a function like this:
    fn curClass =
    (
    	case (classOf (modPanel.getCurrentObject())) of
    	(
    		Editable_Poly: return #editableMode
    		Edit_Poly: return #editMode
    		Editable_Mesh: return #editableMeshMode
    		Edit_Mesh: return #editMeshMode
    		Unwrap_UVW: return #uvMode
    		SplineShape: return #splineMode
    		Edit_Spline: return #splineMode
    		Line: return #splineMode
    	)
    )
    
    ..so whenever you call curClass() it'll return the object type. Or just by simply call classOf (modPanel.getCurrentObject()) and it'll return you the object type as well.
  • JulianDeclercq
    Thank you Revel !
Sign In or Register to comment.