Godot: set_bone_global_pose not found

Created on 8 Oct 2019  路  10Comments  路  Source: godotengine/godot

Godot version: 3.2 alpha 1

Issue description: set_bone_global_pose not found

bug core

Most helpful comment

I think there should be a deprecated for (ifdef deprecated) 4.0 but existing in 3.2 wrapper for set_bone_global_pose.

Thoughts?

Edited:

#ifndef DISABLE_DEPRECATED
void Skeleton::set_bone_global_pose (int p_bone, const Transform &p_pose) {
WARN_DEPRECATED_MSG("Skeleton.set_bone_global_pose() is deprecated and will be removed in a future version. Use Skeleton.set_bone_global_pose_override() instead.");
    set_bone_global_pose_override(p_bone, p_pose, 1.0, true);
}
#endif // DISABLE_DEPRECATED

void Skeleton::_bind_methods() {
#ifndef DISABLE_DEPRECATED
    ClassDB::bind_method(D_METHOD("set_bone_global_pose", "bone_idx", "pose"), &Skeleton::set_bone_global_pose);
#endif // DISABLE_DEPRECATED
}

// Same for get.

All 10 comments

i can take this issue

There was API break and now it should be probably - set_bone_global_pose_override

This was removed by @reduz in #32275. CC @fire @RevoluPowered

Should set_bone_global_pose be an alias for set_bone_global_pose_override?

It's late so someone probably needs to check the api.

Edited:

It has sufficiently different arguments to be different.

I think there should be a deprecated for (ifdef deprecated) 4.0 but existing in 3.2 wrapper for set_bone_global_pose.

Thoughts?

Edited:

#ifndef DISABLE_DEPRECATED
void Skeleton::set_bone_global_pose (int p_bone, const Transform &p_pose) {
WARN_DEPRECATED_MSG("Skeleton.set_bone_global_pose() is deprecated and will be removed in a future version. Use Skeleton.set_bone_global_pose_override() instead.");
    set_bone_global_pose_override(p_bone, p_pose, 1.0, true);
}
#endif // DISABLE_DEPRECATED

void Skeleton::_bind_methods() {
#ifndef DISABLE_DEPRECATED
    ClassDB::bind_method(D_METHOD("set_bone_global_pose", "bone_idx", "pose"), &Skeleton::set_bone_global_pose);
#endif // DISABLE_DEPRECATED
}

// Same for get.

set_bone_global_pose_override
Tried to apply, it works. Thanks.

Reopening as adding a deprecated binding would be good to prevent the compat breakage.

Reopening as adding a deprecated binding would be good to prevent the compat breakage.

Actually there's quite a few things that @reduz removed in https://github.com/godotengine/godot/pull/32275/commits/d81ddaf33ecddab1c83bc964b0bee4328b7f7b06#diff-214a5966987d9e878c00fb24d5de700cL790-L812 and for which we can't easily re-add deprecated implementations, as it would mean adding a lot of code which is no longer relevant.

So it's probably best to just mention the API breakage for Skeleton in the changelog (CC @Calinou).

@akien-mga Done.

The behavior is fundamentally different, now, and I'm struggling to get things to work properly with the new function. See my post here:

https://github.com/godotengine/godot/issues/33552#issuecomment-592921625

I think it would be good to keep set_bone_global_pose as a function to simply convert to local space so those calculations don't have to be done in gdscript. Also, IK is broken with the new function. Bones drift out of place and lots of jitter is introduced. I was able to put this back in 3.2 without any trouble. The only thing missing was support for an optimization path only applicable if there was no parent bone. I just deleted that code. I'm not sure if it works without it if you try to set the pose of the root bone, but I'm not doing that in my case.

Here is the change I made:

https://github.com/jitspoe/godot/commit/3cf33fc639d7a75c3d18beecdbcdd6aece89079b

I didn't touch the code that has physics driving bones because I'm not using that, and I don't know if it's broken.

Was this page helpful?
0 / 5 - 0 ratings