Notifications
Clear all

[Closed] PolyOP UV Coords

Hi guys!

need some wisdom here, having mucho trouble with the PolyOp texture map. I’ve done it without any problem with meshop, but i HAVE to use PolyOp for it as well.
Am I missing something with what I have so far:


			theChannel = 1
 facecount = getNumFaces obj
numverts = getNumVerts obj
for i = 1 to facecount do(
for v in (polyOp.getMapFace obj theChannel i) do(
	uv = (polyOp.getMapVert obj theChannel v)
	format "% % "uv.x (1 - uv.y) to:Geometry_file 
	
)
)

cheers

4 Replies

theChannel = 1
for f in (obj.faces as bitarray) do
(
	for v in (polyOp.getMapFace obj theChannel f) do
	(
		uv = polyOp.getMapVert obj theChannel v
		format "% % " uv.x (1 - uv.y) to:Geometry_file 
	)
)

cheers, but it gives the same info as my script. maybe its being handled wrong in renderman. cheers for the help tho

  editable mesh face always has 3 geo vertices and 3 map vertices. So it makes sense to store map verts in the format "one after another".
  but editable poly face can have 3 or more vertices. How can you parse map coords file without knowing how many verts the face has?
  
  probably you have to store verts data for every face per line:

      theChannel = 1
    for f in (obj.faces as bitarray) do
    (
    	for v in (polyOp.getMapFace obj theChannel f) do
    	(
    		uv = polyOp.getMapVert obj theChannel v
    		format "% %" uv.x (1 - uv.y) to:Geometry_file
    	)
    	format "
" to:Geometry_file
    )
    
      

another solution is to use TriMesh faces of editable poly. And use editable mesh methods for it:


   theChannel = 1
 theMesh = obj.mesh
 for f in (theMesh.faces as bitarray) do
 (
 	vv = meshop.getMapFace theMesh theChannel f
 	for k=1 to 3 do
 	(
 		uv = meshop.getMapVert theMesh theChannel vv[k]
 		format "% % " uv.x (1 - uv.y) to:Geometry_file
 	)
 )
   

or


   theMesh = obj.mesh
 for f in (theMesh.faces as bitarray) do
 (
 	vv = getTVFace theMesh f
 	for k=1 to 3 do
 	(
 		uv = getTVert theMesh vv[k]
 		format "% % " uv.x (1 - uv.y) to:Geometry_file
 	)
 )
   

cheers for the quick responce

At the beinging of the file, I export out the number of vertexs per face. I would love to use trimesh, but from my understanding (and I would LOVE to be proved wrong on this) the catmull-clark subdivisionmesh method cannot take tri’s.

Im thinking I will have to use find a way to collorate the tri-mesh mapping data with the polymesh face data…