如何解决blender的属性错误?

2024-10-08 18:26:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个问题,我已经尝试了几种方法来解决,但到目前为止都没有成功。在

这个简单的代码是使用blender 2.49从场景中删除对象:

import Blender
import bpy

def removeobj (scn):
    for ob in scn.objects:
        if ob.type == 'MESH':
            scn.objects.unlink (ob)

scn = bpy.context.scene
removeobj(scn)

但是当我按下p时什么也没有发生,当Alt+p时,属性错误显示:'module' object has no attribute context

我怎么解决这个问题?在


Tags: 对象方法代码importforobjectsdefcontext

热门问题