Hi, Marcus,
Looking at the list of questions lately on this forum I’m growing into a big-appetite-user on the forum. I don’t hope this is too much for you?
But… I’m having some additional problems while making a new plugin. I see my questioning as a neccessairy phase in my learning process, especially because ZB doesn’t give a real reference guide with many different examples. So that’s my argument to bother you again.
The problem:
I want to be able to place a row of ZSpheres with a zscript starting from ZSphere0
and then ZSphere1 at horizontal distance +50 from parent ZSPhere0
and then ZSphere2 at horizontal distance +50 from parent ZSPhere1
and then ZSphere3 at horizontal distance +50 from parent ZSPhere2
all with the same radius=20
I use as code something like hereunder.
- As you will notice in the code the 2th and 3th ZSphere do fail to come on the right spot, even the radius seems to become bigger than the ordered 20, more like 40 (as if a newly drawn one)
- ZB seems to have a problem with using the variable radius in [ZSphereSet, 4,2,radius]
- I tried to integrate in my code the example I found somewhere on the forum to translate Canvas to Globalvalues. They suggest the formula:
[varset,gx1,gx+50][varset,gy1,gy][varset,gz1,gz]
[varset,nx,(gx1-gx)*0.01]
[varset,ny,(gy1-gy)*0.01]
[varset,nz,(gz1-gz)*0.01]
However, when I do this I can’t see any new ZSphere on screen; I also do not understand the reasoning behind this ‘*0.01’
Code:
[RoutineDef,R_MultipleZSpheres,
[varset,cancenhor,(Document:Width*.5)]
[varset,cancenvert,(Document:Height*.5)]
[Transformset,cancenhor,cancenvert,0,100,100,100,0,0,0]
[FileNameSetNext,“ZBRUSH_ZStartup\ZPlugs\NewGeoExtrudeTemp\workmesh.ztl”]
[IPress,Tool:Save As]
[IPress,Tool:Clone]//workmesh#1
[IPress,Tool:ZSphere]
[IPress,Tool:Clone]//zsphere#1
[Transformset,cancenhor,cancenvert,0,100,100,100,0,0,0]
[ZSphereEdit,
[ZSphereSet,4,0,20]//Sets the radius of the 0th zsphere to 20
]
[Transformset,cancenhor,cancenvert,0,100,100,100,0,0,0]
[varset,gx,cancenhor][varset,gy,cancenvert][varset,gz,0]
//1th additional zsphere:
[varset,gx1,gx+50][varset,gy1,gy][varset,gz1,gz]
[varset,nx,(gx1-gx)]
[varset,ny,(gy1-gy)]
[varset,nz,(gz1-gz)]
[ZSphereEdit,
[ZSphereAdd,nx,ny,nz,20,0] //adds ZSphere1 at +50 offset from x-zsphere_0 and radius=20
FROM HEREON ZB DOESN’T PERFORM LIKE I EXPECT:
[Transformset,cancenhor,cancenvert,0,100,100,100,0,0,0]
//2 additional zsphere:
[varset,gx1,gx+100][varset,gy1,gy][varset,gz1,gz]
[varset,nx,(gx1-gx)]
[varset,ny,(gy1-gy)]
[varset,nz,(gz1-gz)]
[IPress,Tool:ZSphere] //I don’t think this to be necessary
[ZSphereEdit,
[ZSphereAdd,nx,ny,nz,20,1]//Should add ZSphere2 at +100 offset from x-zsphere_0 and radius=20; instead creates a much larger sphere that seems to be at 0,0,0, like a new zero-ZSphere!!!
]
//Now I try to change the radius with a variable, just to try:
[ZSphereEdit,
[ZSphereGet,4,2,radius]
[ZSphereSet,4,2,radius+10]
//ZB Gives INPUT-ERROR, because I use a variable iso a constant?
]
[Transformset,cancenhor,cancenvert,0,100,100,100,0,0,0]
//3
[varset,gx1,gx+150][varset,gy1,gy][varset,gz1,gz]
[varset,nx,(gx1-gx)]
[varset,ny,(gy1-gy)]
[varset,nz,(gz1-gz)]
[IPress,Tool:ZSphere]
[ZSphereEdit,
[ZSphereAdd,nx,ny,nz,20,2]
/*should add ZSphere3 at +150 offset from x-zsphere_0 and radius=20; instead probably also creates a much larger sphere that seems to be at 0,0,0, like a new zero-ZSphere!!!
I can’t see that on the screen, because the strange placing of ZShere2 */
]
[exit]
]
- Another problem is that I want to be able to simulate a series of LBM-clicks on specific points from each other (for instance: 10 points south from each other, starting at a given canvaspoint, say horizontal 100, vertical 200)
I want to use this for a variation of the above.
The idea is to create a kind of spine of ZSpheres that can be curved and bend after ‘Tool:Rigging:Bind Mesh’.
In a variation of the same idea I need the canvas-clicks for the creation of miniZSpheres, using ‘Tool:Topology:Edit Topology’, the method published in july (?) by Rastaman.
Well, Marcus, I hope you will be willing and able to help me with this learningstep, so I can post another plugin under the name of ‘EasyCurve’ or something like that. I wil also use the code as an upgrde of NewGeoExtrude.
Greetings, EddyL