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
  • 11 months later...

Finally got to grips with the problem of fully implementing textures for extrude along path plugins (at least I think).

 

Seems to handle all texture options ie None, by Class and Texture. With multi path set, you can make a selection of both path1 and path2 texture parts and edit Mapping for both at the same time. Similarly, you can set a common texture for both.

 

Find enclosed VW2024 plugin "Path Tool VWX FORUM" based on sandertb's version above. Added a multi path option as a proof of concept - see image below

 

Any further information will be gratefully received.

 

Thanks

 

pathtool.thumb.jpg.bb3c0467d9128ea9731d2d9702647b63.jpg

Path Tool VWX FORUM.vso

  • Like 2
Link to comment

Thanks - it was a good exercise.

 

The only thing I'm worried about is a conflict with another plugin using a texture part ID with the same number ie     texPartID = 100 #custom partID

 

I am assuming the texture part ID is global. Does anyone know how to find out if a texture part ID is already defined.

  • Like 1
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...