I am trying to invoke a custom operator from a blender addon, e.g. this one. However, when I call it from the command line I am getting the following error message:
>>> bpy.ops.node.liexport('INVOKE_DEFAULT')
Error: Traceback (most recent call last):
File "/ttsesm/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_operators.py", line 607, in invoke
node = context.node
AttributeError: 'Context' object has no attribute 'node'
location: /ttsesm/blender/blender-2.83.2-linux64/2.83/scripts/modules/bpy/ops.py:199
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "/ttsesm/blender/blender-2.83.2-linux64/2.83/scripts/modules/bpy/ops.py", line 199, in __call__
ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Error: Traceback (most recent call last):
File "/ttsesm/blender/blender-2.83.2-linux64/2.83/scripts/addons/vi-suite06/vi_operators.py", line 607, in invoke
node = context.node
AttributeError: 'Context' object has no attribute 'node'
from my understanding the explanation is related to what @batFINGER is describing here. But then my question would be how to invoke the operator from the script.
The operator is related with the Export
button that you can see in the node below:
and which node I created with the following commands:
ng = bpy.data.node_groups.new('NodeTree', 'ViN')
context_node = ng.nodes.new(type="No_Li_Con")