ZBrushCentral

apply displacement map problem

Hey guys !
For some reason I use this line of code :
[ IPress, Tool:Displacement Map:Apply DispMap ]
but it does’nt apply anything
i have a displacement map selected, my mesh do have Uvs…
and my displacement map is on or off, the result is the same.

does some one has an idea ?

Thx !

You need set the Displacement Intensity to something other than zero.

When I read you answer Marcus, i have thought : “OMG it must be this ! I am soooo stupid !”

But unfortunately it doesn’t seem to come from this : furthermore when I use the [ Iset, Tool:Displacement Map:Intensity, 0.05 ], it doesn’t change the settings (really weird)

here is my code

[ VarDef, VGCurrentDiffMap, “” ]
[ VarDef, VGGeneratedDispMap, “” ]

[ Ibutton, “GoPlanar”, “Creates a planar version of your texture to tweak it with matCap”,

[ If, [ IsEnabled, Transform:Edit ] && [ IGet, Transform:Edit ] , [ TransformGet, xPos, yPos, zPos, xSc, ySc, zSc, xRot, yRot, zRot ] [ ISet, Tool:Geometry:SDiv, 1] [ ISet, Tool:UV Map:UV Map Size, 2048] [ iPress, Tool:Displacement Map:Adaptive ] [ IPress, Tool:Displacement Map:Create DispMap ] [ IPress, Tool:Displacement Map:Clone Disp ] [ VarSet, VGGeneratedDispMap, [ StrMerge, "PopUp:", [ IGetTitle, Alpha:Current Alpha,0 ] ] ] [ IPress, Tool:Texture Map:Clone Txtr ] [ VarSet, VGCurrentDiffMap, [ StrMerge, "PoPup:", [ IGetTitle, Texture:Current Texture,0 ] ] ] [ Ipress, Texture:CropAndFill ] [ IPress, Layer:clear ] [ IColorSet, 0, 0, 0 ] //enregistrer la couleur pour la remettre ensuite [ IPress, document:Back ] [ IColorSet, 255, 255, 255 ] [ ISet, document:Rate, 0 ] [ Ipress, Material:MatCap White01 ] [ IPress, Tool:Plane3D ] [ CanvasClick, 10, 10, 10, 20 ] [ IPress, Transform:Edit ] // [ IPress, Color:Fillobject] [ TransformSet, xPos, yPos, zPos, xSc, ySc, zSc, 0, 0, 180] [ IPress, Transform:Fit ] [ Ipress, Tool:Make polyMesh3D ] [ IUnpress, Tool:Geometry:Smt ] [ IPress, Tool:Geometry:Divide ] [ IPress, Tool:Geometry:Divide ] [ IPress, Tool:Geometry:Divide ] [ IPress, Tool:Geometry:Divide ] [ IPress, Tool:Geometry:Divide ] [ IPress, Tool:Geometry:Divide ] [ IPress, Tool:Geometry:Del Lower ] [ IPress, Tool:Texture Map:TextureMap ] [ IUnpress, VGCurrentDiffMap ] [ IPress, Tool:Displacement Map:DisplacementMap ] [ IUnpress, VGGeneratedDispMap ] //[ IPress, Tool:Polypaint:polypaint from Texture ] //[ IPress, Tool: Displacement Map:Disp On ] [ Iset, Tool:Displacement Map:Intensity, 1 ] [ IPress, Tool:Displacement Map:Apply DispMap ] //[ Iunpress, Tool:Texture Map:Texture On ] [ iUnpress, Draw:ZAdd ] , ] //end if 1

] //end IButton

edit:I put some values in note just for testing

Hmm, I got some odd behaviour which I couldn’t account for. Anyway, this version of your script seems to work OK. I made a couple of changes that you might want to make use of. I also turn off the current texture and alpha after generating the displacement map which was causing them not to be selected later on. I’m not sure why.

Thx a lot Marcus i gonna try this now !

Hey Marcus is the change you made i have few questions :

in : [If,mapSize > ([IHeight,1004]-10) <-- why minus 10 ?

in :[ IKeyPress,13,[ IPress, Texture:CropAndFill ] ] <-- what does [ IKeyPress,13, does ?

It works BTW !
Thx for your help!

I’m glad to hear it works. :slight_smile:

in : [If,mapSize > ([IHeight,1004]-10) <-- why minus 10 ?

The 1004 is the UI item code for the canvas, so IHeight gets the height of that in pixels. I subtract 10 pixels from that just to make the document fit the available space better.

in :[ IKeyPress,13,[ IPress, Texture:CropAndFill ] ] <-- what does [ IKeyPress,13, does ?

The IKeyPress command simulates a keypress and ‘13’ is the ASCII code for the ‘Enter’ key. This is useful for those button presses that throw up a dialog box (as CropAndFill will do). Provided pressing Enter gives the right result (in other words ‘OK’ rather than ‘Cancel’) this can stop the script stalling and the need for the user to take action. One situation where this won’t work is the dialog you get when deleting a subtool - pressing Enter simply cancels the action.

ok thanks !

ywqayecb
ubzqxk8l
edsonimmp
xmttea
miniducear0310