We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Lock/Unlock user camera movement

Home Forums Programming Lock/Unlock user camera movement

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #37809
    shape
    Participant

    Hi everyone! I’m wondering if it’s possible to control these settings, which are available in Blender for camera objects, via code (or puzzle, but I didn’t find anything there):

    Camera Settings

    Basically, I turned camera control off in Blender because the first thing I want to happen when the page is loaded is a camera animation being played, without the user interfering. After the animation is finished (or when the user clicks a certain object), I want to unlock the camera again, i.e. enable the “Orbit” controls and panning.

    Is it possible to do that on the fly via javascript?

    Thanks!

    PS: I have tried to just leave it enabled anyway, but that makes weird things happen to the camera (it’s suddenly not in its starting position anymore but floating somewhere above, and the animation doesn’t run properly anymore.)

    #37818

    Yes, you made it right: if you making animation for camera you need to set it to No Controlls. You can use two cameras: one for animation with No Controlls settings and one woth Orbit camera type and switch between them with Set Active Camera puzzle.

    Co-founder and lead graphics specialist at Soft8Soft.

    #37822
    shape
    Participant

    Thank you for your reply. Interestingly, that’s what I tried as well. I have a second camera at the end position of the first camera that I switch to on click of the TV. This is what my puzzle looks like:

    Screenshot of Puzzle

    But when I click on the TV, the camera seems to jump to another position instead of staying where it is.

    I also attached an archive of my application folder including the .blend file, I’d appreciate if you could have a look at it. Maybe something else is wrong?

    #37959
    shape
    Participant

    Does someone else know what might be wrong here? Is this a bug or expected behavior? Maybe it’s just not possible to set the position of a user-controlled camera?

    Would really appreciate some help on this. Thanks in advance!

    #37963

    You also need to set a look at point at the same place at which the animated camera look at. Or setup it before the scene exported, because Orbit camera type always look at the specific point that set in Vereg3D settings of camera (Traget/Object point).

    Co-founder and lead graphics specialist at Soft8Soft.

    #38036
    shape
    Participant

    That did the trick, thank you very much!

    For this project that’s all I need, but I’m still wondering: is it possible to get the current active camera or maybe all camera objects via Javascript? (Couldn’t get it to work with puzzles because it’s not possible to plug the “active camera” puzzle into an if-query).

    If one could retrieve a list of current camera objects in the scene, that could make it possible to adjust camera properties on the fly without switching cameras and would allow for great flexibility.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.