Jump to content

[PYTHON]UV Export Script?


Atom

Recommended Posts

I am trying to export UVs from an object into a new file format. I can't seem to find out how to walk the data set to get the UVs exported correctly?

I have

geo = node.geometry()
print dir(geo)

So I can see some of the options contained within the geometry object but how do I access the UV coordinates for each vertex?

Link to comment
Share on other sites

I think I have found a way to get to the UV data but I am not sure how to package it up so it is convenient for the process that will read this data...

node = hou.pwd()
geo = node.geometry()

# Add code to modify contents of geo.
# Use drop down menu to select examples.
for (i,prim) in enumerate(geo.prims()):
    if i < 4:    # Just print out 4.
        print len(prim.vertices())
        for v in prim.vertices():
            print i,v.attribValue("uv")

 

Edited by Atom
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...