Control UV offset with python

Control UV offset with python

Anonymous
Not applicable
1,347 Views
2 Replies
Message 1 of 3

Control UV offset with python

Anonymous
Not applicable

Hello,

 

I am looking to adjust the offset of my UV's (in UV mapping mode) with python.

Is there a way to control The UV offset of a material with python?

0 Likes
Accepted solutions (1)
1,348 Views
2 Replies
Replies (2)
Message 2 of 3

michael_nikelsky
Autodesk
Autodesk
Accepted solution

Hi,

 

take a look at the createMaterial.py file in the examples/snippets folder. The repeat/offset/rotate values are stored in the various components. There are some mismatchs with the specular/glossy components, in some cases the attributes for the glossy color/texture are stored in the specularComponent instead of the glossyComponent (for the plastic material for example). I would therefore recommend to check with the node editor which attribute changes when you change something in the UI.

 

Kind regards

Michael



Michael Nikelsky
Sr. Principal Engineer
Message 3 of 3

Anonymous
Not applicable

Thanks Michael your the man,

This did the trick:

colorComponentData = vrFieldAccess(mat.fields().getFieldContainer('colorComponentData'))
diffuseComponent = vrFieldAccess(colorComponentData.getFieldContainer('diffuseComponent'))
diffuseComponent.setVec2f("offset", 2.5, 2.5)

 

0 Likes