//to show Transform values in the Note [VarDef,TransformString(9),""] [VarSet,TransformString(0),"X pos"] [VarSet,TransformString(1),"Y pos"] [VarSet,TransformString(2),"Z pos"] [VarSet,TransformString(3),"X scale"] [VarSet,TransformString(4),"Y scale"] [VarSet,TransformString(5),"Z scale"] [VarSet,TransformString(6),"X rot"] [VarSet,TransformString(7),"Y rot"] [VarSet,TransformString(8),"Z rot"] //code assumes there is a model in Edit mode! [IButton,"Center model","Move the model to the center of the canvas", [If,[MemGetSize,MC_ExampleMem], //memblock exists, do nothing , //no memblock, so create it [MVarDef,MC_ExampleMem,9,0] ] [MTransformGet,MC_ExampleMem,0] [VarSet,docWcenter,[IGet,Document:Width]/2] [VarSet,docHcenter,[IGet,Document:Height]/2] [MVarSet,MC_ExampleMem,0,docWcenter] [MVarSet,MC_ExampleMem,1,docHcenter] [MTransformSet,MC_ExampleMem,0] ] [IButton,"Move memblock","Move data from one memblock to another", ] [If,[MemGetSize,MC_ExampleMem] == 36, [MemCreate,MC_DuplicateMem,36,0]//creates memblock of 36 bytes (for 9 floats) [MemCopy,MC_ExampleMem,0,MC_DuplicateMem,0]//copies data from MC_ExampleMem [VarSet,offset,0] //show what data has been copied [Loop,9, [VarSet,fVal,0]//read variable [MemRead,MC_DuplicateMem,fVal,0,offset]//read floats into variable [Note,[StrMerge,TransformString([Val,n])," = ",fVal,"\n"],,-1] [VarAdd,offset,4] ,n] [Note,""]//to show all previous notes [MemDelete,MC_DuplicateMem]//delete memblock , [Note,"\Cff9000No \CffffffMC_ExampleMem \Cff9000memblock!"] ] ]