Jump to content

transform() modifying UV's?


Recommended Posts

Hi, I am rotating a piece of geometry that has a point uv attribute. However, when I use the HDK's transform() function and feed it a matrix, I get pretty funky UVs coming out the other end. Is there a way to stop GEO_Detail::transform() from modifying my uv's? I have tried using some of the extra arguments, but there isn't much explanation in the docs around what they actually do.

// up_vec is the up vector. y_rotate is a float rotation value
UT_Matrix4 rot_mat = UT_Matrix4(1);
rot_mat.rotate(up_vec, PI*y_rotate / 180);
my_geo->transform(rot_mat);
Edited by kgmcnamara
Link to comment
Share on other sites

This might be a long shot, but are you by any chance using a build earlier than 13.0.483?

I don't know if this might apply to your case as well: https://www.sidefx.com/index.php?option=com_journal&Itemid=213&page=index&journal=default&view=FULL&logfile=ALL&icon=ALL&version=ALL&buildstart=483&buildend=483&perpage=20&search=transform&find=Find

 

Houdini 13.0.483: Fixed a bug that caused non-transforming attributes (such as "rest") to be affected by the Transform SOP if the transform only contained a translation.

 

Link to comment
Share on other sites

This behavior would be correct if uv were vector type, not float[3], H13 is very strict here. Are you sure isn't it a vector type?

 

Judging from the docs, quickxform = true will disable attributes' transforms, but for all of them. Perhaps updateaffectednormals=true will force normals transform despite quickxform settings...

Link to comment
Share on other sites

if the uvs are of type vector and you don´t want to change this for some reason, just set the attribute to nonTransfoming.

for example:

GA_RWAttributeRef uvAttrib = gdp->findFloatTuple(GA_ATTRIB_POINT, "uv", 3);
uvAttrib.get()->setNonTransforming(1);
Link to comment
Share on other sites

EDIT: Didn't see Petz's post. That did it! Thanks!

 

Original reply below

-------------------------------------------------------------------

 

 

Thanks for the reply symek. I believe the attribute is indeed a float3, since it is displayed as [0][1][2] instead of [x][y][x] in the details pane?

 

I have tried with quick transform = 1, as below, but with no luck. For more information, I have included the UVs before and after transform. Any ideas?

UT_Matrix4 rot_mat = UT_Matrix4(1);
rot_mat.rotate(up_vec, PI*y_rotate / 180);
my_geo->transform(rot_mat, my_geo->getPrimitiveRange(), 1, 1, 1, 1, 0, NULL, 0);

post-9427-0-74208300-1418234854_thumb.jp

post-9427-0-12257200-1418234859_thumb.jp

Edited by kgmcnamara
Link to comment
Share on other sites

hmm the float3 vs vector 3 would have had my guess as well...
maybe try making a simple scene where you manually create a uv attribute as both
see it it makes a difference, it should. (colours don't change upon rotation for example)

 

if still having problems contact SideFX support?

 

 

edit: NVM :P glad to see it resolved :)

Edited by freaq
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...