Open nametable opened 1 year ago
I have started taking a look here in this branch. I'm starting to try to create an example to test with. I want to add the ability to use a keyboard shortcut to toggle movement of the parent or child, to see what happens when each is modified without the other, and then both. I've copied and modified examples/2d/multiple_translation.rs
to make examples/2d/parent_child_translation_check.rs
.
For now I may just use Origin::TopLeft
since it naturally transforms correctly between children. I think the problem is with how Bevy's transform_propagate_system
processes the translation of child entities.
Thanks for taking a look. If you think it is a problem with Bevy's propagate system, i guess we should wait 1-2 weeks, port main
to Bevy 0.10 and then try it again. I think, with all the changes done to the scheduling in stageless we need to touch that part of the code anyways.
I don't think it's a problem with the Bevy's propagate system per se, but I think that bevy_svg
will somehow have to "hook" into the child translation propagation. In other words, applying the origin translation is not happening currently with children when the parent translation changes.
I think you are right about waiting for Bevy 0.10 though, especially if it introduces a way for bevy_svg
to "hook into" or provide a custom system for child transform propagation.
I'm having issues similar to this where the child svg will flicker between Centered and TopLeft origin in Bevy 11.2, https://github.com/samuelwatsonofficial/Scarlet .
Version: 0.9 Scenario: I have 2 svgs, one is the parent and has a child svg. Here is stripped down version below:
The problems that I see are as follows:
Origin::TopLeft
of the child instead ofOrigin::Center
of the childOrigin::TopLeft
of the parent, andOrigin::Center
of the child.Origin::TopLeft
of the child, offset from the (correct)Origin::Center
of the parent.I'm not sure if it matters, but I'm using
bevy-inspector-egui
to modify the transforms. A short recording of the issues can be seen below:bevy_svg_parenting_problems.webm
If a more minimal reproduction or repo with example would be useful, I can make one up.