- Uređeno
Copy Keyframes with FFD + Skins + Animation? Help!
Love Spine, made successful games with it. Just really dug into FFD and am blown away. I want to use it on our next project, but am hitting a snag.
I've created a Skeleton, a Skin and build my first character. During her attack animation, I've used FFD on multiple parts of her body (hips, legs, boots, head, biceps).
I now need to create my second character, and I'd like her to use the same (or very similar) attack animation. When I clone the Skin for Character1 to get Character2, I find that the FFD keyframes in the animation (Attack) no longer appear or work.
I can understand this behavior, but I can also not copy keyframes from Character1 > Attack to Character2 > Attack.
So, even in the case where the region is the same (her leg graphics did not change) I cannot get the painstakingly crafted FFD from one animation to another. I am happy to reanimate the FFD on her head (a graphic that did change), but I am not sure I can use much FFD if I have to reanimate every keyframe on every region.
Is there anyway to move these FFD keyframes?
If you duplicate a Skin
and change the Path
of the image used either in the tree or in the Path
property the FFD animation should still be there. If the images have the exact same size you can change multiple image paths at the same time by using Find and replace
Since you are using spine-love, this feature hasn't been ported yet, so Shiu's recommendation is your best immediate option.
I'm not sure if it's portable but if spine-lua supports reference types, it probably will.
For the long term, the new LinkedMeshes feature allows one mesh to be the "parent/source/master mesh" and linked meshes linked to it can be made and all the linked meshes will share its FFD animation.
Pharan wroteI'm not sure if it's portable but if spine-lua supports reference types, it probably will.
For the long term, the new LinkedMeshes feature allows one mesh to be the "parent/source/master mesh" and linked meshes linked to it can be made and all the linked meshes will follow its FFD animation.
This is great - thank you for pointing me at v3.
I love you all. Thank you for swift response and AMAZING features.
Pharan wroteSince you are using spine-love, this feature hasn't been ported yet, so Shiu's recommendation is your best immediate option.
What is Spine-love? I love Spine and want a copy
Oh, when you said "Love Spine", I thought you meant the spine-love the runtime. https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-love
Currently, LinkedMeshes are only in spine-libgdx and spine-csharp.
People here are starting to get really loose with their English is all. :rofl:
Pharan wroteOh, when you said "Love Spine", I thought you meant the spine-love the runtime. https://github.com/EsotericSoftware/spine-runtimes/tree/master/spine-love
Currently, LinkedMeshes are only in spine-libgdx and spine-csharp.People here are starting to get really loose with their English is all. :rofl:
Ah, that's a bit of a bummer
we are using Cocos 2DX. I had tested happily in the editor only.
I will have to find the backlog site a lodge a vote for my runtime
Since 3.1.00 you can copy FFD keys to another mesh, as long as it has the same number of vertices. But as Pharan mentioned, you probably want to use linked meshes so you don't have to manage many sets of the same keys.
We're working on the runtimes and will have them updated soon. spine-csharp is up to date, spine-c and friends are next.
Nate wroteSince 3.1.00 you can copy FFD keys to another mesh, as long as it has the same number of vertices. But as Pharan mentioned, you probably want to use linked meshes so you don't have to manage many sets of the same keys.
We're working on the runtimes and will have them updated soon. spine-csharp is up to date, spine-c and friends are next.
Love you @Nate. I am sure we told you before but we named a character in your honor in one of our earlier video games (Nathaniel Sveet).
If you ever KickStarter again, we are there.
Lifelong fans.
fallen wroteNathaniel Sveet
:rofl:
Nate wroteSince 3.1.00 you can copy FFD keys to another mesh, as long as it has the same number of vertices. But as Pharan mentioned, you probably want to use linked meshes so you don't have to manage many sets of the same keys.
We're working on the runtimes and will have them updated soon. spine-csharp is up to date, spine-c and friends are next.
I thought I had this beat yesterday, but I am stuck again.
Using 3.0.13.
I have my first skin, Gray. I have a Skin attachment called Head, it has a mesh under it called Head.
I want to make a new skin and use a linked mesh to use a different image but the same mesh animations for Head.
I am trying the following procedure and am not sure what I am doing wrong:
- Select the Head Mesh. Click Create Linked Mesh. A new linked mesh appears in the tree, on the same level as the skin attachment (odd?). The skin attachment is no longer marked as visible.
- I duplicate the Gray skin to create Gray2.
- Select Gray2, then click on the linked mesh called Head. I change the path to Head2 instead of Head.
Unfortunately, this causes both skins to use Head2 instead of using a different image per Skin.
I am sure I am just doing something wrong, as its a bit complicated. Can post video if this is not clear.
You'll have to place the linked mesh under the Skin Attachment else it won't be used for Skins.
fallen wroteSelect the Head Mesh. Click Create Linked Mesh. A new linked mesh appears in the tree, on the same level as the skin attachment (odd?). The skin attachment is no longer marked as visible.
Two attachments can't be under the same skin placeholder, so the new linked attachment is created under the slot. The create linked mesh button makes the new linked mesh visible. Since two attachments can't be visible under the same slot, the skin placeholder is no longer visible.
fallen wroteSelect Gray2, then click on the linked mesh called Head. I change the path to Head2 instead of Head.
Do the previous steps then instead of doing this step, try this: make the Gray2 skin active, drag Head2 on to the skin placeholder, replacing the old mesh. Change the path to Head2.
This is all you need to do to create a linked mesh with a different image:
Click the create linked mesh button.
Change the name or path of the new linked mesh.
Get that working first, then you can work on getting it into another skin. To do that:Make sure your attachment is not under a skin placeholder. If it is, it'll disappear when you change skins.
Create a new skin (or duplicate an existing one).
Drag the attachment under a skin placeholder.
@Nate - thank you for the explanation. I have followed your steps and got it to work - very awesome.
It is a pretty complicated UI procedure
maybe something to work on in the future.
But awesome, thank you!
Nate wrotefallen wroteThis is all you need to do to create a linked mesh with a different image:
Click the create linked mesh button.
Change the name or path of the new linked mesh.
Get that working first, then you can work on getting it into another skin. To do that:Make sure your attachment is not under a skin placeholder. If it is, it'll disappear when you change skins.
Create a new skin (or duplicate an existing one).
Drag the attachment under a skin placeholder.
@Nate - I am sorry to resurrect this thread, but I cannot get this to work in 3.2.0.1. I am pretty sure it is user error / confusion. I always just end up with a basic non-mesh after the final step.
I can make a video if that would help, but perhaps you could just re-iterate the procedure?
I have:
- Using the skin "Gray Person"
- An attachment called Head, under a bone called Head.
- I have a mesh called GrayHead1 under the skin placeholder Head.
- I select GrayHead1 and click Create Linked Mesh. A new linked mesh object appears in the tree under the attachment Head. The skin placeholder Head is marked as non-visible. The name of the linked mesh is GrayHead1, and its path is GrayHead1.
- I select the skin Gray Person and duplicated it. I rename the skin to "Spacer"
- From the Images folder, I select SpacerHead1 and drag it onto the skin placeholder called Head. The GrayHead1 mesh disappears and is replaced by a standard image, SpacerHead1. Nothing changes with the linked mesh, which is still the visible item in the tree.
Again, my apologies for necro-ing this, but I can't seem to figure out the procedure.
It sounds like you are mostly doing the right steps, though it gets a little fuzzy as to what is happening in step 6. If you can make a video to show what happens, that would help.
Nate wroteIt sounds like you are mostly doing the right steps, though it gets a little fuzzy as to what is happening in step 6. If you can make a video to show what happens, that would help.
Thanks for the help
I've included a video below (mp4). During prepping to tape it, I did discover that if in #6, I selected the image under the skin placeholder in the new skin, and just changed its name by double clicking and typing in Spacer1Head, I seem to get the right results.
https://drive.google.com/file/d/0B-MpMsOPMs3Scm5YdHYzWVZzdzQ/view?usp=sharing
If you could confirm that should work, and tell me if there is a click-and-drag way to do it correctly, that would be great.
Thanks again.
Thanks. I'll explain exactly what a few of your actions are doing:
- When you drag an image to a bone, slot, or skin placeholder, you are creating a new region attachment with that image.
- When you drop an image on an existing attachment under a skin placeholder, you are deleting the existing attachment and replacing it with a new region attachment.
- When you duplicate a skin, you are creating a new skin and for each skin placeholder you are creating a new attachment which is a copy of the attachment that was in the original skin.
Create the linked mesh and rename it (or set it's path). This is the attachment you want to use in your skin, so don't drag an image to create a new region attachment. Use the linked mesh you created. So, duplicate the skin, then drag your linked mesh into the skin placeholder.
Note when you duplicate the skin that it duplicates the mesh that was in the old skin. When you drag the linked mesh into the skin placeholder, it deletes that duplicated mesh. You can use the duplicated mesh if you wanted, but remember it is a duplicate of the original mesh and not a linked mesh.
@Nate - thank you for taking the time. I know actually understand what I am clicking on. Fascinating. I see I was doing it very wrong before. Now, I have 2 skins
one of them using a mesh, and another using a linked mesh.
For anyone following in my footsteps, ...
I can only hit Edit Mesh on the original, and any change I make to the original effects the children meshes. This gives central control to a single mesh.
Any FFD I do in an animation against the mesh OR linked mesh, then both the original and the linked mesh get the keyframes in the animation.
If I change the weight of vertices in the mesh OR linked mesh against bound bones, then both the original and linked mesh get the weight change.
Killer feature. Thanks for making such an amazing product and the continual improvement. It's been featured in our last 3 games and this work is for #4.
@Nate - I think have found an oddity / bug with linked meshes. When I duplicate a Skin that already has linked meshes in it, I get a crash in the Cocos 2DX runtime.
I make skin "Gray Person" - setup the base meshes (works great)
I duplicate "Gray Person" Skin to create "Space man 1" Skin and get a bunch of mesh copies. I use the linked mesh technique you have enumerated above to create linked meshes in the skin "Space man 1" and replace their path with the space-man versions (works great)
I duplicate "Space man 1" to create "Space man 2" skin. After this duplication, the linked meshes from "Space man 1" are still around, they are not turned into new attachments. In the JSON, they look good. However, as soon as I have duplicated out to "Space man 2" the spine crashes on load in CC2DX
I can provide a bunch more data and even the Spine if that would help, but I thought I'd start with a report and a stack trace.
In this case, on line 865 the slotIndex is a big negative and the mesh is a bad pointer. We are using v2.3 of the runtime for CC2DX v2.x. Let me know how else I can help troubleshoot, or if this is expected behavior.
spSkeletonJson_readSkeletonData(spSkeletonJson * self, const char * json) Line 865 + 0x9 bytes C++
spSkeletonJson_readSkeletonDataFile(spSkeletonJson * self, const char * path) Line 436 + 0xd bytes C++
...
.
@Nate - Ok, I actually found the reason for this, seems like a bug in the Cocos2dX version 2 runtime.
in static void _spSkeletonJson_addLinkedMesh (... ), something about the way the array is expanded and copied when the linkedMeshCount reaches 8, causes a crash. I eventually pinned down in the Editor that it isn't copying a skin, it is adding any linked mesh.
The 8th linked mesh added causes Spine runtime to crash. I changed the code on line 127 to read:
if (internal->linkedMeshCapacity < 16) internal->linkedMeshCapacity = 16;
and it works until the 16th linked mesh now.
I am working with the competent C engineer on my team to figure this out and hopefully we can post a patch to your team.
Thanks!