Jump to content
Gregi

Control Point 1 dimension

Recommended Posts

Hello Forum one more time

 

I would really love to have an Control Point-Handle for just one direction (X,Y or Z), the other dimensions as an input port.

So in the end in the OIP theres only one field which i could use in the marionette-object as dynamic parameter. All my tries were unsuccessful.

Share this post


Link to post

So, some more information, i still get stucked

 

I would like to have a parametric marionette object with input fields and control-points. a control point should only set one parameter and should be placed depending on other parameters. so i tried to change some codes with kind of succes, but now i got three problems:
1. the with/"Breite" (X) parameter ist not visible in the oip

2. every other input field like "dim" node is resetting after moving an control point

3. i would like tho have NO OIP-Control about the not-used control point (CP_1dim_20-04-23.vwxy in the #OIP Controls in my example) but were not succesfull, is there any possibility to do?

 

#Created January 2018
#Updated August 2018
@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
#APPEARANCE
	#Name
	this = Marionette.Node('Control Point 2D')
	this.SetDescription('Creates a 2D reshape handle when used in a Marionette Object. Initial values are defined in the Object Info Palette.')

	#Input Ports
	fy = Marionette.PortIn(0.0)
		
	#OIP Controls
	x = Marionette.OIPControl( 'X', Marionette.WidgetType.RealCoord, 0.0)
	x.SetDescription('A value representing the distance from the origin along the x axis')
	y = Marionette.OIPControl( ' ', Marionette.WidgetType.Separator, '')
	#y.SetDescription('A value representing the distance from the origin along the y axis')
	
	#Output Ports
	pt = Marionette.PortOut('p')
	pt.SetDescription('A Control 2D point on the xy plane')

#BEHAVIOR
	
def RunNode(self):
	#inputs
	x = self.Params.x.value
	#y = self.Params.y.value
	#y = 50.0
	y = self.Params.fy.value
	appMajor, appMinor, appMaint, platform = vs.GetVersion()	
	units = vs.GetPrefReal(150)	
	#script
	pioHandle = vs.Handle(Marionette.parametric_handle) 
	if pioHandle != vs.Handle(0):
		if appMajor >=24:
			Marionette.CreateControlPointCoord(self.Handle, x, y)
			x = x/units
			y = y/units
		else:
			x = x/units
			y = y/units
	else:
		x = x/units
		y = y/units
	#outputs
	self.Params.pt.value = (x, y)
	

 

CP_1dim_missing info.png

CP_1dim_network.png

CP_1dim_code.png

Share this post


Link to post

Or, another example to show what i would like to get. An invisible OIP widget for control points would be a good beginning. is something like this possible?

 

image.thumb.png.ad3166fe482bc0b6a8aeccf16e0aebe8.png

Share this post


Link to post

Is there any function reference vor

vs.Mrntte_ControlPoint(nodeHandle, coordX, coordY, coordZ, False)

I realized, the second Var (here coordY) is always changing the second OIP-Control, doesn't matter which name is given in the inputs.

 

In my test the second one is giving the Point i want to have, the blue handle is shown at y=100, doesn't matter, where i put the point. But in OIP it chances the Variable.

If i delete "ydummy" in the #OIP Controls, every moving in Y-Axis is shown in the "Z" Value, and no moving in Z-Axis is possible.

 

How could the function be Chanced? do you have an idea @sbarrett @DomC

 

 

image.thumb.png.25ccc9d9dca31d86f1a0a0454b8f3a58.png

 

image.thumb.png.6d6a99bd6b0e8ef04df7f9d6034a49dd.png

 

 

CP_1dim_2020-11-17.vwx

  • Like 1

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...