View Full Version : Editable_Spline have some parameter count not access!
leelittledragon 10-24-2006, 03:50 AM Hi!
I am development a maxscript!
I found a question!
The Editable_Spline have some parameter not access.
follow parameter Cound not access:
Outline , Center. Spinner control.
Please help me! thanks! Otherwise only use c++ SDK! Hehe!
|
|
Hi!
I am development a maxscript!
I found a question!
The Editable_Spline have some parameter not access.
follow parameter Cound not access:
Outline , Center. Spinner control.
Please help me! thanks! Otherwise only use c++ SDK! Hehe!
You can apply offset using applyOffset(), but cannot control the center option. (See "Spline Shape Common Properties, Operators, and Methods" in MAXScript Reference)
Using a positive value goes in the one direction, using a negative in the other.
For example:
theShape = Star()
applyOffset theShape 2
theShape = Star pos:[50,0,0]
applyOffset theShape -2
Of course, you could fake the Center alignment by first offsetting at half offset in the positive direction, deleting the original spline from the shape and offsetting the full value in the other direction...
For example:
theShape = Star()
theOffset = 4
applyOffset theShape (-theOffset/2)
deleteSpline theShape 1
updateShape theShape
applyOffset theShape theOffset
If your shape contains multiple splines, you would have to delete all but the one you want to offset, otherwise all would be offset. You could clone the original shape, delete all splines but the one to be offset and apply the offset. Delete the spline you offset from the original shape and if you want, attach the clone to the original. It is a bit hacky, but the result would be the same as the one you would get with the mouse...
leelittledragon
10-24-2006, 05:04 AM
rollout OutlineAdjsq "Outline Parameter" width:163 height:113
(
checkbutton ckb1 "Outline" pos:[17,36] width:67 height:19 checked:true
spinner spn3 "" pos:[86,37] width:65 height:16 range:[1,500000,1]
checkbox chk3 "Center" pos:[49,66] width:72 height:22
GroupBox grp8 "" pos:[7,13] width:150 height:84
on ckb1 changed state do
(
splineOps.startOutline $
copy $
)
on spn3 changed val do
(
theOffset = val
applyOffset $ (-theOffset/2)
deleteSpline $ 1
updateShape $
applyOffset $ theOffset
)
)
createdialog OutlineAdjsq
You cannot do that.
You are trying (for some reason) to recreate the INTERACTIVE functionality already available in the Editable Spline rollout - change the spinner and watch the spline change in the viewport. The applyOutline() method does the job quietly and the result is there instantly based on the second parameter. You cannot see the spline change gradually.
The idea behind scripting is to avoid doing things by hand so they can be done faster. The method I proposed could be used to achieve the same result WITHOUT the need to use interactive controls, checkboxes, spinners etc, for example if you are automatically creating certain shapes without even updating the viewports that much.
What you are trying to do just cannot be done this way - the closest thing to it is to use splineOps.startOutline and prompt the user to use the existing controls in the command panel or just drag the mouse in the viewport.
Splines are not very well exposed to MAXScript and you just cannot do what you want - as always, you should do what is possible, not what you hope you could do ;)
CGTalk Moderation
10-24-2006, 05:37 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.