ZBrushCentral

Some questions about memory blocks.

I’m just starting to use memory blocks to store data persistently to files, and while I doubt any of the follow is possible (at least from what I know of ZScript), I thought I’d ask…

First, is there any safe way of saving mem block data in an actual .ZBR document, and then reloading it when that doc is opened? (Assuming the appropriate script is loaded, of course.)

Next, is there any way of creating/setting a variable from a name held in another variable? For example,

[VarDef, x, “foo”]

Now I want to create a variable “foo”, using only code references to x. This would permit writing of a couple of routines which would make saving and restoring large amounts of data (from many variables) to a single memory block very easy.

Finally, are there any other tips or best practices people might want to offer on this subject?

Thanks,
Ken

First, is there any safe way of saving mem block data in an actual .ZBR document, and then reloading it when that doc is opened? (Assuming the appropriate script is loaded, of course.)

Memory blocks created by a zscript are entirely session dependent. The only way to tie a memory block to a specific .zbr document is to create a dedicated .zbr saver and loader zscript. That would most likely involve a seperate data file which your zscript would access to save and load the relevant .zbr and memory block(s).

The [ZBrushInfo,…] command can report a unique session ID and if the .zbr includes such a tag it might be possible in the future. But that all depends on how deep the ZBrush SDK lets us dig as the .zbr file format is a proprietary of Pixologic.

is there any way of creating/setting a variable from a name held in another variable?
I could not make it work nor can I quite see why you would want to do it this way. Without knowing anything about your zscript I would think “hard coding” the functionality would be easier. Object orientated design does not lend itself well to zscripting.

[Edot: Woops. Yes i meant “session dependent”. Thanks Marcus, I think I need some time off too.]

You mean session dependent, don’t you, TVeyes? :wink:

[EDIT & DELETED: realized I’d pretty much repeated what you’d said TV. Time for a holiday, I think. :o