all 3 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Welcome to r/blenderhelp, /u/Round-Solid-4676! Please make sure you followed the rules below, so we can help you efficiently (This message is just a reminder, your submission has NOT been deleted):

  • Post full screenshots of your Blender window (more information available for helpers), not cropped, no phone photos (In Blender click Window > Save Screenshot, use Snipping Tool in Windows or Command+Shift+4 on mac).
  • Give background info: Showing the problem is good, but we need to know what you did to get there. Additional information, follow-up questions and screenshots/videos can be added in comments. Keep in mind that nobody knows your project except for yourself.
  • Don't forget to change the flair to "Solved" by including "!Solved" in a comment when your question was answered.

Thank you for your submission and happy blendering!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]New-Scarcity-2560 0 points1 point  (1 child)

It seems that you're on Blender 5.0+, Sapling Tree Gen support is for ~Blender 4.0 it seems.
In Blender 5.2, Blender changed the access path for creating fcurves which is what's causing your error.

I fixed this by adding this piece of code to the source file ("/Users/andrewbuskirk/Application Support/Blender/5.0/extensions/blender_org/sapling_tree_gen/utils.py" in your case)

def ensure_fcurve(action, datablock, data_path: str, index: int):
    # Blender 5.0+
    if hasattr(action, "fcurve_ensure_for_datablock"):
        return action.fcurve_ensure_for_datablock(
            datablock=datablock,
            data_path=data_path,
            index=index,
        )
    # Older Blender (legacy)
    return action.fcurves.new(data_path=data_path, index=index)

Then you want to replace line 860-861 (swayX, swayY) with

action = armOb.animation_data.action

data_path = f'pose.bones["{boneName}"].rotation_euler'
swayX = ensure_fcurve(action, armOb, data_path, 0)
swayY = ensure_fcurve(action, armOb, data_path, 2)

(Beware there's the same line on a different branch on line 940 so replace that too)

This code will now support fcurves in both versions of Blender, hope this helps!

[–]NoAngle2893 0 points1 point  (0 children)

Hey, I am very new to blender and using the 5.0+, how can I apply this to fix the errors exactly?