Jump to content

Cables Over Cables UV Problem?


Atom

Recommended Posts

Hi All,

 

I am working with an example I found on this forum and I am trying to "fix" it so I can use it for rendering. The concept is that you have a series of curves that are processed by a FOREACH. Inside this FOREACH a second each fetches the result from the previous iteration. The problem I have is that the curves, which are needed for evaluation, are also being rendered along with the skinned result. Because those curves are needed for processing I am not sure how to construct a node setup to exclude them from rendering.

 

In my posted image the area highlighted in yellow show some of the 2D curves I would like to remove from the final result. How can I detect and remove the unwanted curves from rendering? Is there a fixup process after the FOREACH or is there something I can do in the FOREACH to prevent them from appearing the result?

 

Stumped...

post-12295-0-57724500-1436040198_thumb.j

ap_cables_over_each_other_tut.hipnc

Edited by Atom
Link to comment
Share on other sites

I have progressed to the next problem in this scene.

 

I have tried all the UV Nodes but none of them will give me a valid checker pattern along these skinned cables. How do I add valid UV coordinates to generated geometry?

 

In my current viewport you can see the UV problems. Do I need to UV before I ray?

ap_tubes_overlap_foreach_ray_1c.hipnc

post-12295-0-52693600-1436299988_thumb.j

Link to comment
Share on other sites

To get a nice non-stretched UV you can use the current curve perimeter (measure SOP) and put that into the x scale of the UV texture node of the backbone curve and disable the UV texture node after the sweep. For this UV with sweep method to work you need to use point UV's but you probably want to convert them to vertex UV's afterwards somehow to get rid of the seam area.

Link to comment
Share on other sites

@Robert: Thanks for the additional advice, I did notice the seam problem. I am still not sure how to leverage the Measure SOP correctly. I have placed it after the circle to measure the perimeter. But how do I connect it into the other branch? Is than an attribute copy? Also I am planning on using an attributeVOP to displace the points using the UVs and I have a version working by using an attributePromote but I still end up with a seam.

 

What is the syntax for using the attribute to drive a parameter? I tried putting perimeter in the xscale but that is an error. Also I tried @perimeter but that did not work either..?

ap_tubes_overlap_foreach_ray_1g.hipnc

Edited by Atom
Link to comment
Share on other sites

I'll just include a file to show you what I meant. The measure SOP goes before the sweep on the backbone. The circle is mapped from 0..1 in the v-direction but when you do the same in the u direction for the backbone the aspect ratio gets messed up. So to get the correct aspect ratio the UV's of the backbone need to be proportional to the circle. In your case the circle already has a circumference of 1 unit so that makes the math easier but for completeness I added a measure SOP to the circle too. So to get the right coverage of the backbone UV's you take its length (the first measure SOP) and divide it by the circle's circumference (measure SOP 2).

 

You can put this number in the scale parameter of the backbone's UVtexture node. To calculate this you can use the prim() expression because we are using a regular SOP node, not a wrangle. Because we are iterating over each curve within the foreach SOP we can always take the first primitive (number 0) so prim("../measure1",0,"perimeter",0).

 

I added an ends node set to unroll for the circle to get rid of the stretching caused by point UV's. This still leaves an obvious seam but I'm sure there are many other methods to get around the stretching. 

ap_tubes_overlap_foreach_ray_RobertEdit.hipnc

Link to comment
Share on other sites

@Robert: Thanks again for taking the time to investigate my problem and offer a solution. This goes a long way towards getting my displacement along tubes working the way I wanted. From this point I think I could get a tech or organic look.

post-12295-0-53680400-1436373046_thumb.j

post-12295-0-96735600-1436375304_thumb.j

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