I just cannot make animated models please help

i have tried everything but i just cannot do it so i have an Idea:

i send you my Model and you code something to animate it and explain how you did it

How about you start off with some easy tutorial first? Like animation and modeling is one thing, and jME is another. You can forget one and focus on the other while you get the hang of things.

Like forget animations and modeling for now, do it in easy mode like following this https://youtu.be/_376N1AA5xw?si=oAvZZoKMEb6PP3x1. Or some other tutorial of choice. Or import any ready model from any service.

And just play with those, focus to learn jME. Or then if your goal is to be a modeler and animator, then maybe switch to another engine that has a tad easier pipeline.

2 Likes

okay i got it now a tutorial for the Code would be helpfull

If you have a short attention span, this guy is fun to watch and very educational:

I’ve learned a ton about Blender just watching his 10 minute modeling challenges.

From there, it’s pretty straight forward to export gltf and load it into JME.

4 Likes

How to Download a Mixamo Walking Animation and Import it into Blender for JMonkeyEngine

Here’s a step-by-step guide on how to download a Mixamo walking animation, import it into Blender, and export it as a GLB file for use in JMonkeyEngine:

Here’s a step-by-step guide on how to download a Mixamo walking animation and integrate it into your project:
1. Prepare Your Mixamo Account and Download the Model:

  1. Create a Mixamo Account:
  1. Search for a Character Model:
  • Use the search bar to find a character model that suits your needs.
  • Filter the results by character type, style, and gender.
  1. Apply a Walking Animation:
  • Once you’ve selected a character, click on it to open its details page.
  • Click on the “Animations” tab.
  • Search for “Walk” in the animation library and apply the desired walking animation to your character.
  1. Download the Character and Animation:
  • Click the “Download” button on the character’s details page.
  • Choose the desired file format (FBX).
  • Download the file containing the character model and the applied animation.

2. Import the FBX into Blender:

  1. Open Blender: Launch Blender and create a new scene.
  2. Import the FBX: Go to File > Import > FBX. Select the downloaded FBX file and import it.
  3. Check the Import Settings: Ensure that the import settings are correct. Pay attention to the scale and units.
  4. Adjust the Rig (Optional): If the rig is not compatible with your animation needs or you want to customize it, you can use Blender’s rigging tools to modify it.

3. Prepare the Animation:

  1. Check the Animation: Play the animation to ensure it imports correctly.
  2. Adjust the Animation (Optional): You can use Blender’s animation tools to edit the animation’s timing, speed, or keyframes if needed.

4. Export as GLB:

  1. Select the Character: Make sure the character object is selected.
  2. Export as GLB: Go to File > Export > GLTF 2.0.
  3. Configure Export Settings:
    • Format: Choose GLTF
    • Add Animations: Check this box to include the animation in the export.
    • Apply Modifiers: Check this box to apply any modifiers to the mesh before exporting.
  4. Export: Click the “Export GLTF” button.

5. Import the GLB into JMonkeyEngine:

  1. Create a New JME3 Project: Set up a new JMonkeyEngine project using your preferred IDE or build tool.
  2. Import the GLB Model: Use JMonkeyEngine’s asset management system to import the GLB file into your project.
  3. Create a Simple Scene: Create a new scene and add a Spatial node to hold the imported model.
  4. Attach the Model: Attach the imported model to the Spatial node.
  5. Create an Animation Control: Create an AnimationComposer node and attach it to the model.
  6. Play the Animation: Use the AnimationComposer to play the walking animation.

Here’s a basic JME3 code example to render the character animation:

// This line tells the program what package this code belongs to. 
// Think of a package like a folder that groups related things together.
package runnergame;

// This line imports (brings in) functionality from other code libraries. 
// These libraries help us build the game.
import com.jme3.anim.AnimComposer; // This helps us control animations.
import com.jme3.app.SimpleApplication; // This is the foundation of our game.
import com.jme3.light.DirectionalLight; // This helps us add lighting to the scene.
import com.jme3.math.ColorRGBA; // This helps us define colors.
import com.jme3.math.Vector3f; // This helps us define positions and directions in 3D space.
import com.jme3.scene.Node; // This represents a group of objects in the game world.
import com.jme3.scene.SceneGraphVisitor; // This helps us walk through the scene and find specific objects.
import com.jme3.scene.Spatial; // This is a general term for any object in the game scene.
import com.jme3.scene.plugins.gltf.GltfModelKey; // This helps us load models in the GLTF format.

// This line defines a class called ModelLoader. This class is like a blueprint for creating our game.
public class ModelLoader extends SimpleApplication {

  // This variable will store the animation controller for our model.
  private AnimComposer animComposer;

  // This is the main method, where the program starts.
  public static void main(String[] args) {
    // We create a new instance of our ModelLoader game and start it.
    ModelLoader game = new ModelLoader();
    game.start();
  }

  // This method is called once when the game starts. Here's where we set things up.
  @Override
  public void simpleInitApp() {

    // This line tells the program where to find our model file.
    GltfModelKey modelKey = new GltfModelKey("assets/Models/Walking_Model.glb");

    // This line loads the model from the file.
    Node model = (Node) getAssetManager().loadModel(modelKey);

    // This part searches through all the objects in our model to find the animation controller.
    model.depthFirstTraversal(new SceneGraphVisitor() {

      @Override
      public void visit(Spatial spatial) {
        // If the current object has an animation controller, we store it.
        if (spatial.getControl(AnimComposer.class) != null) {
          animComposer = spatial.getControl(AnimComposer.class);
        }
      }
    });

    // Now that we have the animation controller, we attach it to the model.
    model.addControl(animComposer);

    // This line tells the animation controller to play the first animation it finds.
    animComposer.setCurrentAction(animComposer.getAnimClipsNames().iterator().next());

    // We add the model to the game world.
    rootNode.attachChild(model);

    // This line creates a light source that shines from above and makes the scene brighter.
    DirectionalLight light = new DirectionalLight(Vector3f.UNIT_XYZ.mult(-1), ColorRGBA.White.mult(3));
    rootNode.addLight(light);
  }
}

Remember to adjust the file paths and animation names according to your specific project setup.

By following these steps, you can successfully import and use Mixamo animations in your JMonkeyEngine projects.

1 Like

Is this AI prompt? If so, maybe also hint the OP that AI can be also used to query stuff.

3 Likes

Yes, This is an AI response

At least tested?

4 Likes