Jump to content
Developer Wiki and Function Reference Links ×

Extrude Along Path Node


Recommended Posts

This node only extrudes along path, The VW EAP command provides options to the Lock profile Plane and Fix Profile.

Is it possible to add this in.

I am toying with creating handrails that continue up a stair and along the landing and on further so it would be nice for the extrude to stay level through the twists and turns.

Thnaks

Capture_01.PNG

Capture.PNG

Edited by Alan Woodwell
Link to comment

You could force the parameter?

 

Below is the node with all fields available.

 

Set Fix Profile to True.

Disclaimer, I haven't tested this extensively. So use at own risk, save work, etc.

 

#Modified by TWK May 2018

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
#APPEARANCE
	#Name
	this = Marionette.Node( "Path Extrude" ) 
	this.SetDescription('Extrudes a profile along a path')

	#Input Ports
	profiles = Marionette.PortIn( vs.Handle(0), 'hProfile' )
	profiles.SetDescription('The profile to extrude')
	paths = Marionette.PortIn( vs.Handle(0), 'hPath' )
	paths.SetDescription('The path to extrude along')	
	
	eapScale = Marionette.PortIn( 1, 'eapScale' )
	eapScale.SetDescription('Set scale of the Profile')
	eapFactor = Marionette.PortIn( 1, 'eapFactor' )
	eapFactor.SetDescription('Set Factor?')
	eapLockProfile = Marionette.PortIn( False, 'eapLockProfile' )
	eapLockProfile.SetDescription('Lock Profile')
	eapFixProfile = Marionette.PortIn( False, 'eapFixProfile' )
	eapFixProfile.SetDescription('Fix Profile')

	#OIP Controls

	#Output Ports
	xtrds = Marionette.PortOut('hObj')
	xtrds.SetDescription('The resulting object')

#BEHAVIOR
	this.SetLinksObjects()
	savedView = None
	this.SetInitFunc(Marionette.InitializeView)
	this.SetFinalFunc(Marionette.RestoreView)

def RunNode(self):
	#inputs
	prof = self.Params.profiles.value
	path = self.Params.paths.value
	
	scale = self.Params.eapScale.value
	Factor = self.Params.eapFactor.value
	LockProfile = self.Params.eapLockProfile.value
	FixProfile = self.Params.eapFixProfile.value
	FixProfile = "Yes" if FixProfile else "No"

	#script
	if  prof != 0 and path != 0: 
		profile = vs.CreateDuplicateObject(prof, vs.Handle(0))
		cntr = vs.HCenter(profile)		
		vs.HMove(profile, -cntr[0], -cntr[1])		
		if vs.GetTypeN(path) is not 111:
			oldPath = path
			path = vs.ConvertToNURBS(path, True)
			vs.Marionette_DisposeObj(oldPath)			
		eap = vs.CreateCustomObjectPath('Extrude Along Path', path, profile)
		vs.SetObjectVariableBoolean(eap, 1167, True)
		vs.SetRField(eap, 'Extrude Along Path', 'Scale', str(scale))
		vs.SetRField(eap, 'Extrude Along Path', 'Factor', str(Factor))
		vs.SetRField(eap, 'Extrude Along Path', 'Lock Profile Plane', str(LockProfile))
		vs.SetRField(eap, 'Extrude Along Path', 'Fix Profile', str(FixProfile))
		vs.Marionette_DisposeObj(prof)

	#outputs				
		self.Params.xtrds.value = eap

 

image.thumb.png.2e16f3c928d99349c1794d57fcba1aca.png

Link to comment
  • 4 months later...

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