Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Syntax error: at =, expected name

Syntax error: at =, expected name

Anonymous
Not applicable
3,034 Views
4 Replies
Message 1 of 5

Syntax error: at =, expected name

Anonymous
Not applicable

Im having trouble understanding what the problem is with my code.  the code written below worked without any problems before.  Windows 10 restarted on its own for updates and now my code dosent work.   I get the error below when I try to run my script.  if i remove boneColor = color 86 86 86 the code will run, but when I put this code back  in it stops working and I get the following error. Im using Max 2019.

 

-- Error occurred in anonymous codeblock; filename: D:\maxScripts\rigTools_3_0.ms; position: 592; line: 9
-- Syntax error: at =, expected name
-- In line: boneColor = c

 

rollout boneTools "Bone Tools" width:162 height:300
(
	button 'setUpMuscleBone' "Set Up Muscle Bone" pos:[10,10] width:80 height:40 align:#left
	button 'setUpMuscle' "Set Up Muscle" pos:[10,60] width:80 height:40 align:#left
	edittext baseName "Base Name" pos:[100,10] text:"boneSkin" fieldWidth:75 labelOnTop:true
	edittext side "Side" pos:[100,60] text:"empty" fieldWidth:75 labelOnTop:true
	edittext boneName "Bone Name" pos:[100,110] text:"empty" fieldWidth:75 labelOnTop:true
	checkbox 'muscle' "Is Muscle" pos:[190,10] checked:false width:118 height:42 align:#left
	boneColor = color 86 86 86 
	
	on muscle changed state do
	(
		if muscle.checked == true then
		(
			baseName.text = "muscle"
			boneColor = color 255 165 0
		)
		else
		(
			baseName.text = "boneSkin"
			boneColor = color 86 86 86
		)
	)

 

I  

0 Likes
Accepted solutions (1)
3,035 Views
4 Replies
Replies (4)
Message 2 of 5

Swordslayer
Advisor
Advisor
Accepted solution

Part of rollout definitions can only be explicit local declarations, not something that could be assigment expression if the variable was defined in a higher scope. So if you want to have a local variable in that rolout scope, put 'local' in front of it, if you want to override a global, do that in the on rollout open handler.

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thank you.  The code is working now.  

0 Likes
Message 4 of 5

mondinodanielfernando
Community Visitor
Community Visitor

Hola tengo este problema con el RUN SCRIPT en 3dmax 2020.

-- Error occurred in anonymous codeblock; filename: D:\DISCO (D)\CLIENTES\Hay alguien abajo VFX\Plano dos Cara trackeada_250.ms; position: 680; line: 14
-- MAXScript FileIn Exception:
-- Syntax error: at ), expected <factor>
-- In line: filename =

HEELP!!!

0 Likes
Message 5 of 5

miauuuu
Collaborator
Collaborator

If you have an error with the script in the above comments use this:

 

rollout boneTools "Bone Tools" width:162 height:300
(
	button 'setUpMuscleBone' "Set Up Muscle Bone" pos:[10,10] width:80 height:40 align:#left
	button 'setUpMuscle' "Set Up Muscle" pos:[10,60] width:80 height:40 align:#left
	edittext baseName "Base Name" pos:[100,10] text:"boneSkin" fieldWidth:75 labelOnTop:true
	edittext side "Side" pos:[100,60] text:"empty" fieldWidth:75 labelOnTop:true
	edittext boneName "Bone Name" pos:[100,110] text:"empty" fieldWidth:75 labelOnTop:true
	checkbox 'muscle' "Is Muscle" pos:[190,10] checked:false width:118 height:42 align:#left
	
	local boneColor = color 86 86 86 
	
	on muscle changed state do
	(
		if muscle.checked == true then
		(
			baseName.text = "muscle"
			boneColor = color 255 165 0
		)
		else
		(
			baseName.text = "boneSkin"
			boneColor = color 86 86 86
		)
	)
)
createDialog boneTools
https://miauu-maxscript.com/
0 Likes