Jump to content

Texture not rotated the same on extrude


Recommended Posts

Hey everyone,

I am currently building a tool that creates an Extrude along a path and attaches a texture to this. However, on some sides of the extrude the texture is rotated 90 degrees, while on others it has the correct rotation.

image.thumb.png.28b16f6add262285ef3cb7302eb2f9c9.png

 

def create3DLine(objectHand, path):
	vs.RectangleN( 0,0,1,0, 1, params().bambooHeight)
    profile = vs.LNewObj()

    offsetPath = vs.OffsetPolyN(vs.CreateDuplicateObjN(path, objectHand, True), offset3D, False)
    vs.SetPlanarRefIDToGround(offsetPath)
    offsetNurbs = vs.ConvertToNURBS(offsetPath, False)
    
    extrude = vs.ExtrudeAlongPath(offsetNurbs, profile)
    vs.DelObject(profile)

    texPartID = 3
    texLayerID = 0
    texture = vs.Name2Index("Bamboo Prop Texture")
    vs.SetTextureRefN(extrude, texture , texPartID, texLayerID)

 

Does anybody know how to fix this?

Link to comment
  • Marionette Maven

@sandertb

A few things while I'm still in process of finding a solution.
When you ungroup your object (in a 3D view), you can see that you still have your NURBS profile, which I think you made effort to delete in your code, so may be worth looking into.

Also, it appears that your texture is being set as Surface UV mapping, if you can get this to always draw with Auto-Align Plane, then I think it would solve your issue.

 

I'm playing with SetTexMapBoolN to try to resolve this as it works with an EAP object not inside of a PIO, but maybe am referencing the wrong object when placing it in your code so far. The only thing I worry about is I can't get the texture to redraw on the object even while using ResetObject and ReDrawAll, so that's something to also be mindful of. 

I'm going to submit a bug about that and see where it goes, but for now I think the focus is setting the texture mapping appropriately on your object.

Link to comment

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

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