Page 1 of 1

Set Active Camera by WINGUID

Posted: 22 Apr 2018, 17:59
by trueBlue
Learned something new from Workspace shortcuts today.
It's always been a pain, and well still is, that most of tools in Workspace need to have the 3D Window in focus in order for them to work.
So I tried using the WINGUID, which is labeled as the 'Workspace 3D Window' in shortcuts to set a view from an object I am working on.
The below command worked in all layouts, with and without the 3D window in focus.

Code: Select all

D3DView.SetActiveCamera("", '17D544A3-3F58-436B-83E7-F8B4D7D4E7C5')

Re: Set Active Camera by WINGUID

Posted: 23 Apr 2018, 21:59
by stan
seem great for a layout with one 3d view, but it changes every view to the same view in 4 view so not really good for that or any layout with two or more views.. that guid might be good for render setting ie; wire solid ...changing grids in all views too if possible..

Re: Set Active Camera by WINGUID

Posted: 23 Apr 2018, 22:19
by trueBlue
Yeah , I noticed that.
This one does not change every window.

Code: Select all

D3DView.SetActiveCamera("", '{2C152F81-45A2-4035-8896-9E49D60C8A7A}')
As an example that I am going to use for Spot and Projector lights for a Camera view.
View ON

Code: Select all

Node.Select("%THIS_NAME%")
Node.ConRemove("%THIS_NAME%", "Camera")
Node.ExportConnector("%THIS_NAME%" + "/Camera", "Camera", "", 1, 1)
D3DView.SetActiveCamera("", '{2C152F81-45A2-4035-8896-9E49D60C8A7A}')
Space.Unselect()
View Off

Code: Select all

Space.Unselect()
D3DView.SetActiveCamera('/D3DView/' + Node.SubObject("/D3DView", 0), '{2C152F81-45A2-4035-8896-9E49D60C8A7A}')
Node.ConRemove("%THIS_NAME%", "Camera")