PDA

View Full Version : Max script error


conradM
04-04-2009, 09:19 PM
Hi - Firstly I am new to maxscript so no doubt I am doing something noob like. However having said that I have tried to find a solution myself but have had no luck.

I am using max 2008. I want to use a point helper with custom attributes wired (via the wire parameters) to a characters various morph targets, noise modifiers and eye movements. The GUI is all set up and works fine. However I am getting errors when it comes to setting up the parameters.....

- Syntax error: at keyword parameter, expected name
-- In line: parameters rollout:E

Below is my script....

cust_attrib = attributes "Phoenix Controls"
(
parameters rollout:EyeLidControls
(
blink type:#worldunits ui:spn1
Horizontal type:#worldunits ui:spn2
Verticle type:#worldunits ui:spn3
Inwards type:#worldunits ui:spn5
Up type:#worldunits ui:sld3
Down type:#worldunits ui:sld4
Horizontal type:#worldunits ui:sld5
Strength type:#worldunits ui:spn7
X type:#worldunits ui:spn8
Y type:#worldunits ui:spn9
Z type:#worldunits ui:spn10
)
rollout EyeLidControls "Phoenix" width:165 height:622
(
groupBox eyeLids "Eye Lid Controls" pos:[5,5] width:155 height:90
slider sld1 "Blink" pos:[16,33] width:129 height:44
groupBox Eyes "Eye Controls" pos:[5,100] width:155 height:105
spinner spn2 "Horizontal" pos:[25,125] width:120 height:16
spinner spn3 "Verticle" pos:[37,150] width:108 height:16 range:[0,100,0]
spinner spn5 "Inwards" pos:[34,175] width:111 height:16 range:[0,100,0]
groupBox Belly "Belly Shake Control" pos:[5,210] width:155 height:405
slider sld3 "Up" pos:[15,235] width:140 height:44
slider sld4 "Down" pos:[15,290] width:140 height:44
slider sld5 "Horizontal" pos:[15,345] width:137 height:44
groupBox grp4 "Noise" pos:[10,400] width:145 height:209
checkbox chk1 "Active" pos:[18,419] width:125 height:21
spinner spn6 "Seed" pos:[70,445] width:76 height:16
spinner spn7 "Scale" pos:[68,470] width:78 height:16 range:[0,100,0]
groupBox grp5 "Strength" pos:[15,498] width:135 height:105
spinner spn8 "X" pos:[45,525] width:64 height:16
spinner spn9 "Y" pos:[45,550] width:64 height:16 range:[0,100,0]
spinner spn10 "Z" pos:[45,575] width:64 height:16 range:[0,100,0]
)
)

CustAttributes.add $.baseobject cust_attrib

-----------

Thanks in advance for any help that is given 8)

Bharris
04-05-2009, 02:56 PM
Check out Tech-Artists.org. It has a nice wiki on Max Scripting there is also scriptspot.com. It has some video tutorials on Max Scripting. I believe they touch specifically on what you are doing.

Bobo
04-05-2009, 03:12 PM
- Syntax error: at keyword parameter, expected name
-- In line: parameters rollout:E


This means, of course, that MAXScript is expecting a NAME after the parameter keyword, because the definition syntax of a paramBlock is 'parameters SomeName rollout:theRolloutToConnectTo'...

The name of the paramBlock does not matter much, you can call it 'main' or whatever you want. It plays role internally as you can have multiple parameter blocks in a plugin or Custom Attribute and both you and the system want to be able to distinguish them by name.

On the page "Scripted Custom Attributes" in the MAXScript Reference, see the example of WeaponDataCA where the paramBlock is called 'main'.

See also "Scripted Plug-in Clauses" where the syntax definition of a parameter block is given as

parameters <name> [type:#class] [rollout:<name>]
(
{ <param_defs> }+
{ <event_handler> }
)

CGTalk Moderation
04-05-2009, 03:12 PM
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.