example-sk / audvis

GNU General Public License v2.0
53 stars 1 forks source link

Operator bpy.ops.object.shape_key_add.poll() failed, context is incorrect #12

Open henning101 opened 4 months ago

henning101 commented 4 months ago

Hi everyone!

I get this error I try to generate an example:

RuntimeError: Operator bpy.ops.object.shape_key_add.poll() failed, context is incorrect
Error: Python: Traceback (most recent call last):
  File "/Users/henning/Library/Application Support/Blender/4.1/scripts/addons/audvis/ui/generator/__init__.py", line 170, in execute
    Generator(context).generate()
  File "/Users/henning/Library/Application Support/Blender/4.1/scripts/addons/audvis/ui/generator/generate.py", line 126, in generate
    lattice = self.make_lattice()
              ^^^^^^^^^^^^^^^^^^^
  File "/Users/henning/Library/Application Support/Blender/4.1/scripts/addons/audvis/ui/generator/generate.py", line 356, in make_lattice
    bpy.ops.object.shape_key_add()
  File "/Applications/Blender.app/Contents/Resources/4.1/scripts/modules/bpy/ops.py", line 109, in __call__
    ret = _op_call(self.idname_py(), kw)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Operator bpy.ops.object.shape_key_add.poll() failed, context is incorrect```

Is there any way I can quickly fix this in the code?

Thank you for your help! :) Henning

example-sk commented 4 months ago

The problem is that AudVis user interface was originally only in the panel Properties -> Scene. The same user interface is also in N-panel, which I recommend using. image

example-sk commented 4 months ago

What it means for you: please, use the N-panel (the left one on the screenshot). What it means for me: remove AudVis from Properties -> Scene.