sipi Posted February 20, 2021 Share Posted February 20, 2021 Hey everyone, Can I get somehow the position of the current look view when I'm in `no cam` mode in the viewport? Quote Link to comment Share on other sites More sharing options...
anim Posted February 21, 2021 Share Posted February 21, 2021 you can do something like this for example: import toolutils as tu view = tu.sceneViewer().curViewport() view_xform = view.viewTransform() view_position = view_xform.extractTranslates() 2 Quote Link to comment Share on other sites More sharing options...
sipi Posted February 21, 2021 Author Share Posted February 21, 2021 10 hours ago, anim said: you can do something like this for example: import toolutils as tu view = tu.sceneViewer().curViewport() view_xform = view.viewTransform() view_position = view_xform.extractTranslates() It is really nice, thank you!!! But now I'm facing another problem. My main goal is that these values update a vec3 parameter on the interface of an asset, and I actually managed to do this by pushing a button (using your script in a callback script), but I realized I don't want to always push that button. So I wonder, is it possible to update these values automatically for example on every change of the viewport, or somehow? Quote Link to comment Share on other sites More sharing options...
ftaswin Posted February 22, 2021 Share Posted February 22, 2021 __import__("toolutils").sceneViewer().curViewport().viewTransform().extractTranslates().x() __import__("toolutils").sceneViewer().curViewport().viewTransform().extractTranslates().y() __import__("toolutils").sceneViewer().curViewport().viewTransform().extractTranslates().z() Map them in vector3 parm respectively (x,y,z). It will update automatically Quote Link to comment Share on other sites More sharing options...
sipi Posted February 22, 2021 Author Share Posted February 22, 2021 5 hours ago, ftaswin said: __import__("toolutils").sceneViewer().curViewport().viewTransform().extractTranslates().x() __import__("toolutils").sceneViewer().curViewport().viewTransform().extractTranslates().y() __import__("toolutils").sceneViewer().curViewport().viewTransform().extractTranslates().z() Map them in vector3 parm respectively (x,y,z). It will update automatically Well, I tried to use this code in a parameter as python expression, but it only updates if I select or deselect the node. What am I doing wrong? Quote Link to comment Share on other sites More sharing options...
Elevenlevel Posted October 25, 2022 Share Posted October 25, 2022 On 22.02.2021 at 3:02 PM, sipi said: Well, I tried to use this code in a parameter as python expression, but it only updates if I select or deselect the node. What am I doing wrong? Hello. Was it possible to find a solution? Quote Link to comment Share on other sites More sharing options...
sipi Posted October 25, 2022 Author Share Posted October 25, 2022 2 hours ago, Elevenlevel said: Hello. Was it possible to find a solution? Not for me, unfortunately. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.