Metasequoia BBS

| New message | Normal | Tree |
Status
Tag
Keyword
[9677] flip horzitanly :S / cant mirror in code dsnt let me select mirrored fa
[Request,help! ] Response
import MQSystem

doc = MQSystem.getDocument()
objects = [None, None]
objnum = doc.numObject

for oi in range(0, objnum):
    obj = doc.object[oi]
    if obj is None:
        continue
        
    if obj.name == "obj1":
        objects[0] = obj

for obj in objects:
    if obj is None:
        continue
        
    obj.mirrorType = 1  # Separate at center
    obj.mirrorAxisX = 1  # Disable X axis mirroring

Show more...
2023-02-14 09:30
[9685] Re: flip horzitanly :S / d4rt
You need to freeze the object to be able to edit the mirrored mesh:

obj.freeze(2)
2023-02-15 05:00
[9687] Re: flip horzitanly :S / no error in code.
>You need to freeze the object to be able to edit the mirrored mesh:
>
>obj.freeze(2)

did try but nohting. lol :S
2023-02-15 09:48
[9690] Re: flip horzitanly :S / d4rt
Just so I understand you want a script to mirror an object along the X axis like you do through Menu > Selected > Mirror (ZX, Local coordinate) and also keep the original mesh?
2023-02-15 21:23
[9691] Re: flip horzitanly :S / d4rt
*Y axis
2023-02-15 21:29
[9692] Re: flip horzitanly :S / no error in code.
>*Y axis


yes i allrdy got it working! :S took couple days to get it working with chatGPT! :I  now i need to move object little bit down and rotate it   did try many diffrent codes but nohting.
kinda fustrated now ;S
2023-02-16 09:20
[9694] Re: flip horzitanly :S / d4rt
# Rotate object around local axis

s = MQSystem
d = s.getDocument()
o = d.object[d.currentObjectIndex]
o.translation = s.newPoint(0,0,0)
o.rotation = s.newAngle(0,180,0)
m = o.rotation.getMatrix()
for f in o.face:
    for j in f.index:
        v = o.vertex[j]
        n = m.mult3(v.getPos())
        v.setPos(n)
2023-02-16 21:59
[9695] Re: flip horzitanly :S / no error in code.
># Rotate object around local axis
>
>s = MQSystem
>d = s.getDocument()
>o = d.object[d.currentObjectIndex]
>o.translation = s.newPoint(0,0,0)
>o.rotation = s.newAngle(0,180,0)
>m = o.rotation.getMatrix()


thnk you so much !


here is my discord!
RoseHeart#0644


2023-02-16 22:58
[9696] Re: flip horzitanly :S / no error in code.
># Rotate object around local axis
>
>s = MQSystem
>d = s.getDocument()
>o = d.object[d.currentObjectIndex]
>o.translation = s.newPoint(0,0,0)
>o.rotation = s.newAngle(0,180,0)
>m = o.rotation.getMatrix()


rotation is broken ! wierd, cube when 180 it goes nuts,
>for f in o.face:
>    for j in f.index:
>        v = o.vertex[j]
>        n = m.mult3(v.getPos())
>        v.setPos(n)
2023-02-16 23:36
[9697] Re: flip horzitanly :S / no error in code.
>># Rotate object around local axis
>>
>>s = MQSystem
>>d = s.getDocument()
>>o = d.object[d.currentObjectIndex]
>>o.translation = s.newPoint(0,0,0)
>>o.rotation = s.newAngle(0,180,0)
>>m = o.rotation.getMatrix()
>
>



s = MQSystem
d = s.getDocument()
o = d.object[d.currentObjectIndex]
z = s.newPoint(0, 0, 1) # define a vector along the local Z-axis
t = o.translation + z * distance # move along the local Z-axis by a specified distance
o.translation = t # set the new position


it does not seem to work z axis :S
2023-02-17 00:32
[9698] Re: flip horzitanly :S / no error in code.
>>># Rotate object around local axis
>>>
>>>s = MQSystem
>>>d = s.getDocument()
>>>o = d.object[d.currentObjectIndex]
>>>o.translation = s.newPoint(0,0,0)
>>>o.rotation = s.newAngle(0,180,0)
>>>m = o.rotation.getMatrix()
>>
>>
>
>
>
>s = MQSystem
>d = s.getDocument()
>o = d.object[d.currentObjectIndex]
>z = s.newPoint(0, 0, 1) # define a vector along the local Z-axis
>t = o.translation + z * distance # move along the local Z-axis by a specified distance
>o.translation = t # set the new position
>

Show more...
2023-02-17 01:36
[9699] Re: flip horzitanly :S / d4rt
s = MQSystem
d = s.getDocument()
o = d.object[d.currentObjectIndex]
o.translation = s.newPoint(0,0,0)
o.rotation = s.newAngle(0,180,0)
m = o.rotation.getMatrix()
for v in o.vertex:
    n = m.mult3(v.getPos())
    v.setPos(n)


2023-02-17 02:55
[9700] Re: flip horzitanly :S / no error in code.
>s = MQSystem
>d = s.getDocument()
>o = d.object[d.currentObjectIndex]
>o.translation = s.newPoint(0,0,0)
>o.rotation = s.newAngle(0,180,0)
>m = o.rotation.getMatrix()
>for v in o.vertex:
>    n = m.mult3(v.getPos())




it rotates model SO far i need it to rotate center of the model WORLD  when i click Rotate it rotates fine in there x axisi 90.  and i cant cant get working to move object down :s
same as selecting Move and move it down. :S idk :S

2023-02-17 03:23