This PR introduces greater control over how objects are snapped into media frames including:
The option to keep the object's current scale.
The option to align with the axis boundaries when the object does not exactly fill the space.
The canonical example would be a board game like chess with irregular sized pieces. Large media frames obscure the board making it hard to place pieces, resizing the pieces to fit the frame will make pawns the same size as kings, and centering the objects within the frame will make some of them float above the board. While it is possible to edit the objects themselves to "hack" around these limitations, it is complicated and not entirely solvable.
The media-frame code was slightly refactored for clarity, including the addition postfixes to some variables indicating their type (obj, eid, etc...). The code has different paths for video objects and for "new loader" imports, all of which were considered.
A test scene was created to demonstrate and explore the various combinations of situations, which can be accessed here:
The best way to understand this PR is probably to grab the code and load this scene. Some text is included to explain the intention of each section. Some of it is designed to test edge cases such as scaled frames, frames on spawned objects, etc...
This PR introduces greater control over how objects are snapped into media frames including:
The canonical example would be a board game like chess with irregular sized pieces. Large media frames obscure the board making it hard to place pieces, resizing the pieces to fit the frame will make pawns the same size as kings, and centering the objects within the frame will make some of them float above the board. While it is possible to edit the objects themselves to "hack" around these limitations, it is complicated and not entirely solvable.
This PR expects extra parameters from the companion Blender exporter add-on PR.
The media-frame code was slightly refactored for clarity, including the addition postfixes to some variables indicating their type (obj, eid, etc...). The code has different paths for video objects and for "new loader" imports, all of which were considered.
A test scene was created to demonstrate and explore the various combinations of situations, which can be accessed here:
The best way to understand this PR is probably to grab the code and load this scene. Some text is included to explain the intention of each section. Some of it is designed to test edge cases such as scaled frames, frames on spawned objects, etc...