0
$\begingroup$

I'm currently creating a script that updates all of the keyframes of an object that's currently been moved. (a feature that 3Ds Max has by default)

I've managed to solve all the problems that happened along the way such as "when animation is playing don't udpate, otherwise animation will go funky" and others, but I just can't seem to tell blender to stop updating keyframes when player is scrubbing through the timeline, me and my colleague have literally tried everything and nothing quite did the job, not even creating our own algorithm that checks for the frame change within scene_update_pre/scene_update_post because of the very nature of scene_update_post/scene_update_pre handlers :(

So I figured that the only way I could do this is to find something like on_gizmo_click_on and on_gizmo_click_off handlers, however I cannot seem to find anything like that in Blender. We are willing to make them ourselves even if we have to dive into the source code, however, since we're relatively new to blender I don't know where we could even draw such an information from? Do any of you have any ideas how I could go about doing this?

I would greatly appreciate any help, as this would not only help me create this script, but it would also help me create many other similar scripts for my team in the future based on this same gizmo handler. (gizmo, manipulator or whatever I should refer to it in the Blender community :D).

$\endgroup$
6
  • $\begingroup$ You can setup a watcher to watch the objects location for changes and run your function on change. See blender.stackexchange.com/questions/19668/… $\endgroup$ Commented Jan 5, 2015 at 16:41
  • $\begingroup$ Jerryno, thanks a lot for your advice which worked to some degree. However some time later I realized that this way doesn't fully do the job because of couple of problems that arise along the way, so please view read my post again up there I've edited it. Thanks again for your previous help and I'd appreciate any further help by you or anyone else! $\endgroup$
    – Vegeta_DTX
    Commented Feb 7, 2015 at 11:04
  • $\begingroup$ If you need a solid solution, probably messing with blenders code will be the best way (I can imagine some code added into modal translate/rotate/scale operators to raise a flag when they are running modal). Everything else will be a hack - scrubbing you can detect with the active area being of type timeline, but you can change the frame also with arrow-key from anywhere(problems after problems..).If you decide to change the sourcecode maybe the devs could help you and do it themselves(write them via mailinglist)or write a codepatch that will get accepted so you dont end up with forked blender $\endgroup$ Commented Feb 7, 2015 at 13:18
  • $\begingroup$ You want to create an "autokey" feature, right? Can you share your code with us? $\endgroup$
    – p2or
    Commented Feb 7, 2015 at 16:28
  • 1
    $\begingroup$ Hello poor, thanks for your comment too! Well I'm not sure if my terminology of 3Ds Max is correct, but no, it's not the autokey feature itself, it's that feature that 3Ds max has when autokey is turned off and so when you move the animated object, it automatically offsets the whole animation spatially to that new location. Also, I'd gladly share that script with everyone I'm a huge fan of sharing and open source, however I'm not sure if the head of my team will allow me to do so now (I'm under contract) :/ In case he does I'll definitely have it sent to you or anyone who wants it. $\endgroup$
    – Vegeta_DTX
    Commented Feb 7, 2015 at 17:13

0

You must log in to answer this question.

Browse other questions tagged .