Show and allow editing of computed transforms in the editor
The Stride Editor shows local transforms for all entities exclusively. This isn't much of a problem if all models are the same scale and are used as-is. However there are many cases where transforms are desired or needed to reuse models and to build more complex compound trees of entities. This quickly becomes more difficult, even more so if the tree has more than one level of nesting. Only being able to see the local transform for a specific detail at times even requires manually doing the math to reverse some transforms in order to get the local transform values right.
Solution
- It would be beneficial to at the very least see the absolute size, orientation and location of an object in world space, besides the local relative transform values. That means the game computes these values for an object when it is selected by traversing all transforms that affect it. The best added value is if these values update in the editor UI in real-time.
- Next it would be useful to edit them directly, still affecting of course only the local transforms of the entity being edited.
- On top of that a slightly more involved feature could be to allow the user to pick an object relative to which the size, orientation and location of the selected object is shown. If any such object is picked, the tranform computed and shown is no longer the transform to world coordinates, but the transform relative to the picked object. This only makes sense if the picked object is a parent of the object being edited, meaning its transform impacts the selected object transform. If it is not, the transform to world coordinates is shown instead.
Describe alternatives you've considered
Blender shows the dimensions of objects under N. But Blender allows applying the three components of each transform and hence usually the local transform is the identity transform and if not, usually the parent of an object has an identity transform such that the local transform is actually absolute. Applying transforms like in Blender is highly unsuitable for stride because in stride the model is merely referenced. The proposed feature still allows obtaining and editing absolute transforms while keeping the local transform as (part of) the source of truth (serialized).
Additional context On top of that there are some objects which have an implicit size or scale like the heightmap. It'd be better if it had a normal transform to remove any and all guesswork and trial and error trying to line up a model and a heightmap based on the same texture. I don't see why it would be an error to have a heightmap that is 1 by 1 meter. There are probably other examples like it.
Here are some questions that can aid in the description of the feature request:
- What are the usecases? Described above
- What kind of options/settings are expected/wanted? None
- What would the (pseudo) code look like? Standard matrix manipulation
- Is the feature affecting behaviour in the editor?
Yes. It might show an additional collapsible group under
Transforme.g.Global Transformwith anotherPosition,RotationandScalewhich are computed and which changeTransformif edited. - Is there a component or datastructure? Reusing existing ones
- what kind of documentation is needed or needs to be updated? Probably minimal in the form of one additional paragraph explaining what the additional values in the property grid are.
- Should there be an example project? No