fix: load_tree_variants() 缺少 return variants 语句
函数在构建 variants 列表后删除了 imported objects 但忘记 return。 Python 隐式返回 None,导致 tree.assemble() 永远进入 'not variants' 分支(但 assemble 里也没有检查 None,只是 silently return 0)。 结果:tree 构建静默失败,场景里一棵树都没有。 181 棵树现在正确出现在 SCENE_DONE 和 GLB 里 (362 objects, 113k tris)。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -95,6 +95,13 @@ def load_tree_variants():
|
|||||||
for obj in imported:
|
for obj in imported:
|
||||||
bpy.data.objects.remove(obj, do_unlink=True)
|
bpy.data.objects.remove(obj, do_unlink=True)
|
||||||
|
|
||||||
|
tris = sum(len(bm.loop_triangles) + len(lm.loop_triangles)
|
||||||
|
for bm, lm in variants)
|
||||||
|
print(f"Poly Haven tree variants loaded: {len(variants)} "
|
||||||
|
f"({tris} tris per instance)")
|
||||||
|
return variants
|
||||||
|
|
||||||
|
|
||||||
def assemble(positions, collection):
|
def assemble(positions, collection):
|
||||||
"""Place island_tree_01 instances at `positions`.
|
"""Place island_tree_01 instances at `positions`.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user