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

Add support for Blender 4.0 #104

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Mysteryem
Copy link

Updated the addon to handle changes in 4.0 affecting this addon:

  1. NodeTree socket inputs and outputs have been combined into a single interface.
  2. PrincipledBSDF's emission input has been renamed from "Emission" to "Emission Color".
  3. Armature/Bone Layers have been removed.
  4. Bone Groups have been removed.

NodeTree socket creation and clearing has been moved to new functions that are defined differently depending on the Blender version, so that 4.0 and newer use the new NodeTree.interface API.

Getting PrincipledBSDF's emission input now uses the new name on Blender 4.0 and newer.

Showing/Hiding Bones in 4.0 and newer is now done by assigning to/unassigning from the "Visible Bones" Bone Collection. This isn't a great solution because all Bones must now belong to at least one other Bone Collection and all other Bone Collections each Bone is in must be hidden, but this results in behaviour closer to the original use of Armature/Bone Layers than only hiding the bones in Pose mode and not Edit mode.

Bone Groups have been replaced with extra Bone Collections in 4.0 and newer. The colors that were being set on Bone Groups are now set on each bone individually.


https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/Python_API#Breaking_changes

This seems to be the changes required to get the addon to support the recently released Blender 4.0.

I don't personally use this addon, but fixed it for a friend who does, so this patch was quickly put together and has not been well tested.

4.0 removed both armature/bone layers and bone groups.

The bone colors that were set on bone groups are now set on bones
individually.

The new method of hiding and unhiding bones doesn't work very well
because it relies on all bone collections being hidden aside from the
"Visible Bones" collection and requires that all bones are added to at
least one collection because bones not in any collections are always
visible (unless they have been individually hidden).
@krigeta
Copy link

krigeta commented Nov 16, 2023

may you share the one?

@Mysteryem
Copy link
Author

may you share the one?

If you mean the updated addon files, the link is at the top of the pull request to https://github.com/Mysteryem/XNALaraMesh/tree/master where the code (green button) can be downloaded as a .zip and installed as an addon.

@magnusroe
Copy link

Works perfectly in 4.0.2.0. Thank you! I never had any luck with this plugin before and had wasted several days rigging characters manually.

@Marcelievsky
Copy link

Marcelievsky commented Apr 3, 2024

Hi!
Is the plugin working with latest Blender 4.1 (stable) version? It's showing a error when I try to import model
error

@Dyo-Anima
Copy link

Dyo-Anima commented May 6, 2024

@Mysteryem hi just came to confirm that in blender 4.1 your fork stopped working, any help?

https://developer.blender.org/docs/release_notes/4.1/python_api/#mesh

@Mysteryem
Copy link
Author

@Mysteryem hi just came to confirm that in blender 4.1 your fork stopped working, any help?

https://developer.blender.org/docs/release_notes/4.1/python_api/#mesh

Sorry, this PR was a one-off contribution that I decided to share after fixing it for Blender 4.0 for a friend of mine. I don't use the add-on, so I don't have any interest in maintaining it.

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

Successfully merging this pull request may close these issues.

None yet

5 participants