Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fixes and Undo #471

Open
wants to merge 3 commits into
base: v0_8
Choose a base branch
from
Open

Conversation

Hakazaba
Copy link
Contributor

Duplication can now be undone, and a couple of minor bugs have been fixed to do with zsort and node names.

Duplication can now be undone, and a couple of minor bugs have been fixed to do with zsort and node names.
l.insertInPlace(l.countUntil!(c => c is n)+1,x);
l=l[0..$-1];
}
incAddChildWithHistory(x,n.parent,n.name~(" Copy"));
incActivePuppet().rescanNodes();
Copy link
Contributor

@r888800009 r888800009 Dec 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the IncActivePuppet().rescanNodes(); can be removed?

void incAddChildWithHistory(Node n, Node to, string name=null) {
if (to is null) to = incActivePuppet().root;
// Push action to stack
incActionPush(new NodeMoveAction(
[n],
to
));
n.insertInto(to, Node.OFFSET_START);
n.localTransform.clear();
if (name is null) n.name = _("Unnamed ")~_(n.typeId());
else n.name = name;
incActivePuppet().rescanNodes();
}

Copy link
Contributor Author

@Hakazaba Hakazaba Dec 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, along with a little transform bug this introduced

@r888800009
Copy link
Contributor

Some other suggestions, maybe you can confirm whether the Node class and its inheritance has functions such as serialization or deepcopy, the data structure should be maintained by class, you can refer to
https://github.com/Inochi2D/inochi2d/tree/v0_8/source/inochi2d/core/nodes

Inc add child was clearing the transform of the node
@Hakazaba
Copy link
Contributor Author

Some other suggestions, maybe you can confirm whether the Node class and its inheritance has functions such as serialization or deepcopy, the data structure should be maintained by class, you can refer to https://github.com/Inochi2D/inochi2d/tree/v0_8/source/inochi2d/core/nodes

There are some cases where i don't think we want a deep copy. For example, references to masks(Which still has some undesirable behavior for internal masks to the duplicated tree at the moment) and especially texture references, which is the main goal of this. So that we don't need duplicates in the texture atlass.

That being said, I'm not sure how to interact with serialization.

Meshes weren't being duplicated correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants