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

Added fix for setting the spine scene to a cloned node #70

Merged
merged 2 commits into from Apr 6, 2022

Conversation

JCash
Copy link
Contributor

@JCash JCash commented Mar 18, 2022

No description provided.

Comment on lines +312 to +313
bool create_bones = node->m_FindBones ? false : true; // See comment in GuiClone()
return SetupNode(spine_scene, resource, node, create_bones);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In short, we'll find the gui nodes the next frame.
The cloning of a node is dealt with by the gui system, and it clones the node and its bones.

Comment on lines +689 to +690
dst->m_FindBones = 1;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just moving it closer to the documentation

@JCash JCash requested a review from britzl March 18, 2022 09:31
@JCash JCash linked an issue Mar 18, 2022 that may be closed by this pull request
@@ -120,7 +130,8 @@ function init(self)

for i, bone_id in ipairs(bone_names) do
--print("SCRIPT bone", bone_id)
local bone = gui.get_node(bone_id)
--local bone = gui.get_node(bone_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Indentation

@@ -109,6 +109,16 @@ function init(self)
print("gui.get_spine_scene", gui.get_spine_scene(self.n))


--self.clone = gui.clone(self.n)
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove?

Copy link
Contributor

@britzl britzl left a comment

Choose a reason for hiding this comment

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

Solution looks good. Indentation and commented code.

@JCash JCash merged commit eb056bb into main Apr 6, 2022
@JCash JCash deleted the issue-69-spine-set-scene-cloned-node branch April 6, 2022 11:17
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.

Crash when using gui.set_spine_scene() on a cloned node
2 participants