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.

@jshengst
Copy link

@Mysteryem hi just came to confirm that in blender 4.1 your fork stopped working, any help?嗨,刚刚来确认在 Blender 4.1 中您的分叉停止工作,有什么帮助吗?

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

I find this fix for 4.1 https://github.com/Mysteryem/XNALaraMesh/blob/fad067463cf301af974a1182898f1388ed0bc34b/import_xnalara_model.py

@Dyo-Anima
Copy link

@Mysteryem hi just came to confirm that in blender 4.1 your fork stopped working, any help?嗨,刚刚来确认在 Blender 4.1 中您的分叉停止工作,有什么帮助吗?
https://developer.blender.org/docs/release_notes/4.1/python_api/#mesh

I find this fix for 4.1 https://github.com/Mysteryem/XNALaraMesh/blob/fad067463cf301af974a1182898f1388ed0bc34b/import_xnalara_model.py

thanks a lot for finding it, I confirm it works in blender 4.1

@Marcelievsky
Copy link

Marcelievsky commented Jun 20, 2024

@Mysteryem hi just came to confirm that in blender 4.1 your fork stopped working, any help?嗨,刚刚来确认在 Blender 4.1 中您的分叉停止工作,有什么帮助吗?
https://developer.blender.org/docs/release_notes/4.1/python_api/#mesh

I find this fix for 4.1 https://github.com/Mysteryem/XNALaraMesh/blob/fad067463cf301af974a1182898f1388ed0bc34b/import_xnalara_model.py

Thank you! Now I can use Blender 4.1 finally 🙂
Edit: sadly I'm facing a new problem when exporting a model
---------------EXECUTING XPS PYTHON EXPORTER----------------

Exporting file: E:\Users\Marcelo\Documents\XPS 11.8\XNALara_XPS\data##COMMISSIONS & REQUESTS#Request Sammysora\Sean\xps.xps
Exporting Armature 323 Bones
Exporting Mesh: 5_earring_1.0_0_0
Traceback (most recent call last):
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\xps_tools.py", line 310, in execute
export_xnalara_model.getOutputFilename(xpsSettings)
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 66, in getOutputFilename
xpsExport()
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\timing.py", line 29, in wrap
ret = f(*args)
^^^^^^^^
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 112, in xpsExport
xpsMeshes = exportMeshes(selectedArmature, selectedMeshes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 176, in exportMeshes
meshVerts, meshFaces = getXpsVertices(selectedArmature, mesh)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 315, in getXpsVertices
mesh.data.calc_normals_split()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Mesh' object has no attribute 'calc_normals_split'

@Cuvhe
Copy link

Cuvhe commented Jun 29, 2024

@Mysteryem hi just came to confirm that in blender 4.1 your fork stopped working, any help?嗨,刚刚来确认在 Blender 4.1 中您的分叉停止工作,有什么帮助吗?
https://developer.blender.org/docs/release_notes/4.1/python_api/#mesh

I find this fix for 4.1 https://github.com/Mysteryem/XNALaraMesh/blob/fad067463cf301af974a1182898f1388ed0bc34b/import_xnalara_model.py

Thank you! Now I can use Blender 4.1 finally 🙂

Edit: sadly I'm facing a new problem when exporting a model
---------------EXECUTING XPS PYTHON EXPORTER----------------

Exporting file: E:\Users\Marcelo\Documents\XPS 11.8\XNALara_XPS\data##COMMISSIONS & REQUESTS#Request Sammysora\Sean\xps.xps Exporting Armature 323 Bones Exporting Mesh: 5_earring_1.0_0_0 Traceback (most recent call last): File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\xps_tools.py", line 310, in execute export_xnalara_model.getOutputFilename(xpsSettings) File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 66, in getOutputFilename xpsExport() File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\timing.py", line 29, in wrap ret = f(*args) ^^^^^^^^ File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 112, in xpsExport xpsMeshes = exportMeshes(selectedArmature, selectedMeshes) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 176, in exportMeshes meshVerts, meshFaces = getXpsVertices(selectedArmature, mesh) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\marce\AppData\Roaming\Blender Foundation\Blender\4.1\scripts\addons\XNALaraMesh-master\export_xnalara_model.py", line 315, in getXpsVertices mesh.data.calc_normals_split() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'Mesh' object has no attribute 'calc_normals_split'

Getting the same thing :|

UPDATE: I am not sure how to use GitHub honestly, all new to this, but I made a fix for it and will post it once I am off work tomorrow night.

@Cuvhe
Copy link

Cuvhe commented Jul 1, 2024

Here is a fix for the 'calc_normals_split' issue some people are having.

https://github.com/Cuvhe/XNALaraMesh

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.

7 participants