Notifications
Clear all

[Closed] please help me understand ccPoint

hi, I am using a rollout with a ControlCurve, and I am trying to figure out how to set the points on the curve. I need a <ccPoint> value, but cannot seem to be able to write one of these values. In the sample code below, I have a rollout with the curve. When I query a point, and store in a variable, I can easily use that variable to set a point. But, when I type the variable value – in this case it is #CCPoint(@[0,0]) – it gives me an error:

– Syntax error: at “, expected [
– In line: setPoint theCurve 1 #CCPoint(@[

I don’t know how to format this correctly. A simple point2 value also gives an error:

– Runtime error: Invalid arg type, needed ccPoint, got: [0,0]

Please help me understand the correct syntax. Thank you.

rollout test "test"
  (
  		CurveControl theCurve "Controller Falloff Curve:" width:400 height:200 numCurves:1 visible:true x_range:[0,100] y_range:[-100,100] scrollValues:[-100,100] CommandMode:#move_xy rcmFlags:#(#delete) asPopup:false
  )
  
  createDialog test width:420
  
  theCurve = test.theCurve.curves[1]
  p = getPoint theCurve 1
  print p
  setPoint theCurve 1 p
  setPoint theCurve 1 #CCPoint(@[0,0]) --gives ERROR
  setPoint theCurve 1 [0,0] -- gives ERROR 
2 Replies

From Maxscript Help:
Curve ControlccPoint <pt_point2> <in_point> <out_point2> [bezier:<false>] [corner:<false>] [lock_x:<false>] [lock_y:<false>] [select:<false>] [end:<false>] [noXConstraint:<false>]

a ccpoint requires 3 point2 values… so try this:

 setPoint theCurve 1 (ccPoint [0,0] [0,0] [0,0]) 

Thanks for the quick reply! That’s just what I needed.