Hi all,
I have written a simple script to create a camera and look through the camera
but i have someproblem in setting the camera to look at the viewport
here is what i tried
hou.GeometryViewport.setCamera('cam1')
and below is the snapshot of the error im getting
please help me out. thank you
Python Houdini
5665 3 0- omy
- Member
- 71 posts
- Joined: 2月 2010
- Offline
- axebeak
- Member
- 51 posts
- Joined: 10月 2006
- Offline
You need an instance of GeometryViewport to call setCamera, it's not static. I think the full expression is something like this:
hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().setCamera(hou.node(“/obj/cam1”))
You can also execute hscript commands from Python:
hou.hscript(“viewcamera -c cam1 *.*.world.persp1”)
hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().setCamera(hou.node(“/obj/cam1”))
You can also execute hscript commands from Python:
hou.hscript(“viewcamera -c cam1 *.*.world.persp1”)
- omy
- Member
- 71 posts
- Joined: 2月 2010
- Offline
axebeak
You need an instance of GeometryViewport to call setCamera, it's not static. I think the full expression is something like this:
hou.ui.paneTabOfType(hou.paneTabType.SceneViewer).curViewport().setCamera(hou.node(“/obj/cam1”))
You can also execute hscript commands from Python:
hou.hscript(“viewcamera -c cam1 *.*.world.persp1”)
thank you very much.2nd one worked perfectly
but in my case.i creatd the camera through script and when the script is executed i want the camera to look through it rather than typing the script again.
is there any way for that?
- axebeak
- Member
- 51 posts
- Joined: 10月 2006
- Offline
-
- Quick Links