Jump to content

Questions GetAccPos3D & SetAccPos3D

Recommended Posts

Hi All,


I am trying to get my head around manipulating accessories through Python scripts. Ultimately I would like to be able to position an accessory by a criteria such as the accessory name. I wonder if that is even possible as the function reference only seems to give handles to accessory index and not the name, but that is for a later step. 


As a novice on scripting I am getting stuck on getting the GetAccPos3D & SetAccPos3D to do anything at all at this moment. 


First I tried GetAccCount which worked instantly:


crit = "((R IN ['Lighting Device']))" 	

def callback(h):						
	NumAcc = vs.LDevice_GetAccCount(h, 0)

vs.ForEachObject(callback, crit) 		

Then I tried GetAccPos3D, and the script seems to run but does not do anything. I tested the ForEachObject with a test string in an Alert dialog in the Callback, so I am sure that this does step through the lighting devices. Also I tried various combinations of the Accessory index and Cell index, but to no avail. My assumption is that a single cell lighting device would have cell index 0, and in the OIP I can see that the Accessory I am trying to manipulate has #2 as prefix before it's name in the dropdown. So I assumed that the accessory index is 2. Nonetheless I tried many other combinations as well. 


Also I am uncertain on how to handle the fact that this function returns multiple values. 


crit = "((R IN ['Lighting Device']))"    

def callback(h):                       
    outRotation3D, outPosition3D = vs.LDevice_GetAccPos3D(h, 0, 2)

vs.ForEachObject(callback, crit)         

Would anyone be able to push me in the right direction?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...