Jump to content

How to find out if object is flipped and which way


Recommended Posts

Does anyone know how to find out if a PIO object has been mirrored horizontally or vertically? I've tried testing using IsObjectFlipped but this doesn't tell you if its been flipped about the X or the Y axis. So then I tried using FlipHybridMatrix and testing again but this Function doesn't seem to do anything inside a PIO. (note the handle to the PIO instance is stored in self.handle)

 

def isFlippedHorizontal(self):
    if vs.IsObjectFlipped(self.handle):
        vs.FlipHybMatrixObj(self.handle, 1) #flip vertical and test again then flip back. If still flipped then rerturn true
        r = vs.IsObjectFlipped(self.handle)
        vs.FlipHybMatrixObj(self.handle, 1)
        return r
    else:
        return False

In theory GetObjectVariableReal(h, 102) should return the scale of the PIO object, and it should be negative if it is flipped about the X axis but it always returns a very small positive number when used on a plugin handle. Anyone got any other ideas for how to hack a workaround for this problem?

Link to comment

Well this question is pointless, I just realised that it doesn't matter. Imagine standing looking a roof panel, one side clips over the other side so you need to know which side has the covering bit (the 'overcloak') and which side has the seam the fits under the covering bit (the 'undercloak') If your panel is flipped vertically then the observer is rotated 180 to stand looking at the panel but the overcloak and undercloak have stayed on the same sides as before the flip so when you stand rotated 180º looking at the panel from the front the overcloak and undercloak have swapped sides. Likewise, if you stay in the same place and flip the panel. the overcloak and undercloak have swapped sides. So the answer to my question is 'it doesn't matter' because I am an idiot... If the panel is flipped the undercloak has swapped sides with the overlcloak regardless of whether it was a horizontal flip or a vertical flip. So when I report the panel in my list if  IsObjectFlipped() returns true I report left as right and right as left and everything is golden!

Edited by Will
autocorrect inserted some weird words
  • Like 1
Link to comment

FLIPPED doesnot have an axis implied when it it detected. Flipped Horizontally, and Flipped Vertically are the same thing, except the final rotations differ by 180°. VW default flip is vertical, meaning the rotat...  —  Okay, never mind. you figured it out.

 

Raymond

Edited by MullinRJ
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...