Python Equivalents in Time bar, main UI...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 20/01/2011 at 15:50, xxxxxxxx wrote:
I'm looking for a python equivalent for
1. "Expand to Full View" in the time bar
2. In the main perspective view, Cameras/Scenes Cameras/myNewCamera --- so that the view shows the view through my newly-built camera.On this latter point... I don't see any visual confirmation in the viewport when the view is looking through a specific scene camera (ie "Perspective" changing to "myNewCamera"). Is there a way to achieve that? It makes it a bit less obvious what the user has got without any visible UI change.
It would be nice if the Background object could be told to be visible only when viewed through a specific camera.... I'm going to have to replace it with real geometry because it's annoying/unusable as is.
Thanks for your help. I'm wrapping up increasingly smaller details, the C4D community will like the result, I think.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/01/2011 at 09:06, xxxxxxxx wrote:
For a command like "Expand to Full View", you'll usually just use c4d.CallCommand(id) to execute it. You can find the ID by selecting the command in the Command Manager. Expand to Full Time would be CallCommand(1018525)
The currently active camera will be checked in the view panel's Camera - Scene Cameras menu. You can also choose Edit-Configure from the view panel menu and in the HUD tab of the AM enable the Camera option. This will show the active camera's name in the HUD.
To activate a camera, you need to get the BaseDraw (view panel) you want to activate. You can get the active (selected) BaseDraw with doc.GetActiveBaseDraw(), the basedraw set as the render view with doc.GetRenderBaseDraw() or a specific BaseDraw by index using doc.BaseDraw(n).
The parameters for a BaseDraw are the same as those found in the Viewport Configure AM - so to set the camera you'd use:
bd = doc.GetActiveBaseDraw() bd[c4d.BASEDRAW_DATA_CAMERA] = cam