terransage's Recent Forum Activity

  • , I did some experimenting with my object-carrying character and swapping that character with the original character--and it worked. But now I'm writing a mini-tutorial for that process, including the Event Sheet steps for swapping between characters. And that may take a little while. It's not exactly what you're looking to do (altering the appearance of the Q3D monsters while preserving their animations), but it might give you some clues about how to do it. Unfortunately, it's approaching my bedtime, so I'll have to continue the tutorial tomorrow.

    I will say this for now: I was wrong about parenting an object to the vertices of the morph-animated model in Blender and exporting that to Q3D. That's because such hierarchies can't be exported to a .json file. Instead, I went through a little more involved process of joining the character and the carried object as one model, manually rotating and positioning the object into the character's hand in each and every pose of the timeline, and then recording the keyframes. It's a little more work than originally intended, but it works! Anyway, I'll try to finish the mini-tutorial as soon as possible.

    I have to learn not to announce things before I'm 100% sure how to really do it....

  • [quote:ih0cwitz]@gamecorpstudio wrote:

    wait so we can use the monster morph animation tutorial, characters that is already from q3d, just swap the model ? and keep the same animation of movement!? i mean bones or what contains?! just change the shape of model basically?! that will be so awesome, cause it solves most of problems, just wold need to have a same size character, and then bam new characters every time!

    Well, sort of. I think you could do what you're thinking, as long as you use the same rigged model as the base for all of the morph-animated characters. But you would have to use the same number of vertices--just shift them around while still having them attached to the same bones containing the same rigged animations that you would share between different versions of that model. I've never altered a model after rigging it, so I'm not even sure how that would be done (although I have added objects to the model after it has been morph-animated; and that's information that I'm going to put in the tutorial above). For re-shaping a rigged character, I think you would either have to use Shape Keys to shift the vertices around, or you could detach the bones from the vertices, shift the vertices around to create the new character, add a new material/texture, then re-parent the model to the bones, creating vertex groups, etc. That way the character would look different, but it would be animated the same.

    The process I was talking about in my "edit" above is a way to resolve the problem of the morph-animated character carrying things in his hands, since an object can't be parented to a hand bone (because there aren't any bones). To test whether or not that could be done, I went back to my morph-animated character in Blender, added a cylinder to the scene, re-sized, rotated and positioned it in the character's hand, selected first the object and then the character, shifted to Edit Mode, selected three adjacent vertices in the character's hand--close to the cylinder--and pressed Control+P to parent the object to the vertices. Then I played the walk cycle and, sure enough, the cylinder moved (and rotated correctly) with the hand, as if he was really carrying it. At first I made the mistake of parenting the cylinder to a single vertex. It followed the hand when the character walked, but it refused to rotate. Parenting to three vertices "locks" the object into place, correcting the rotation problem.

    The only thing I haven't tested, yet, is whether or not I can now join the object to the model, to make them one model--and still have the morph animation work the same way for the whole model. I just realized that (*gulp*). It seems that hierarchies that aren't armatures can't be exported in .json files. I forgot about that.

    After I'm done writing this, I'll have to experiment with that. And I might have to put the tutorial on hold....

    As for "swapping" out the two versions of the character model, I haven't yet tested it with the model carrying the cylinder. But I did swap between the original model and a duplicate, triggering it with a key press. I was pretty surprised by how seamless it was! I had to use a few conditions/actions in the Event Sheet, juggle a few Euler angles to get the new model to face in exactly the same direction as the first. All of that, I'll mention in my edit to the tutorial--exactly what actions I used.

    You mentioned a character that is already in Q3D. Are you talking about the monsters created by QuaziGNRLnose? If you wanted to swap bodies with one of those creatures, you'd have to match one of their start or end poses as closely as possible, have one character end its animation cycle in a pose that begins the animation cycle of the second character, in order to make it look as natural as possible. In Unity, when a character dies, you can swap it out for a "ragdoll" version of the same character, matching each of its bones--position and rotation--with the bones of the destroyed character. Are you thinking of taking one of those Q3D monsters into Blender and altering its shape/texture? Because they're morph-animated (I think), you would have to capture their alterations with Shape Keys in every pose of the animation. Or maybe I'm not understanding your question?

    Anyway, I realized I have a lot more experimenting to do before I can add to the tutorial....

  • Thanks, I'm glad to hear that the animation frames don't have to be re-numbered. My copy-and-paste way of adding new animations to a .json file works, but it takes a lot of patience. I guess putting all of the animations in a single timeline is the way to go,

    As for the characters carrying things, I considered the idea of animating an object to follow the character's hand, but I wasn't sure how to pull that off, especially with the 2D editor.

    I also thought about creating cloned versions of the same character with objects "modeled" into their hands, and somehow switch the characters at the moment the original character reaches for and touches something. The pose, position and angle that the original character is in at the end of the reaching animation would have to exactly match the starting pose, position and angle of the "spawned," object-carrying character. Or that character could already be there, but invisible. I've done something like that in Unity, instantiating model clones and destroying or hiding the original. Of course, the object-carrying model would have to be re-rigged and re-morphed, with the model and the object it's carrying joined as one. (Sorry, I'm kind of thinking out loud....)

    Edit: I think I've got the "character-carrying-things" that I mentioned in the last paragraph figured out. I discovered that it's easy to "model" an object into an already morph-animated model, export and import that model into Q3D without having to redo the animations, and then use the Construct 2 Event Sheets to seamlessly replace the original model reaching for an object. Once I've got it worked out 100%, I'll add it to the tutorial above.

  • You're welcome, Lordshiva1948 and ! I just hope my tips don't cause your computers to explode.....

  • : I put up the little tutorial in your Q3D Tips and Tricks post. The only part that's not too detailed is how to do the multiple animations within the single .json file. I kind of glossed over it, partly because it's past my bedtime, but also because my way of doing it is tedious and a little complicated. I'm still trying to find a better way to do it, but I did mention how I do it now in broad terms. Anyway, here's the tutorial:

  • Hello, all!

    Some people complained that morph animations were very hard to do, so I thought I'd share a way to create morph animations from rigged ones that I sort of stumbled upon during my searches through forums and tutorials. I didn't actually find tutorials on how to do this whole process--just bits and pieces of information that I pasted together and experimented with. So this is my own way of doing it, and it's somewhat rough. Anyone who knows how to do it better, please correct me if you want! If this is already common knowledge, then this might come in handy for people new to Blender.

    I tried to do a walk cycle without using a rig--just manipulating the vertices--and I realized that it would take one hundred years for me to do it. Then I had the thought that maybe I could somehow capture rigged poses with Blender's shape keys and paste them into an animation timeline. Sure enough, it's possible, but there are a few tricks to doing it fairly fast and well. And there's also the question of how to do multiple morph animations in a single .json file, add more animations to the same file as you need them, and rename them as separate animations so that they can be called and tweened in Q3D. I might talk about how to do that in another post, because I'm still trying to figure out how to simplify that process. I've been able to do it so far, mostly by copying and pasting animations from one .json file into another, but it's a tedious and sometimes confusing process. For now I'll just concentrate on a single morph animation, with a suggestion for how to do multiple ones in a single file later in this post.

    It turns out that the morph animations run pretty smoothly and well in Q3D and, as QuaziGNRLnose has said, they are less costly for the hard drive to handle. So far it's working so well that I've decided to make my scenes as boneless as possible.

    Here's how to do it:

    1. First create your model, rig and skeletal animation as you normally would.

    2. Save your original skeletal anim file (you wouldn't want to lose it) and do a "save as" to create a separate morph animation file using the same model.

    3. While you're in Object Mode, count the number of poses in your animation cycle (not including the first pose), select both the model and its skeleton, and use shift + D to duplicate the model that many times. If your last pose is the same as the first--as in a walk cycle--don't count the last one either. For instance, if you have nine poses in your walk cycle, create 7 clones of the model. In the case of the walk cycle I just mentioned, you should now have 8 identical models. Place them in a row, next to each other, from left to right. You're going to be using the first model (the one you cloned from) as the final, boneless, morph animation model, while you're going to use the other models for capturing each pose and transferring the pose to the first model. It's important that you keep that model in its original centered spot. I made the mistake of using one of the cloned models as the final one (not centered in the Blender 3D view), and the exported version was off-center in Q3D.

    4. Start with your first (original) model. We'll call this model 1. Select model 1 (not its skeleton) in Object Mode and set the timeline to the first frame, the first pose. This pose will be the Shape Key "basis" for all of the shape keys that you will create. Once the model is in this pose, open the Modifier window (click the wrench icon in the Properties window), and the first thing you will see is the Armature Modifier. Click Apply to capture the first pose, and the Armature Modifier disappears.

    5. While still in Object Mode, select model 1's skeleton (only) and then switch to Edit Mode. Press X to delete the bones.

    6. Now we're going to create model 1's first Shape Key: Switch back to Object Mode and select model 1. Open the Data window by clicking the vertex triangle icon (next to the wrench). Scroll down to the Shape Key section and click the plus sign (the add button) to create the first Shape Key, which is named "Basis" by default.

    7. Now proceed to the second model in line. This model will represent and capture the second pose in the timeline, and will be used to transfer that pose--as a Shape Key--to model 1. Select model 2 (not its skeleton) in Object Mode and set the timeline to the second pose. As you did in #4 above, open the Modifier window and apply the the Armature Modifier.

    8. Repeat what you did in #5 to delete the bones of model 2.

    9. Repeat what you did in #6 to create model 2's first Shape Key, which will also be named "Basis." You don't have to change the name of this key.

    10. Keeping model 2 selected in Object Mode, select model 1. In model 1's Shape Key window, click the dark triangle button underneath the add and subtract buttons. (I think you can also press W) to bring up the Specials list. Select "Join as Shapes." This will automatically transfer model 2's Shape Key to model 1. You don't have to rename this key either.

    You can test whether or not the transfer worked by selecting only model 1 and switching to Edit Mode. Click on the Basis key and the new key, and you should see the model switch from pose to pose. You can also switch to Object Mode and use the "value" slider underneath the Shape Keys to shift from 0 to 1, to see model 1 morph from the basis pose to the second pose. 0 always references the basis pose, while 1 references the target pose for that particular Shape Key.

    11. Repeat #'s 7 through 10 for each of the models, capturing each pose as they're arranged on the timeline and transferring each, as Shape Keys, to model 1. Test each Shape Key, just in case.

    12. Once you're finished with all the models, delete all of them except for model 1.

    13, Switch from Action Editor to Shape Key Editor. Create and name a new animation by clicking the add button in the field next to "summary." You will see that the timeline is divided into one channel per pose, not including the first pose (or the last pose, if it's the same as the first). Why the first (or last) pose wasn't included confused me at first, but the reason became clear after I stumbled through the recording process--as you will also see in the next step:

    14. To record the first pose, the Basis, set the timeline at frame 1, set all of the channels at 0, click Key, select Insert Keyframes, and select All Channels. Setting 0 in all channels is exactly the same as setting and recording the first pose--which is why a first pose channel is unnecessary. If the last pose is the same as the first, repeat this process for the last frame of your animation.

    15. For the second pose, set the timeline at whatever the next frame is going to be, set channel 1 at 1, and set all of the other channels at 0. Record the keyframes for all channels as you did in #14. For the third pose, move the timeline to the next frame, set only channel 2 at 1 and all the others at 0. Record. For the fourth pose, move the timeline to the next frame, set only channel 3 at 1 and all the others at 0. Do this for all of the poses (except, of course, for the last pose if it's the same as the first).

    16. Make sure that you save often as you go through this process, and save the model when its animation is finished. Now you can export the model, choosing the three.js exporter (File>Export>Three.js). Here's how I set up the export page. I don't exactly know if this part is correct, but it works in Q3D:

    I checked Vertices, Faces, Normals, UVs (but not bones or skinning)

    I checked FaceMaterials and Vertex Colors.

    I checked Morph Animation and kept Skeletal Animations off

    I'm not sure if it's necessary, but I checked Frame Index As Time and Embed Animation

    I didn't check any of the Scene boxes.

    For Settings, I checked Textures and Copy Textures, and I kept Enable Precision checked.

    Within your Construct 2 project, import the .json file into your Files file in the Projects window. Double-click the newly imported .json to open it in Notepad or Wordpad (or whatever program it opens into) and change the name of your animation to what you want by doing the following. I use Notepad, so I'm not sure how this is done in Wordpad:

    1. Click Edit>Replace. In the Find What field, enter "animation_". In the Replace With field, enter "walk" or whatever name you choose. Then click "Replace All."

    4. Save the file.

    That's it! The animation is renamed.

    For multiple animations in a single file, so far I have created separate .json files of the same model with single animations in each of them. I just renamed and copied the animation part of each file and pasted it into the original model/morph animation file within Construct 2. That sounds straightforward enough, but it's somewhat tedious, because the files are so large. It's a little tricky selecting such a large portion of the script, because you have to know where the animation portion begins and ends. I marked the beginning and end of that section by creating a large gap between it and the rest of the script.

    What I haven't tried yet is to place all of the morph animations on a single timeline. That would work, I think, but you'd have to know where each animation begins and ends, and go through a more complex renaming process. Also, I'm not sure if each separate animation has to begin with the 000000 frame or not???

    Then there's something I just started exploring (but haven't figured out yet), and that's how to parent objects to this boneless mesh so that you can have your character carry things, wear helmets, etc. I know that in Blender you can attach a single bone to a single vertex while still preserving the morph animation--and I was able to do that--but I don't know if it's possible to parent an object to that bone. Is that hierarchy preserved in the .json file? I remember QuaziGNRLnose mentioning something about that somewhere--I think....

    Another thing I wondered about is the huge .json file size. Does that hurt the game's performance? Is skeletal animation the better choice? I know that QuaziGNRLnose said that skeletal animation is more costly to performance, but is that still true in version 2.4?

    Thanks for reading!

  • , I've been having some success with morph animations in Q3D after not knowing how to do it at all, and I'm working on a mini-tutorial for your post, “Q3D Tips and Tricks.” I also figured out how to export the animations embedded in the .json file, so I don't need two files. And also, I figured out how to rename each separate animation without having to do everything by hand, frame by frame. And I'm also going to put that in the tutorial. I was surprised to find that the separate animations tween or transition nicely, and they seem to work better than rigged animations in Q3D. But—my method still requires that you create a rigged animation first. I don't have time right now to give all the details on how to do it (I'm not at home), but here's the basic idea:

    You take a rigged and animated model and capture each of its poses using the armature modifier. I do that by creating multiple duplicates (shift+D) of the original, one for each pose, capturing each pose and deleting the bones from each. I do this also with the first pose. I will then use the shape keys to create a “basis” pose for each model, select that model, then also select the first-pose model, and use the Specials menu to select “Join as Shape,” which transfers the basis shape key from the posed model to the first-pose model. Once I have all of the poses “captured” as shape keys in the first-pose model, I delete all of the other models so that only the first-pose model remains. Then it's a matter of using the Shape Key Editor in the action editor to place all of the shape key poses in the timeline and record them.

    I put all of my animation cycles in a single timeline, since it will all end up in a single timeline in the .json file anyway. (Edit: I misspoke here: I actually created all of the animations separately, then copied and pasted the animation portion of each .json script into the Q3D model's final .json file. Putting them all into a single timeline in the original model was wishful thinking; I haven't tried it yet, but I'm planning to soon.)

    I wish I had more time to give all the details, but I'll have that mini-tutorial up soon. There are a lot of tricks that I had to figure out before it would work.

    When exporting the model, I turn the skeletal animation off (no “pose” or “rest”), and click “Morph Animation” and “Embed Animation.” I can't remember all of the details of how I set up the export without my Blender in front of me, but I'll include that in the tut.

    Finally, to rename all of the “animation_” frames in the .json file, I made note of where each separate animation cycle begins and ends (by frame number). In the .json file, in Notepad, I used Edit>Replace to search for “animation_0000” and then the following digit (like 2, 3, etc.), typed in the name I wanted to replace it with—like “walk”-- and clicked “replace all.” I didn't explain that very well here, because I'm out of time, but I will also include that in the tut.

    I'm not sure if I answered your question for the time being, but I'll have more detail later.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • QuaziGNRLnose

    Thanks for a great plugin! It took me a while to figure out some of the basics (and relearn how to use Blender), but now I can go to bed happy after staying up way too late. Seeing my first 3D model fully textured and animated really made my day, which is kind of funny, since I've had years of experience with Unity3D (and still use it). I look forward to the coming updates. Thanks again!

  • Thanks, granpa! Yes, I look forward to future updates, even though I've only scratched the surface with C2 so far.

  • I wasn't sure if this is a good place to post this, but i just wanted to express my joy about using Construct 2. I came here from a few other tools, some of which I still love to use (Unity and Blender), and so far C2 has blown me away, especially when I saw that it's possible to do SaveGames without doing any complex coding (or any coding at all). So far everything I've wanted to do with my current game has proved to be possible here--even the most complicated gameplay mechanics. There are many more features in this game engine than I originally thought. I can't wait to sink my teeth into Multiplayer gaming, which I've never done before. Tears of joy are streaming down my face (I'm a very emotional guy....). (Geez, I had too much coffee.)

    I'm also very impressed by the Construct community, how friendly and helpful everyone is. I've been to a few forums where everyone is insulting each other, or people are complaining a lot, while here I look forward to visiting the forum even if I don't have any questions.

  • Thanks, shinkan! For some reason I couldn't see that information in the tutorials or manual, but I probably overlooked it. I suspected it probably wasn't a bug, but I wanted to be sure. Thanks again.

  • Problem Description

    ____I've been trying to add local variables by right-clicking events, variables and blank spaces in the event sheet, but I'm only given the choice of "Add global variable." This happens in my current project, and in any new, blank project I set up. My current project is too large to upload, so I'm uploading a new project that has only one sprite in it. ____

    Attach a Capx

    ____Yes. ____

    Description of Capx

    ____ The uploaded Capx doesn't really do anything except make the sprite transparent if visible. ____

    Steps to Reproduce Bug

    • Step 1: In Event Sheet, right-click any Event, variable, or blank space.
    • Step 2: In the list of choices, hover over "Add."
    • Step 3: Only "Add global variable" shows up, along with other non-variable-related choices.

    Observed Result

    ____ Only "Add global variable" shows up as a choice. ____

    Expected Result

    ____ I expected to have the choice of "Add local variable." ____

    Affected Browsers

    • Chrome: (NO)
    • FireFox: (NO)
    • Internet Explorer: (NO)

    Operating System and Service Pack

    ____ Windows 8.1, HP Pavilion 500-314 (Couldn't find any info about service pack.) ____

    Construct 2 Version ID

    ____Release 195 (64 bit) ____

terransage's avatar

terransage

Member since 12 Nov, 2014

None one is following terransage yet!

Trophy Case

  • 10-Year Club
  • Email Verified

Progress

11/44
How to earn trophies