Moving the target object of an Arnold target light in Maxscript

Moving the target object of an Arnold target light in Maxscript

antHUR8S
Explorer Explorer
365 Views
2 Replies
Message 1 of 3

Moving the target object of an Arnold target light in Maxscript

antHUR8S
Explorer
Explorer

Hi there, I've created an arnold light with a target as follows and all works well:

 

selectedObj = selection[1]
	
key_light = Arnold_Light intensity:1 exposure:6 normalize:off shapeType:3 targeted: off
key_light.name = "KeyLight"   
key_light.pos = light_position	
key_light.targeted=on

target = "KeyLight.Target"

However when I try to move the KeyLight target, with:

target.pos = selectedObj.pos

 

I get the error 'Unknown property: "pos" in "KeyLight.Target". I can see in the listener that I when I move the target around a 'move' command is executed, but if I try that it still throws errors. Can anyone help?

Thanks!

0 Likes
Accepted solutions (1)
366 Views
2 Replies
Replies (2)
Message 2 of 3

MartinBeh
Advisor
Advisor
Accepted solution

In your code 'target' is a string.

 

You need to use 'target = keylight.target' or, if you prefer to use the scene object name, 'target = $'Keylight.Target'

 

Martin B   EESignature
→ please 'Like' posts that are helpful; if a post answers your question please click the "Accept Solution" button.
0 Likes
Message 3 of 3

antHUR8S
Explorer
Explorer

Of course, silly mistake - appreciate the response, again!

0 Likes