Notifications
Clear all
[Closed] Why can't I access the camera position during loop processing?
Aug 22, 2014 6:23 am
I have a loop that is supposed to do this:
- Set the animation range to a specific range.
- Read the height of a specific camera in the scene.
- Move on to the next specific animation range and repeat the above step.
[i]**The start and end frames of the ranges being used are held in an array.
[/i]For some reason in the above loop the camera’s z.pos value stays the same no matter where
the it should be at the point in the script.
I have tried this:
- Redrawing the viewport at each point in the loop (updating the height of the camera in the viewport).
- Adding numerous pieces of code to stall the loop (to read the height). Things like running loops within the loop that moves the camera in and out of it’s current position.
**[i]Which I can see working in the viewport but for some reason the z.pos still can’t be accurately read.
[/i]This is driving me nuts.
All help appreciated.
2 Replies
Aug 22, 2014 6:23 am
I think this is the classic use case for the at time context ?
Aug 22, 2014 6:23 am
Yes shortly after I posted this I realized that was the issue.
I changed it to a “for i” loop instead and that fixed it.
I was going to delete and/or edit this question but it was being hidden for review (as it’s my first post here).
Thanks anyway.