Sapling bug when calling python from outside #83089
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#83089
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: Manjaro
Graphics card: GeForce GTX 960M
Blender Version
Broken:
Blender 2.90.1
build date: 2020-09-29
build time: 00:05:18
build commit date: 2020-09-23
build commit time: 06:43
build hash: 3e85bb34d0d7
build platform: Linux
build type: Release
Worked: (optional)
The following command will run in the script window (with the sapling addon enabled), but will fail if run from an outside script:
bpy.ops.curve.tree_add(do_update=True, chooseSet='5', bevel=True, prune=False, showLeaves=True, useArm=False, seed=0, handleType='0', levels=2, length=(0.8, 0.6, 0.5, 0.1), lengthV=(0, 0.1, 0, 0), taperCrown=0.5, branches=(0, 55, 10, 1), curveRes=(8, 5, 3, 1), curve=(0, -15, 0, 0), curveV=(20, 50, 75, 0), curveBack=(0, 0, 0, 0), baseSplits=3, segSplits=(0.1, 0.5, 0.2, 0), splitByLen=True, rMode='rotate', splitAngle=(18, 18, 22, 0), splitAngleV=(5, 5, 5, 0), scale=5, scaleV=2, attractUp=(3.5, -1.89984, 0, 0), attractOut=(0, 0.8, 0, 0), shape='7', shapeS='10', customShape=(0.5, 1, 0.3, 0.5), branchDist=1.5, nrings=0, baseSize=0.3, baseSize_s=0.16, splitHeight=0.2, splitBias=0.55, ratio=0.015, minRadius=0.0015, closeTip=False, rootFlare=1, autoTaper=True, taper=(1, 1, 1, 1), radiusTweak=(1, 1, 1, 1), ratioPower=1.2, downAngle=(0, 26.21, 52.56, 30), downAngleV=(0, 10, 10, 10), useOldDownAngle=True, useParentAngle=True, rotate=(99.5, 137.5, 137.5, 137.5), rotateV=(15, 0, 0, 0), scale0=1, scaleV0=0.1, pruneWidth=0.34, pruneBase=0.12, pruneWidthPeak=0.5, prunePowerHigh=0.5, prunePowerLow=0.001, pruneRatio=0.75, leaves=150, leafDownAngle=30, leafDownAngleV=-10, leafRotate=137.5, leafRotateV=15, leafScale=0.4, leafScaleX=0.2, leafScaleT=0.1, leafScaleV=0.15, leafShape='hex', leafangle=-12, horzLeaves=True, leafDist='6', bevelRes=1, resU=4, armAnim=False, previewArm=False, leafAnim=False, frameRate=1, loopFrames=0, wind=1, gust=1, gustF=0.075, af1=1, af2=1, af3=4, makeMesh=False, armLevels=2, boneStep=(1, 1, 1, 1))
Error output:
blender --background --python /home/charlesrwest/Documents/tech/sysAdmin/saplingTreeGen/treeGenerator.py
Blender 2.90.1 (hash 3e85bb34d0d7 built 2020-09-29 00:05:18)
Read prefs: /home/charlesrwest/.config/blender/2.90/config/userpref.blend
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
ERROR (bke.lib_id): ../source/blender/blenkernel/intern/lib_id.c:283 id_us_min: ID user decrement error: MADots Stroke (from '[Main]'): 0 <= 0
ERROR (bke.lib_id): ../source/blender/blenkernel/intern/lib_id.c:283 id_us_min: ID user decrement error: PLPalette (from '[Main]'): 1 <= 1
Error: Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
location: /usr/share/blender/2.90/scripts/modules/bpy/ops.py:201
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
location: /usr/share/blender/2.90/scripts/modules/bpy/ops.py:201
location: /usr/share/blender/2.90/scripts/modules/bpy/ops.py:201
Error: Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
location: /usr/share/blender/2.90/scripts/modules/bpy/ops.py:201
Traceback (most recent call last):
RuntimeError: Error: Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
location: /usr/share/blender/2.90/scripts/modules/bpy/ops.py:201
However, the same command will work from an outside script with the showLeaves=False
bpy.ops.curve.tree_add(do_update=True, chooseSet='5', bevel=True, prune=False, showLeaves=False, useArm=False, seed=0, handleType='0', levels=2, length=(0.8, 0.6, 0.5, 0.1), lengthV=(0, 0.1, 0, 0), taperCrown=0.5, branches=(0, 55, 10, 1), curveRes=(8, 5, 3, 1), curve=(0, -15, 0, 0), curveV=(20, 50, 75, 0), curveBack=(0, 0, 0, 0), baseSplits=3, segSplits=(0.1, 0.5, 0.2, 0), splitByLen=True, rMode='rotate', splitAngle=(18, 18, 22, 0), splitAngleV=(5, 5, 5, 0), scale=5, scaleV=2, attractUp=(3.5, -1.89984, 0, 0), attractOut=(0, 0.8, 0, 0), shape='7', shapeS='10', customShape=(0.5, 1, 0.3, 0.5), branchDist=1.5, nrings=0, baseSize=0.3, baseSize_s=0.16, splitHeight=0.2, splitBias=0.55, ratio=0.015, minRadius=0.0015, closeTip=False, rootFlare=1, autoTaper=True, taper=(1, 1, 1, 1), radiusTweak=(1, 1, 1, 1), ratioPower=1.2, downAngle=(0, 26.21, 52.56, 30), downAngleV=(0, 10, 10, 10), useOldDownAngle=True, useParentAngle=True, rotate=(99.5, 137.5, 137.5, 137.5), rotateV=(15, 0, 0, 0), scale0=1, scaleV0=0.1, pruneWidth=0.34, pruneBase=0.12, pruneWidthPeak=0.5, prunePowerHigh=0.5, prunePowerLow=0.001, pruneRatio=0.75, leaves=150, leafDownAngle=30, leafDownAngleV=-10, leafRotate=137.5, leafRotateV=15, leafScale=0.4, leafScaleX=0.2, leafScaleT=0.1, leafScaleV=0.15, leafShape='hex', leafangle=-12, horzLeaves=True, leafDist='6', bevelRes=1, resU=4, armAnim=False, previewArm=False, leafAnim=False, frameRate=1, loopFrames=0, wind=1, gust=1, gustF=0.075, af1=1, af2=1, af3=4, makeMesh=False, armLevels=2, boneStep=(1, 1, 1, 1))
Exact steps for others to reproduce the error
Run this script with sapling enabled: (blender --background --python ./treeGenerator.py)
import os
import sys
import random
import shutil
import bpy
import bpy.ops
import bmesh
from mathutils import Vector
from mathutils import Euler
import add_curve_sapling
output_directory = "./"
Clear scene
bpy.ops.wm.read_homefile(use_empty=True)
Make tree
bpy.ops.curve.tree_add(do_update=True, chooseSet='5', bevel=True, prune=False, showLeaves=True, useArm=False, seed=0, handleType='0', levels=2, length=(0.8, 0.6, 0.5, 0.1), lengthV=(0, 0.1, 0, 0), taperCrown=0.5, branches=(0, 55, 10, 1), curveRes=(8, 5, 3, 1), curve=(0, -15, 0, 0), curveV=(20, 50, 75, 0), curveBack=(0, 0, 0, 0), baseSplits=3, segSplits=(0.1, 0.5, 0.2, 0), splitByLen=True, rMode='rotate', splitAngle=(18, 18, 22, 0), splitAngleV=(5, 5, 5, 0), scale=5, scaleV=2, attractUp=(3.5, -1.89984, 0, 0), attractOut=(0, 0.8, 0, 0), shape='7', shapeS='10', customShape=(0.5, 1, 0.3, 0.5), branchDist=1.5, nrings=0, baseSize=0.3, baseSize_s=0.16, splitHeight=0.2, splitBias=0.55, ratio=0.015, minRadius=0.0015, closeTip=False, rootFlare=1, autoTaper=True, taper=(1, 1, 1, 1), radiusTweak=(1, 1, 1, 1), ratioPower=1.2, downAngle=(0, 26.21, 52.56, 30), downAngleV=(0, 10, 10, 10), useOldDownAngle=True, useParentAngle=True, rotate=(99.5, 137.5, 137.5, 137.5), rotateV=(15, 0, 0, 0), scale0=1, scaleV0=0.1, pruneWidth=0.34, pruneBase=0.12, pruneWidthPeak=0.5, prunePowerHigh=0.5, prunePowerLow=0.001, pruneRatio=0.75, leaves=150, leafDownAngle=30, leafDownAngleV=-10, leafRotate=137.5, leafRotateV=15, leafScale=0.4, leafScaleX=0.2, leafScaleT=0.1, leafScaleV=0.15, leafShape='hex', leafangle=-12, horzLeaves=True, leafDist='6', bevelRes=1, resU=4, armAnim=False, previewArm=False, leafAnim=False, frameRate=1, loopFrames=0, wind=1, gust=1, gustF=0.075, af1=1, af2=1, af3=4, makeMesh=False, armLevels=2, boneStep=(1, 1, 1, 1))
Export gTLF2 file
export_file_path = output_directory + "0.glb"
print("Exporting to " + export_file_path)
bpy.ops.export_scene.gltf(filepath=export_file_path)
Added subscriber: @charlesrwest
Added subscribers: @rjg, @PratikPB2123
@rjg fixed this with the commit
8c87cf0afc
@charlesrwest , please check again with [2.93LTS ]] or [ https:*builder.blender.org/download/daily/ | fresh daily builds
Closing for now but feel free to reopen if problem reappears for you :)
Changed status from 'Needs Triage' to: 'Resolved'