Re: XREF Object Problems
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I wanted to clarify the scenario.
I have an importer for a game engine that looks for prop files. When it detects that the prop already exists in MAX format, it brings the prop in as an XREF Object. It always gets placed correctly at import time--transformation if perfect (translation, rotation). Save the file, thinking all is good. Then when reopen.... all XREF objects are over at [0,0,0] with no rotation.
It is very bizarre.
I updated the code to write the prop's transform to the userdata after it's been placed... and this is just getting REALLY WEIRD.
I am sharing a screen shot.
Immediately after import (when all creation/placement of the prop is done) the prop's USERDATA write says the prop is at the origin!!! But the very prop is very obviously NOT at the origin. In the Mini MXS listenter you can clearly see the transform (I selected and printed $.transform). The current viewport transform is:
(matrix3 [-0.75471,0.656059,0] [-0.656059,-0.75471,0] [0,0,1] [772,1468,-328])
but the transform the script understood when done placing it there was: (matrix3 [1,0,0] [0,1,0] [0,0,1] [0,0,0])
Now the scene shows the prop in the correct place. When I save it and close... then re-open, it goes to origin.
There are no scripted controllers, no animations... just an XREF moved to some location.
Something in the code must be causing Max to get confused on some CRAZY way... but I can't thinkg of anything that could cause this. Maybe something to do with using clauses like with undo off or with redraw off or with sanity off...
I think I need a Steve or a DenisT or a Bobo to step in.... and if anything throw some random suggestions.
Shawn Olson
Developer of Wall Worm
3ds Max plugins and Scripts
3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019
Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti