我正在尝试创建自己的面板(在 Blender 2.55 中),这将帮助我修改/创建对象。
我尝试了以下示例:
import bpy
class OBJECT_PT_My_Panel(bpy.types.Panel):
bl_label = "My Panel Test 1"
bl_region_type = "WINDOW"
bl_space_type = "PROPERTIES"
bl_context = "object"
height = bpy.props.IntProperty(attr="height")
def draw(self, context):
layout = self.layout
row = layout.row()
row.prop(self, "height")
但它失败了:(
安慰:
rna_uiItemR:找不到属性:OBJECT_PT_My_Panel.height
这个也失败了:
import bpy
class OBJECT_PT_My_Panel(bpy.types.Panel):
bl_label = "My Panel Test 1"
bl_region_type = "WINDOW"
bl_space_type = "PROPERTIES"
bl_context = "object"
_height = 1
def height_getter(self):
return self._height
def height_setter(self, value):
self._height = value
height = property(fget = height_getter, fset = height_setter)
def draw(self, context):
layout = self.layout
row = layout.row()
row.prop(self, "height")
安慰:
rna_uiItemR:找不到属性:OBJECT_PT_My_Panel.height
我发现的所有示例都使用现有属性,如 object.name、object.location 等。
我找不到任何相关文档。我能做些什么?
谢谢,
阿米尔。