ZBrushCentral

Problem with IFreeze and looping Item Info sliders

Hi all,

In a couple of my recent scripts I have come up against a problem while trying to get data by looping through the ItemInfo slider. I don’t think this is machine specific. The two sliders that have given me problems are those for Tools and Materials; the others may give similar problems but I’ve not tested them.

The problem only arises when using the IFreeze command. The code might be something like this:

[IFreeze,		
[Loop,75,	
	[ISet,Material:ItemInfo,n+1]
	[VarSet,Mat(n),[IGetTitle,Material:ItemInfo]]	
,n]
]

After running this bit of code I get a slowdown in ZBrush operations. Selecting a new material won’t update the pop up and if I try to change the IColors in the Preferences palette ZBrush will sometimes freeze up altogether.

Take out the IFreeze and all is fine. Reduce the loop to below about 60 and all is fine.

It seems that this is to do with how the interface updates (or doesn’t). If I split the operation into three loops of 25, each with its own IFreeze, then there is no problem.

I mention the problem mainly to alert other scripters; if anybody has come across similar issues then it might be useful to post them here.

I seem to remember having a problem like this some time ago. The solution was to restrict my usage of the [Ifreeze,…] command to sections that needed it. In your case of a loop the solution is to put the [IFreeze,…] inside the loop. If you have code outside that needs to be hidden you would of course add additional [IFreeze,…] commands. Btw, I experience the same lag when running your code.

As you said the problem seems to occur with [IFreeze,…]s that encompass loops and specific ui interface operations.

Not sure what causes it. It might be the generation of the Material thumbnails that are updated to quickly without being shown. I wonder if Pixolator could lend us the source code for ZBrush. You know, just for a day or two. :smiley:

Edit: Using your existing code and adding an [IUpdate, 1, 0] inside the loop also seems to help.

Hi TV,

I’m glad you have the same problem. :wink: Yes, I found that using IUpdate helped. Though in the end I have either despensed with IFreeze altogether or used IHide to hide the operations.

When I was pinning down this bug in Marker Master, Antimorph suggested that it might be that the interface was a finite state machine and certain operations do not complete properly during an IFreeze leading to the problem. He was good enough to send me this link which you may find interesting:
“State trees as structured finite state machines for user interfaces”.
http://portal.acm.org/citation.cfm?id=62402.62404