[Closed] classOf() at a precise point in the stack?
I use the unwrap methods.
I started first by using the meshop methods for testing the topology, retrieving the coordinates, etc, and only the setVertexPosition() unwrap method for the last step. But that was a mistake.
I know a lot more now about scripted mapping than a week ago.
So you don’t need do check the object(s) class to make your tool work. Mostly the uvw_unwrap methods don’t work if a UVW_Unwrap modifier in not current object of Modifiers panel and UVW Editor is not open. You have to check if modpanel.getCurrentObject() is the UVW_Unwrap modifier.
That’s not a problem. Since the macro is run from the mapping menu in the Edit UVWs dialog, the current modifier cannot not be an unwrap uvw modifier.
What I do need to test is the kind of mesh structure that is fed to the modifier. And I need it to be a trimesh because the tool works on a tri-only topology (so far). If the stack below the unwrap evaluates as a primitive, an editable mesh or even a NURBS object, the unwrap sees a triangulated topology and evaluating at its level returns an editable mesh.
If I give it an editable poly, the unwrap sees a polymesh structure and the macro will make a mess of it (it has to walk from face to face to check the pattern of the selected faces before moving things around).
I started making that tool for my own use. So I didn’t care much about stack problems and crashes. I just made sure the unwrap gets a trimesh. But I’ve shown it to several people who seemed to find it useful and now I’m trying to make a foolproof (enough) version.
I’ll post it on scriptspot in a couple of days and add the link here if you’re interested.