[VarDef,dllPath,""] [RoutineDef,SetDLLpath, [VarSet,isMac, [ZBrushInfo,6]] //check Mac or PC // Make sure we have the dll and set its path [If,isMac, [VarSet,dllPath,"ZBRUSH_ZStartup/ZPlugs64/PaintStopData/PaintStopDLL.lib"] , [VarSet,dllPath,"ZBRUSH_ZStartup\ZPlugs64\PaintStopData\PaintStopDLL64.dll"] ] ] [RoutineDef,CheckEdit,//check mesh is in Edit mode [If,[IsEnabled,Transform:Edit], [If,[IGet,Transform:Edit],, [Note,"\Cff9923 No Mesh in Edit mode",,,4737096,,300] [Exit] ] , [Note,"\Cff9923 No Mesh in Edit mode",,,4737096,,300] [Exit] ] ]//end routine [IButton,"Actual Size","Set model at actual size", [IShowActions,0] [RoutineCall,CheckEdit] [RoutineCall,SetDLLpath] //get model position and scale [If,[MemGetSize,DisplayActualSize_Mem],, [MVarDef,DisplayActualSize_Mem,9,0] ] [MTransformGet,DisplayActualSize_Mem] //get screen factor [VarSet,screenF,[FileExecute, [Var,dllPath], GetScreenFactor]] [VarSet,xSize,[IGet,Tool:Geometry:X Size]] [VarSet,exportScale,[IGet,Tool:Export:Scale]] [If,exportScale == 0, [VarSet,exportScale,1]]//must not be zero //multiply to get actual size [VarMul,exportScale,xSize] //adjust amounts for XYZ Size of 2 [VarDiv,xSize,2] [VarDiv,exportScale,xSize] [VarDiv,exportScale,2] //adjust value for screen (assumes 96 ppi) [VarSet,displaySize,exportScale] //for mm [VarMul,displaySize,(96/25.4)*screenF] //for cm use: //[VarMul,xSize,(96/2.54)*screenF] //for inches use: //[VarMul,xSize,(96*screenF)] //set displayed model scale to xSize [IPress,Document:Actual]//make sure document is actual size [IUnPress,Draw:Perspective]//turn off perspective [MVarSet,DisplayActualSize_Mem,3,displaySize] [MVarSet,DisplayActualSize_Mem,4,displaySize] [MVarSet,DisplayActualSize_Mem,5,displaySize] [MTransformSet,DisplayActualSize_Mem] ]