Migrate to Blender 5.0 API

- Replaced action.fcurves with channelbag system
- Updated EEVEE_NEXT to EEVEE render engine
- Removed deprecated material.use_nodes and use_shadeless
- Fixed bone selection/hide API for Pose mode
This commit is contained in:
Yusarina
2025-11-15 02:45:37 +00:00
parent d2b98716ff
commit f40b2faacb
13 changed files with 132 additions and 62 deletions
+1 -1
View File
@@ -241,7 +241,7 @@ class AvatarToolKit_OT_AtlasMaterials(Operator):
# Create material nodes
atlased_mat.material = bpy.data.materials.new(
name=f"Atlas_Final_{context.scene.name}_{Path(bpy.data.filepath).stem}")
atlased_mat.material.use_nodes = True
# Note: material.use_nodes is deprecated in Blender 5.0 - materials always use nodes
atlased_mat.material.node_tree.nodes.clear()
principled_node = atlased_mat.material.node_tree.nodes.new(type="ShaderNodeBsdfPrincipled")
+10 -1
View File
@@ -1,5 +1,7 @@
import traceback
import bpy
import bpy_extras
from bpy_extras import anim_utils
import re
from bpy.types import Operator, Context, EditBone, Object, Armature, Mesh
from typing import Optional, Dict, Any, List, Tuple
@@ -347,10 +349,17 @@ class AvatarToolKit_OT_FlipCurrentKeyFrames(Operator):
armature_data.bones.foreach_set("select", [False] * len(armature_data.bones))
# Get channelbag for the action using Blender 5.0 API
action = armature.animation_data.action
if not action.slots:
slot = action.slots.new(for_id=armature.data)
else:
slot = action.slots[0]
channelbag = anim_utils.action_ensure_channelbag_for_slot(action, slot)
#create a set for every frame time where we need to key a keyframe for the flipped pose
times: Dict[float,list[bpy.types.FCurve]] = {}
for curve in armature.animation_data.action.fcurves:
for curve in channelbag.fcurves:
if not curve.data_path.startswith("pose"):
continue
for point in curve.keyframe_points: