Metasequoia BBS

| 新規投稿 | 通常表示 | ツリー表示 |
状態
タグ
キーワード
[9686] Move object down and rotate / no error in code.
対応不要 [要望,help! ] 返信
    import MQSystem
    import math
    
    doc = MQSystem.getDocument()
    objects = []
    
    # Find the objects we want to move and rotate
    for oi in range(doc.numObject):
        obj = doc.object[oi]
        if obj is not None and obj.name == "obj1":
            objects.append(obj)
    
    # Move and rotate the objects
    for obj in objects:
        # Move the object down
        obj.translation.y -= 10.0  # Adjust the value to move the object to the desired height
    
        # Rotate the object
        mtx = MQSystem.newMatrix()
        # Set the matrix to rotate around the X axis by 45 degrees

続きを表示...
2023-02-15 09:47