WeakAuras

WeakAuras

200M Downloads

SetTransform requires a negative scale to properly display the model

MacTwist opened this issue ยท 3 comments

commented

Description

SetTransform requires a negative scale to properly display the model in the current WA code, however the slider doesn't allow negative values. Positive values will render the model inside out as mentioned in a few discord posts. Possible solution is to always negate the scale value when using SetTransform.
Reference to issues:
https://discord.com/channels/172440238717665280/218084462523711489/843634145527988305

https://discord.com/channels/172440238717665280/218084462523711489/745682965853372457

WeakAuras Version

WeakAuras 5.0.5

World of Warcraft Flavor

Retail (Default)

Tested with only WeakAuras

  • Yes
  • No

Lua Error

No response

Reproduction Steps

  1. Create model aura
  2. Click 'Use SetTransform'
  3. Observe model appears inside out

Last Good Version

No response

Screenshots

No response

Export String

No response

commented

Both of your linked discord discussions don't explain how to reproduce the issue.

Nor could I reproduce the issue with your reproduction steps, the lich king looks fine to me.

commented

It isn't as obvious with the lich king but if you take another model like the felhound.m2 you'll notice the issue very well. I can post a video if it helps. Bringing the scale up also helps seeing the issue.
Bug

commented
  1. Create model aura
  2. Set Model to 123878 (or felhound.m2)
  3. Check 'Use SetTransform'
  4. Set model x offset to 140
  5. Set model y offset to 45
  6. Set model x Rotation to 270
  7. Set model z rotation to 108
  8. Set model scale to 135
  9. Set model width to 726
  10. Set model height to 882
  11. Set x offset to 428
  12. Set y offset to -20

Note that all the positioning params don't really matter for the bug, it's just to repro the bug as I see it in the screenshot I pasted above.

Modifying the addon code to use '-s' as the last param of SetTransform in the following function fixes the problem

function Private.ModelSetTransformFixed(self, tx, ty, tz, rx, ry, rz, s)
-- In Dragonflight the api changed, this converts to the new api
self:SetTransform(CreateVector3D(tx, ty, tz), CreateVector3D(rx, ry, rz), s)
end