ZBrushCentral

ZBrushInfo causes closing brackets error

Hi guys,
I have to admit I’m still a noob in ZScript and I’working on a script at the moment, that displays the seconds that passed since the last save.
This part here especially causes me problems.

[ISubPalette,"Zplugin:PSTools"]
    
    
    [Ibutton, "Zplugin:PSTools:Save with time",,
    
    	[VarSet,Temptime,[ZBrushInfo,2] ] 	
    	[Note,[VarInc,Temptime] ]
    
    
    ]

What I did here is I want to read out the ZBrush Runtime, save it in a variable and change its value.
But somehow I always gat a “Closing Brackets for the parent command may be missing” error message.

What am I doing wrong here ? Why can’t I change that value ?

You’re not doing anything wrong, it’s just one of those times where the zscripting doesn’t work as you’d expect. I’m afraid that for cases like this it’s trial and error to find a solution.

I think you’ll find this works OK:


[ISubPalette,"Zplugin:PSTools"]

[Ibutton, "Zplugin:PSTools:Save with time",,
    
    	[VarSet,Temptime,[ZBrushInfo,2] ] 	
    	[VarInc,Temptime]
        [Note,Temptime]    
    ]

HTH,

Awesome! It’s Working, thanks a lot. I see… it’s sometimes better to nest as few as possible.

Sometimes it is fine to nest stuff. I do it a lot. I think it’s more that the compiler has some quirks and will choke on certain things. For example, this will work without problems:

[VarSet,Temptime,[ZBrushInfo,2] ] 	
    	[Note,[Val,Temptime+1] ]

As you’ve found, it can be infuriating when you can’t see anything wrong. :slight_smile: