当前位置: 首页>>代码示例>>Python>>正文


Python SetTransformOperation.SetTransformOperation类代码示例

本文整理汇总了Python中UM.Operations.SetTransformOperation.SetTransformOperation的典型用法代码示例。如果您正苦于以下问题:Python SetTransformOperation类的具体用法?Python SetTransformOperation怎么用?Python SetTransformOperation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了SetTransformOperation类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: centerObject

    def centerObject(self, object_id):
        node = self.getController().getScene().findObject(object_id)

        if not node and object_id != 0: #Workaround for tool handles overlapping the selected object
            node = Selection.getSelectedObject(0)

        if node:
            op = SetTransformOperation(node, Vector())
            op.push()
开发者ID:kelvinfang,项目名称:Cura,代码行数:9,代码来源:CuraApplication.py

示例2: setScaleZ

 def setScaleZ(self, scale):
     obj = Selection.getSelectedObject(0)
     if obj:
         obj_scale = obj.getScale()
         if obj_scale.z != scale:
             obj_scale.setZ(scale)
             if not self._non_uniform_scale:
                 obj_scale.setY(scale)
                 obj_scale.setX(scale)
             operation = SetTransformOperation(obj, None, None, obj_scale)
             operation.push()
开发者ID:kelvinfang,项目名称:Uranium,代码行数:11,代码来源:ScaleTool.py

示例3: setObjectHeight

 def setObjectHeight(self, height):
     obj = Selection.getSelectedObject(0)
     if obj:
         obj_scale = obj.getScale()
         obj_height = obj.getBoundingBox().height / obj_scale.y
         target_scale = float(height) / obj_height
         if obj_scale.y != target_scale:
             obj_scale.setY(target_scale)
             if not self._non_uniform_scale:
                 obj_scale.setX(target_scale)
                 obj_scale.setZ(target_scale)
             operation = SetTransformOperation(obj, None, None, obj_scale)
             operation.push()
开发者ID:kelvinfang,项目名称:Uranium,代码行数:13,代码来源:ScaleTool.py

示例4: setObjectDepth

 def setObjectDepth(self, depth):
     obj = Selection.getSelectedObject(0)
     if obj:
         obj_scale = obj.getScale()
         obj_depth = obj.getBoundingBox().depth / obj_scale.z
         target_scale = float(depth) / obj_depth
         if obj_scale.z != target_scale:
             obj_scale.setZ(target_scale)
             if not self._non_uniform_scale:
                 obj_scale.setY(target_scale)
                 obj_scale.setX(target_scale)
             operation = SetTransformOperation(obj, None, None, obj_scale)
             operation.push()
开发者ID:kelvinfang,项目名称:Uranium,代码行数:13,代码来源:ScaleTool.py

示例5: centerObject

    def centerObject(self, object_id):
        node = self.getController().getScene().findObject(object_id)

        if node:
            op = SetTransformOperation(node, Vector())
            op.push()
开发者ID:lotuspaperboy,项目名称:Cura,代码行数:6,代码来源:CuraApplication.py


注:本文中的UM.Operations.SetTransformOperation.SetTransformOperation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。