Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addon fix works partially (4.0) #12

Open
batonchick1 opened this issue Dec 4, 2023 · 4 comments
Open

addon fix works partially (4.0) #12

batonchick1 opened this issue Dec 4, 2023 · 4 comments

Comments

@batonchick1
Copy link

Hello. Interestingly, the addon's fix partially doesn't work: it links objects in "object" mode without any problems.
It also connects an armature in pose mode to an object in "object mode" if the armature is the parent, but if the parent is an object in "object mode" or if you need to connect two different armatures in pose mode, it throws an error:

Python: Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\dynamic_parent.py", line 287, in execute
dp_create_dynamic_parent_pbone(self)
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\dynamic_parent.py", line 188, in dp_create_dynamic_parent_pbone
bpy.ops.constraint.childof_set_inverse(
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py", line 106, in call
C_exec, C_undo = _BPyOpsSubModOp._parse_args(args)
File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\modules\bpy\ops.py", line 60, in _parse_args
raise ValueError("1-2 args execution context is supported")
ValueError: 1-2 args execution context is supported

@romanvolodin
Copy link
Owner

romanvolodin commented Dec 4, 2023 via email

@PurrfectDreamm
Copy link

I have the same error, the DeepSeek AI ​​said that most likely the issue is in Blender API Compatibility:
"Verify Blender API Compatibility
Ensure that your script is compatible with the version of the Blender API you are using. If there have been changes to the API between Blender versions, it might affect the way operators are called.

import bpy
def dp_create_dynamic_parent_pbone(context, last_constraint):

Step 1: Use the correct execution context

bpy.ops.constraint.childof_set_inverse(context, constraint=last_constraint.name, owner='BONE')

Step 2: Assume you have the context and last_constraint properly obtained

context = bpy.context
last_constraint = ... # Obtain the constraint object properly in your script

Step 3: Call the function

dp_create_dynamic_parent_pbone(context, last_constraint)"

Mb this will help you somehow, but I didn't understood a thing... And btw I LOVE this addon and use it every time, really great stuff, saves me a ton of time!

@romanvolodin
Copy link
Owner

Looks like fixed in d4e6188. At least it works fine in my simple scene.

@PurrfectDreamm
Copy link

Looks like fixed in d4e6188. At least it works fine in my simple scene.

Yes, it's fixed! Thank you very much! Большое спасибо, теперь всё идеально работает, этот аддон невероятно полезен для меня и я благодарен тебе за твою работу.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants