PDA

View Full Version : zscript how can I set vertical light placement



JohnArtbox
01-15-02, 06:56 PM
I'm trying to write a lighting z script , but I'm stuck on Light placement.
Using the z record function gives you horizontal placement from -1 to 1(left to right), but no vertical placement is recorded.
How do I set the vertical placement of the light?
Thanks
John :confused:

Muvlo
01-15-02, 08:24 PM
By lighting placement, are you refering to changing the direction of the sphere-control in the lighting palette?

If so, I think you need the [IClick] command. You can tell it to drag in the sphere box with a start point (x,y) and an end point (x,y).

I'm sorry if this isn't what you meant. :)

JohnArtbox
01-15-02, 11:46 PM
Thanks Muvlo, That will probably work for light direction.
But it seems that the lights section of ZScript needs a bit of work.
To try and work out the correct commands I recorded a session where I turned on all of the lights and altered their properties , turning on shadows,changing colours etc.
I then reloaded the script and pressed play.
The script executed all the commands in order, but only on the first light. When I looked at the script there was no reference to a light number or identifier.
Am I missing some essential step? Likewise the light direction mentioned above does not record correctly, making it impossible to record a lighting zscript.

Dear Zscript gurus..please prove me wrong. :confused:

WingedOne
01-16-02, 04:57 AM
I don't think ZScripts can handle all of the light properties currently, but probably will in a future release.

davey
01-16-02, 12:01 PM
Muvlo is part right! :)

To select a light, you need to IPress it first. Since the popup info for each light is the same, you'll need to use its Window ID.

The Window ID can be found by opening your Preferences palette, and finding the Window ID slider. Whenever you float your cursor over any interface item, that slider updates to show the item's Window ID.

In this case, the first light's Window ID is 1556, the second is 1557, the third is 1558, and so on.

Once you've selected the light, you need to use IClick to change the light position. Consider this diagram:
http://www2.zbrushcentral.com/zbc_uploads/user_image-1011211047ikd.jpg

This diagram tells you what the IClick numbers mean. An IClick at 0,0, for example, clicks in the upper-lefthand corner.

You will need to put two sets of numbers in the IClick command. To put the light placement at center top, write it like this:

<blockquote>[IClick,Light:Light Placement, 0, 0, 32, 0]</blockquote>

So your IButton to set the first light's placement to center top would look like this:

<blockquote>[IButton,"Set the Light","Light Setting",
[IPress,1556]
[IClick,Light:Light Placement, 0, 0, 32, 0]
]
</blockquote>

Hope this helps, John. Good luck flying :)
dave

JohnArtbox
01-16-02, 12:52 PM
Thanks Davey & Muvlo
You realise you've completely destroyed any chance of me getting work done today.
I'll just cruise along writing this little utility until I hit another brick wall, whereupon I'll scream and run in circles with my hands in the air.
Nice to know that zbrushcentral is there and most of the time we can get an answer to a query within a few hours. When I started in 3d(about 10 years ago) if you couldn't work it out yourself, you were toast.
Till the next time I get hysterical
John
:) :) :)

WingedOne
01-16-02, 01:31 PM
Thanks Davey that'll come in useful and I apologize for posting horribly wrong information (see above). :rolleyes: D'OH!

JohnArtbox
01-21-02, 02:58 PM
Hi Guys,
I used the IPress command to succesfully select and alter the positions of lights,but I'm stuck trying to work out how to reliably turn the lights on, and off. I've tried IPress,IEnable, and half a dozen other commands but I admit I'm stabbing in the dark.
The next step, I guess, would be to first test if the light is enabled before IPressing once to select it, and a second time to enable it. This seems a bit roundabout though.
ciao
John

Muvlo
01-21-02, 03:08 PM
Hi John. I'm not using a computer with ZBrush on it at the moment, but here is what I think you do, assuming I understand you correctly:

1. Go to Preferences ::Utilities.

2. Position your mouse over the light you want to turn on or off in the lighting palette. Look back at the Utilities, and check its Window ID.

3a. To turn the light on, enter the following into your ZScript:
[IPress,Light ID]
Where "Light ID" is the ID number you got before.

3b. To turn the light off, enter the following into your ZScript:
[IUnPress,Light ID]
Where "Light ID" is the ID number you got before.

Does this help? If not, say so. :)

JohnArtbox
01-21-02, 04:21 PM
Muvlo, This doesn't work. Ithink it's because you have to press the light buttons twice in the interface, once to select and once more to activate.
A simple script should be able to be:
[IButton, LightsOn, Turnonallthelights,
[IPress, 1556]
[IPress, 1557]
[IPress, 1558]
[IPress, 1559]
[IPress, 1560]
[IPress, 1561]
[IPress, 1562]
[IPress, 1563]
]
But this doesn't work.
John

WingedOne
01-21-02, 05:10 PM
Try this then:

[IButton, LightsOn, Turnonallthelights,
[IPress, 1556]
[IPress, 1556]
[IPress, 1557]
[IPress, 1557]
[IPress, 1558]
[IPress, 1558]
[IPress, 1559]
[IPress, 1559]
[IPress, 1560]
[IPress, 1560]
[IPress, 1561]
[IPress, 1561]
[IPress, 1562]
[IPress, 1562]
[IPress, 1563]
[IPress, 1563]
]

It'll be up to you to pay the electric bill, however. :)

JohnArtbox
01-21-02, 09:14 PM
Ok, I feel stupid.
I was thinking the second Ipress might unpress the light(as it does if you use a mouse) and that I would have to do a conditional statement.
But this works great, thanks all.
John