V8 Squish error when going from planar map to SetMeshSurface Parameters

Hi Team,

Got an odd one here for you.

In the attached I have a mesh that I had to planar map (for reasons I won’t bore you with). If I squish that the geometry squishes fine but the texture gets messed up as well all know now.

To fix that I can run _SetMeshSurfaceParameters and ApplySurfaceMapping which has worked well in the past. However in this case the geometry gets seriously messed up when squishing.

The only thing I can think of is that the mesh fully encloses a loop (ie. periodic). A non periodic mesh behaves fine (the piece on the right in this scene)

v8-squish-SetMeshSurfaceParameters-bug.3dm (587.8 KB)

I’m attaching the test UV texture I used also, since I never seem to get Rhino files to embed textures (unless I don’t want it to)

Bumping to @Willem and @BrianJ so this doesn’t fall down the stack.

Thanks, Steve

Hi Steve,

I’ve filed this as https://mcneel.myjetbrains.com/youtrack/issue/RH-90410 for future reference. So far I haven’t found a workaround but I’ll let you know if I find one.

My guess is that something will need to change in SetMeshSurfaceParameters.

Thanks Brian,

If it helps with the de-bugging, I exported the first mesh to .obj and brought it back in. That had exactly the same squish problem.

Cheers, Steve

Hi Steve

I’ve been trying to figure out a workaround and found a solution that seems to only work in V7
DISCLAIMER: I worked on this in between other work today so I did not have full focus on this.

Conclusions while finding a solution:
Setting texture coordinates in V8 through python does not seem to work as it does in V7
Also Replacing the mesh via scriptcontext.doc.Replace() does not alter the texturecoordinates as they are when adding a new mesh.

Steve, to make this work, save as V7 file and open in V7
There run this script, select 3D mesh, select Flat mesh and check the newly created flat mesh.

map_squished_texture.py (878 Bytes)

does that help as a workaround?

Cheers Willem

P.S. good to see the test-texture is still of good use :heart:

Hi Willem,

Many thanks for looking at this. I’ve got V7 on my laptop still so I’ll try your script on that later.

Yes, the UV test texture is stillgetting used. It is my favourite for checking mapping :slight_smile:

Cheers, Steve

Hi Willem,

That works perfectly as a work around thanks Willem.

Obviously there is something changed in V8 that is above my pay grade to understand.

The fact that texture coords also get messed up exporting to OBJ is of serious concern too.

Many thanks and best of luck working out what is going on.

Cheers, Steve

I’m not seeing that mentioned in this thread, is it a separate issue you’re seeing and reporting in another? I want to make sure that it’s filed. Thanks.

Hi Brian,

I mentioned it above somewhere. If I send the first mesh (ie. the planar mapped one) out to OBJ and back again, it squishes badly exactly the same as the one where I ran SetMeshSurfaceParameters.

Hope that helps, Steve

Thanks, I missed it but have added that to the bug report as well.