本文整理匯總了Python中bpy.types.PropertyGroup方法的典型用法代碼示例。如果您正苦於以下問題:Python types.PropertyGroup方法的具體用法?Python types.PropertyGroup怎麽用?Python types.PropertyGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bpy.types
的用法示例。
在下文中一共展示了types.PropertyGroup方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: as_dimension
# 需要導入模塊: from bpy import types [as 別名]
# 或者: from bpy.types import PropertyGroup [as 別名]
def as_dimension(self, context, o, dim):
if dim is None:
bpy.ops.archipack.dimension(auto_manipulate=False)
dim = context.active_object
dim.parent = o
dim.matrix_world = o.matrix_world.copy()
dim.select = True
context.scene.objects.active = dim
v = Vector(self.p1) - Vector(self.p0)
d = dim.data.archipack_dimension[0]
d.auto_update = False
d.size = (v).length
x, y, z = self.p2.normalized()
side = 1
if x != 0:
side = x
elif y != 0:
side = y
elif z != 0:
side = z
d.distance = -side * self.p2.length
d.auto_update = True
dim.location = self.p0
dim.rotation_euler.z = atan2(v.y, v.x)
dim.select = False
context.scene.objects.active = o
return dim
# ------------------------------------------------------------------
# Define Manipulable to make a PropertyGroup manipulable
# ------------------------------------------------------------------