ZBrushCentral

Variable Size ... 3bytes ???

Variable Size seems to be what the problem is.

 Try out this script.
 Select Everything between the :large_orange_diamond: 's and paste it into a .txt file. Then load it into ZBrush as a ZScipt. Press the button and see for yourself.
 
 I think this is what is happening to me in my <b>[Bit Problem Post](http://www.zbrushcentral.com/zbc/showthread.php?t=26830)</b>
 
 :large_orange_diamond:
 IButton,
     "TestDataSize",
     "Test variables Data Size",
 
     [Note,"Begin Loop 1"]
     [Loop,10,
         [VarSet,v1,[StrMerge,"Loop[1] i:",i,"  Val:",[Val,9999920+i]]]
         [Note,v1]
     ,i
     ]
     
     [Note,"Begin Loop 2"]
     [Loop,10,
         [VarSet,v1,[StrMerge,"Loop[2] i:",i,"  Val:",[Val,99999920+i]]]
         [Note,v1]
     ,i
     ]
     [Note,"Finished"]                                            // Completed
 ]                                                                        /* Notes to user*/
 Cycle Through 2 loops, a 7 digit number works fine, an 8 digit number breaks.
 We are just adding 1 to the base number. There Are 2 sets of 10 cycles (20 total)
 :large_orange_diamond:
 
 Can Someone clarify what is happening ?

<…time goes by…>
Just did some tests and I found this out.
It appears that the variables are limited to 24bits. so you have a max of
16777216
Put the number 16777213 in to the loop, you will see everything OK untill you hit 16777216, then it messes up.

This explains my previous problems happening at 24 / 25. Wow it all seems so clear now. But I have never heard of 3byte variables, kind of strange. OK, I will just enjoy it… now that it is understood.

Chris

Hi:)
The results which you are getting are consistent with the behavior of 32-bits (4 bytes) IEEE standard floating-point format. To better understand this behavior, see this and this.

Hope this helps,
-Pixolator

Pixolator,

I was thinking this might be the issue. I found it strange that the number was not flipping.

Good to know stuff.

Is there any way to specify long/ulong/int/uint vars ?
Or is there any way to work with the bits or values directly in the memory?(without passing the data to externel dll’s etc)

thanks for the links too.

Chris Reid :+1:

Chris,

Pace an answer from Pixolator, you can work with bytes in various formats directly using the MemWrite and MemRead commands.

Marcus

…you are spoiling by Pixo :smiley:
Pilou

God Forbid, don’t want to use up all of his super powers. :):):slight_smile:

marcus_civis-
I am quite familiar with the memoryBlocks now, but I don’t see a way to manipulate the actual data without sending it to a dll.

ZBrush uses the memoryBlock read func, but it reads it into a variable, Well, and I cannot use a variable (that is why I would use the memory in the first place).(I reworked everything so it is just smaller bytes now, but for future posts or users I would like to have the information availiable)

Well, anyhow I got my script and everything finished up, just need to top everything off with the docs and give the beta team a few more plays with it.

Thanks pixolator, and gang.

PS.
Pixolator -
I believe your scripting language is probably the most expandable and simple scripting language I have ever used. And I know quite a few by now. DFusion, LScript, messiah,…the list goes on and on…
It is mainly because of the FileExecute command. This is an invaluable tool.
Keep up the great work, and we will help you push it into the extreems.

I really appriciate your posts, I know how busy you are. If I can help you, please don't hesitate to ask. Many Many Thanks, Chris Reid