ZBrushCentral

Image/Texture/Plane3D/ZScript questions

Many of these questions are related to ZScripting only the the sense that I want to use them from a ZScript; it’s quite possible that I simply haven’t figured out how to do them using the UI (obviously, if I knew that, I could just record and use the ZScript commands), but on the other hand I will be using this stuff in a ZScript, so if there are scripting abilities not accessible from the UI, I would be quite happy to use those also. None of the existing ZScript commands do these things, from what I can infer from their descriptions.

The basic goal is load an image, and display it with its proper proportions within the canvas, and with the ability to scale it and move it within the canvas. Some combination of any of the following abilities would be useful to me:

  1. The ability to import the image with the width/height proportion constrained to remain fixed.

  2. The ability to get the dimensions of an image.

  3. The ability to get the dimensions of a texture map (an image imports into a texture at full, unchanged size, so this would be a way to get the dimensions of an image.)

  4. The ability to create a Plane3D whose initial size corresponds to a height and width given in pixels.

Thanks in advance,
Ken

I’m a noob myself so have mercy with my terms and descriptions…

  1. open ZB
  2. select Plane3d Tool
  3. paint a plane into the middle of the canvas (use shift to have it ‘flat’ facing to you).
  4. click on scale (not edit and scale, JUST scale)
  5. click on transform menue
  6. open that menue into a shelf (press icon with arrow in circle) so it stays open
  7. open INFO section (you see three values)
  8. click on value and enter/view manually the dimension of your Plane.

You can also click on move and then enter the exact location of this plane.

Somehow I think it would be cool to have those three info values always on the screen somewhere.

Cheers!
LemonNado

Well, you’ve answered some of your questions yourself. :slight_smile:

ZScripts can be used to gather information from the interface and apply it in various ways. Record a zscript of what you want to do, look at the code and then refine it.
Here’s some code to get you started:


[VarDef,imagefile,""]
[VarDef,imagewidth,0]
[VarDef,imageheight,0]

[IButton,"Import image","Select an image file",
[VarSet,imagefile,[FileNameAsk,Photoshop(*.psd)|*.psd|BMP(*.bmp)|*.bmp|JPEG(*.jpg)|*.jpg||
,,"Select an image..."]]
[If,[StrLength,Imagefile]>0,
[FileNameSetNext,imagefile]
,[Exit]]
	[IPress,Texture:Import]
	[VarSet,imagewidth,[IGet,Texture:Width]]
	[VarSet,imageheight,[IGet,Texture:Height]]
	[Note,[StrMerge,"Image width : ",imagewidth,"
Image height : ",imageheight],,,,,150]
]//end button

lemonnado,
Don’t forget you can Ctrl+drag any slider or button on to your shelf and the Ctrl+Shift+I to save the configuration. :slight_smile:

:+1:small_orange_diamond:+1:small_orange_diamond:+1:small_orange_diamond:+1:small_orange_diamond:+1:small_orange_diamond:+1:small_orange_diamond:+1:small_orange_diamond:+1:

Of course I forgot! Wheeeeeee.
LemonNado