Forum: Poser - OFFICIAL


Subject: UV Map switching script?

Paloth opened this issue on Jul 14, 2012 · 73 posts


who3d posted Wed, 18 July 2012 at 10:25 AM

Quote - If there is one, I'd be interested to know what approach it uses.  There's been discussion of one, on and off, but I don't know that one exists.  The trouble with any Python script to switch UV maps in Poser would be that it would actually have to switch geometry, in one way or another, and each approach for geometry switching in Poser offers its own complications and limitations.  It could be done, but I doubt the result would be as easy to use, fast, or flexible as it would be in any software where a single geometry can be held in memory with multiple UV maps for that geometry.  :unsure:

 

As I wrote the script being discussed, I can assure you that it doesn't need to change geometry or invalidate morph deltas or anything like that. Poser has had the built-in capability, under the hood, to do UV Map switching for a long time I suspect - it's been able to rewrite the UVs since at least Poser 4 so I suspect it's been possible to change the UVs in Pythin sinc ePoser Pro or Poser 5, but I don't ahve the Python methods reference manuals to hand to check.

 

I was writing it as part of seeing how we could potentially improve compatability with Genesis because so many different UV sets exist for Genesis, but due to the way DAZ have implimented different Uv Maps I decided that either geometry switching or indeed whole figure switching (loading a figure that used a different .OBJ file with a different UV set, but retaining the current pose) was simply quicker and easier.

 

If you produce new UV sets with the same splits/cuts as exist in the main figure - just like morphs have to have the same cuts and the same vertex order - then switching UV Sets wouldn't be hard at all.

 

Cheers,

 

Cliff

 

PS I may have lost the later more complete versions of the code, but the basic routine was:

SaveUVs

  1. Open save file

  2. For selected figure cycle through all the actors.

3.. For all the actors, cycle through the texvertices

4... Write the U and v values out to a file

  1. End

 

Load UVs

  1. Open UVset

  2. For selected figure, cycle through all the actors

3.. For all the actors, cycle through the texture vertices

4... Read in the U and V values from the file and set them on the actor

  1. End