Maintain UV mapping setting after capping a tube

Hi guys,

I’ve got a set up where I render tubular surfaces ropes with the UV mapping set up with some code to repeat the mapping proportionate to the length. The problem is some of the folks who might want to render this downstream use oddball software that freaks out about objects not being solids. Okay fine, I can just “Cap” them…but the mapping appearance is not right. Now I just had a thought that maybe it’s just an iray problem but in V8 Cycles it’s also different, though…differently?

Given I have no concern how the ends look, is there going to be some simple way to cap these objects and do a switcheroo on the mapping to maintain the appearance?

Edit: after a bit of checking I think I’ve found a pattern of changing the UV settings to rotate it around the right way, but is that more or less guaranteed to work every time?

Maybe not ideal, but this works:
Make a copy of the rope, and cap that one, then set it to custom mapping and choose the uncapped surface as source.

1 Like

Yeah that sounds a bit elaborate, I need a solution to convert thousands of these and that will maintain the mapping downstream through DWG or STEP files. I’ll see if fiddling with the parameters after capping is consistent.

I just started making up the script to do this and realized the difficulty, setting mapping parameters though RhinoCommon is…unintuitive, I have to apply a transform to a matrix? I’m going to be randomly applying rotations until it works.

Would anyone know the transformation to achieve this? : Where the original UVW parameters would be 1, critical value X, 1, with a -90 degree rotation in W, and the result that I need for it to look right as a solid is X,X,1, with 0 rotation in W.

EDIT: I figured it out looking at the matrices before and after…