Notifications
Clear all

[Closed] polyOp.setMapSupport

Has anyone ever tried recreating UV data via script? When using polyOp.setMapSupport, I get a system exception. How is this supposed to work?

4 Replies

try to use .defaultMapFaces. It create all you need for a new channel.
But you have to test several things first.

(
local obj=selection[1]
local theChannel=4 -- you create the channel 4
if ((polyOp.getNumMaps obj)-1)<theChannel do polyOp.setNumMaps obj (theChannel+1) keep:true
if not(polyOp.getMapSupport obj theChannel) do polyOp.defaultMapFaces obj theChannel
)

I don’t remember me if that is complete but this would be function. At present I prefer to use the unwrap modifier for working with UVW.

Thanks man, I’ll give it a try.

I’m writing a script that basically writes out mesh data into a text file, then reads it back in and recreates the object. The vertex and face creation part works fine, but as I mentioned the UV part isn’t happening at the moment.

Finally getting back around to this…

I am absolutely convinced that polyOp.setNumMaps does nothing.

Should I not be able to select a poly object and type:polyOp.setNumMaps $ 8 keep: false

and then use:

polyOp.getNumMaps $

to see that there are 8 mapping channels? This does not occur. “0” is always reported back.

I’m not sure that polyOp.defaultMapFaces is what I want, because I need to build a specific set of UVs and then UVfaces in between those UVs.

Has anyone ever tried creating UVs via script like this?

Well, sure enough: minutes after I post, I figured out the issue. Looks like I was pulling the wrong number to build UVfaces from. No wonder my UV faces were a jumbled mess. Sloppy code.