當前位置: 首頁>>代碼示例>>Python>>正文


Python SetTransformOperation.push方法代碼示例

本文整理匯總了Python中UM.Operations.SetTransformOperation.SetTransformOperation.push方法的典型用法代碼示例。如果您正苦於以下問題:Python SetTransformOperation.push方法的具體用法?Python SetTransformOperation.push怎麽用?Python SetTransformOperation.push使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UM.Operations.SetTransformOperation.SetTransformOperation的用法示例。


在下文中一共展示了SetTransformOperation.push方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: centerObject

# 需要導入模塊: from UM.Operations.SetTransformOperation import SetTransformOperation [as 別名]
# 或者: from UM.Operations.SetTransformOperation.SetTransformOperation import push [as 別名]
    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,代碼行數:11,代碼來源:CuraApplication.py

示例2: setScaleZ

# 需要導入模塊: from UM.Operations.SetTransformOperation import SetTransformOperation [as 別名]
# 或者: from UM.Operations.SetTransformOperation.SetTransformOperation import push [as 別名]
 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,代碼行數:13,代碼來源:ScaleTool.py

示例3: setObjectHeight

# 需要導入模塊: from UM.Operations.SetTransformOperation import SetTransformOperation [as 別名]
# 或者: from UM.Operations.SetTransformOperation.SetTransformOperation import push [as 別名]
 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,代碼行數:15,代碼來源:ScaleTool.py

示例4: setObjectDepth

# 需要導入模塊: from UM.Operations.SetTransformOperation import SetTransformOperation [as 別名]
# 或者: from UM.Operations.SetTransformOperation.SetTransformOperation import push [as 別名]
 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,代碼行數:15,代碼來源:ScaleTool.py

示例5: centerObject

# 需要導入模塊: from UM.Operations.SetTransformOperation import SetTransformOperation [as 別名]
# 或者: from UM.Operations.SetTransformOperation.SetTransformOperation import push [as 別名]
    def centerObject(self, object_id):
        node = self.getController().getScene().findObject(object_id)

        if node:
            op = SetTransformOperation(node, Vector())
            op.push()
開發者ID:lotuspaperboy,項目名稱:Cura,代碼行數:8,代碼來源:CuraApplication.py


注:本文中的UM.Operations.SetTransformOperation.SetTransformOperation.push方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。