Jump to content

Camera function reference


Recommended Posts

There aren't any dedicated functions for Camera objects that I know of, but you wouldn't need anything specific to cameras for what you are asking.  If you just want to rename the camera, you can use vs.SetRField to change the Camera's internal record field to the name you desire.  The Camera object also seems to have its unique name automatically update from that field, so it wouldn't be the worst idea to also use vs.SetName to set the object to the new name.  And you would also need a vs.ResetObject to get the changes to stick.

 

Here's a sample script that changes a selected camera's name to "new name".  Keeping in mind that there's no sort of error checking to make sure the name is not already in use or verifying that the selected object is actually a Renderworks Camera.  If you need help in how to flesh this out to fully meet your needs, let me know.

 

import vs

h = vs.FSActLayer()

name = "new name"

vs.SetRField(h,"RenderWorks Camera","Name",name)
vs.SetName(h,name)

vs.ResetObject(h)

 

Link to comment

Actually, playing around with this a little more has revealed that the internal record field for "Name" and the object's name are linked, so changing either of them will update the other.  This means that if you change both of them, like I do in the script above, will result in a "-1" being added since the name is then otherwise in use.  If I were in your shoes, I think I would just use the SetName function and be done with it.

  • Like 1
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.

Guest
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...