Notifications
Clear all

[Closed] selecting and transforming lights

I wonder how to:

Select light|s AND target|s and setting a new common pivot point and rotate them as a group.

Appreciate any help

9 Replies

Hi,

maybe linking lights/targets to some heleper/gemetry and setting its pivot/rotation will do the job.

jk

hi jk

Can this be done wholly through maxscript ?

I would like to avoid having to do a lot of setup BEFORE the script is run.

Yes, add some light and geometry to scene, run something like this:


$TPhotometricLight01.parent = $Box01
$Box01.rotation.x_rotation += 45

Next step is to make loop through some objectset (selection, lights), makes some checks like if classof object is something to setup parent when you want.

regards

jk

Thanks jk

However I have a problem figuring out how to script a target light WITH a target.
Any pointers to how this is done ?? (Yes I`m new at this)

You can check the .target property of the light.

No target:

hasProperty $TPhotometricLight01 “target” returns false

So, how do I create my target light WITH target ??

Well I don’t know why hasProperty returns false there, because .target is a common node property…
You can check if it has a target using:

$mylight.target != undefined

TPhotometricLight02 = Target_Light()
TPhotometricLight02.target != undefined | returns false

Target is nowehere to be found when creating a target light this way.

Figured it out:

TPhotometricLight02 = Target_Light()
TPhotometricLight02.target = Targetobject transform:(matrix3 [1,0,0] [0,1,0] [0,0,1] [11.783,39.8582,0])
TPhotometricLight02.target != undefined | now returns true

Thanks for input guys !