Notifications
Clear all

[Closed] Using CurveControl in scripted plugin?

Hello!

I’m having a lot of trouble trying to define a plugin parameter that stores an array of curveControl points. My goal is to save the curvepoint values within the plugin parameter data, so that the curve doesn’t reset.

I have no idea of how to achieve this, since documentation/web is a bit limited on this topic. I would be really happy if someone could give me a hint.


Plugin helper TestHelper
name: "TestHelper"
Classid: #(0x2de832, 0x1fa4d512)
category: "Test"
extends:dummy
(
	parameters paramNodeProperties rollout:rolloutNodeProperties
	(
		Helper_Radius type:#float ui:spn_Helper_Radius default:0.0
		TwistCurvePoints type:#???? ui:test_curve tabSizeVariable:true
	)
	
	rollout rolloutNodeProperties "Helper Parameters" width:168 height:48
	(
		Label lbl_Helper_Radius "Radius:" pos:[16,16] width:80 height:16
		Spinner spn_Helper_Radius "" pos:[96,16] width:56 height:16 range:[0,1e+009,0]		
		CurveControl test_curve "" height:200 width:140 numCurves:1 visible:true x_range:[0,100] y_range:[-100,100] scrollValues:[0,100] commandMode:#move_xy asPopup:false zoomValues:[1,1]
	)	

	on getDisplayMesh do
	(
		mesh = (createInstance sphere radius:(Helper_Radius*2.5) segs:4).mesh
	)
	
	tool create
	(
		on mousePoint click do
		(
			case click of
			(
				1:(nodeTM.translation = gridPoint)
				2:#stop
			)
		)
		
		on mouseMove click do
		(
			case click of
			(
				2: (Helper_Radius = abs gridDist.x*2)
			)
		)
	)
)