Metasequoia BBS

| 新規投稿 | 通常表示 | ツリー表示 |
状態
タグ
キーワード
[9688] help rotate obj1 to 180 and move it down / no error in code.
対応不要 [要望,help! ] 返信
import MQSystem

doc = MQSystem.getDocument()
objnum = doc.numObject

# Find the object to move
for oi in range(objnum):
    obj = doc.object[oi]
    if obj is not None and obj.name == "obj1":
        print("Found obj1")
        if hasattr(obj, "translation"):
            # Move the object down by 1 unit
            translation = obj.translation
            translation.y -= 1
            obj.translation = translation
            # Rotate the object 180 degrees
            rotation = MQSystem.newAngle(0, 180, 0)
            obj.rotation = rotation
        else:
            print("obj1 does not have a translation attribute")

続きを表示...
2023-02-15 15:40