PDA

View Full Version : PolyOP UV Coords


jifman
12-12-2009, 01:32 AM
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

denisT
12-12-2009, 02:09 AM
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


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
)
)

jifman
12-12-2009, 05:03 PM
cheers, but it gives the same info as my script. maybe its being handled wrong in renderman. cheers for the help tho :)

denisT
12-12-2009, 05:15 PM
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 "\n" 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
)
)

jifman
12-12-2009, 05:36 PM
cheers for the quick responce

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?


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....

CGTalk Moderation
12-12-2009, 05:36 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.