I'm using Blender 2.79 on Linux with Animation Nodes (Python 3.6).

I'd like to add a stopwatch directly as a node within Animation Nodes, without the Invoke Subprogram. Currently my stopwatch works correctly as a script subprogram, but I can't use it as easily as I'd like and I'm also trying to learn how different add-ons can work together (imagine an add-on extending an add-on instead of directly extending Blender...one add-on importing classes from another add-on).

Seeing how an independent script works is easy, I'm having trouble getting my stopwatch script to directly import AnimationNode in my stopwatch, and I'm not sure, but I suspect I need to do this to make my stopwatch part of Animation Nodes. Can my add-on somehow import AnimationNode? My import statements have all failed even when the path is added to where AnimationNode is, e.g., this fails:

from animation_nodes import AnimationNode

ImportError: cannot import name 'AnimationNode'

Would I have to modify Animation Nodes directly without the possibility of extending it via a separate add-on? I really hate the idea of directly modifying someone else's add-on.

  • $\begingroup$ Before starting your own fork, try using a script node $\endgroup$ – sambler Jul 7 '18 at 4:00
  • 2
    $\begingroup$ Addons are python modules (or package of modules) in the case of animation nodes it is all in submodules. You need to dig into the submodules to find what you need - from animation_nodes.base_types.nodes.base_node import AnimationNode class mynode(bpy.types.Node, AnimationNode): Then you need to register your node and add it to the add node menu. It isn't as straightforward as you would hope. I think adding a file for your node inside the existing addon is going to be the easy way. Have a look at dev guide $\endgroup$ – sambler Jul 7 '18 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.