SetTransform requires a negative scale to properly display the model
MacTwist opened this issue ยท 3 comments
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
- Create model aura
- Click 'Use SetTransform'
- Observe model appears inside out
Last Good Version
No response
Screenshots
No response
Export String
No response
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.
- Create model aura
- Set Model to 123878 (or felhound.m2)
- Check 'Use SetTransform'
- Set model x offset to 140
- Set model y offset to 45
- Set model x Rotation to 270
- Set model z rotation to 108
- Set model scale to 135
- Set model width to 726
- Set model height to 882
- Set x offset to 428
- 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