ZBrushCentral

Data from binary file ?

Hi all
I would like to :

  1. read bytes from a binary file
  2. Convert every 4 bytes to a floats
  3. Displace Tool in Zbrush using floats

Some pointers , as to how to achieve this in ZScript would be grand

I would like to create a data pipeline between Vue,GameEngine & ZBrush

You can use the [MemRead] command to read from a memory block, after first creating the block from the file using [MemCreateFromFile]. If you were reading char, you could then put these together using [StrMerge]. That would give you a string that represented your float. In zscript the only numerical data type in float so there would be no need to do more than evaluate the string using [Val].

As for ‘displacing the tool in ZBrush’, you are limited in zscript to using the interface buttons or sliders, for example in the Tool>Deformation submenu.

Many thanx for this info.

To work around the displacement limitations, can I
Create an obj in memory and then use it as a Tool ?

Also, just to clarify

I would like to keep the file/pipe binary and not use chars to represent floats
Is this viable?
If not, I may well just export an obj from Vue, which I would rather avoid.

You can’t transfer data from a memory block directly to ZBrush. If you had an OBJ in memory you’d have to write out a file and then import that into ZBrush using the standard import. That’s slow using zscript - it would be better to write a dll.

If you are using [MemRead] then you are restricted to the [basically C++] data types as indicated in the Command Reference. I mentioned char because that’s the only one that occupies a single byte. See here: http://www.zbrush.info/docs/index.php/ZScript_Command_Reference#Memory_Blocks

Hey marcus
I have noticed that there is a GOZ binary IO in 3.2
Are you aware of the layout of the data, so I can begin hacking ?
Are the new updates to ZBSCRIPT ?

Hi romm,

There will be an SDK for GoZ released in due course so you’ll need to wait for that.

thanx marcus,
how about a heads up on the byte layout of the myfile.GoZ file export option
I need to get into this with C# BinaryReader and BinaryWriter.
If i could get this, I it will save me counting bytes in my HexEditor.

“/Applications/ZBrushOSX 3.2/ZStartup/ExportTamplates”

does the trick

public static byte[] pntsTag = HexUtil.GetBytes(“11270000”);// PNTS tag
public static byte[] plyTag = HexUtil.GetBytes(“214E0000”);// POLY tag
public static byte[] uvTag = HexUtil.GetBytes(“A9610000”); // UV tag

PS : howz that GoZ SDK comming along ?

or please gimme more hex tags if there are.

for FULL ON Zbrush to unity integration

It seems that importing a GoZ file is now not possible in ZBrush4 via the import mesh functionality. This was possible in version 3.2 Mac. is there a reason pixologic would unwittingly compromise my custom pipeline using GoZ ?

I would dearly like to use GoZ as a custom data pipe between arbitrary scriptable applications.

Perhaps closing the MDD loop would do trick?
ie Import and Export MDD.

I wasn’t aware that there had been any changes. Anyhow you’ll find information of use here: http://www.pixologic.com/docs/index.php/GoZ#SDK