Thanks! That works a treat in the console! Thanks a lot for your help so far!
If I want to then pass these values to the camera control setting how would I go about that?
I've tried to modify your code to change the user data focal length box within the CAMERA CONTROLLER tab...Doesn't seem to work so I'm clearly doing something wrong...
Once I crack this I'll be able to use the same code to pass values around with button presses, which is kinda all I want ATM :/
import c4d
#Welcome to the world of Python
def main():
return c4d.BaseObject(c4d.Onull)
def message(msgId, msgData):
if msgId == c4d.MSG_DESCRIPTION_COMMAND:
desc_id = event_data['msg_data']['id']
if msgData['id'] == c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(9)):
op.GetObject()[c4d.ID_USERDATA,8] = 36 #PASS VALUES GO UD CAMERA CONTROLLER WHICH IS LINKED TO CAMERA OBJECT?
elif msgData['id'] == c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(13)):
op.GetObject()[c4d.ID_USERDATA,8] = 50
elif msgData['id'] == c4d.DescID(c4d.DescLevel(c4d.ID_USERDATA), c4d.DescLevel(15)):
op.GetObject()[c4d.ID_USERDATA,8] = 80
return True