HelloBoneLinks encountered problems

I started using Minie a little while ago and it’s been great and I’ve recently started learning about dolls
The code used is HelloBoneLinks from the tutorial
I encountered the following problems with Minie
I encountered the following problems when using my own model

java.lang.IllegalArgumentException: The controlled spatial must have a SkinningControl or a SkeletonControl. Make sure the Control is there and not on some other Spatial.
	at com.jme3.bullet.animation.DacLinks.createSpatialData(DacLinks.java:772)
	at com.jme3.bullet.control.AbstractPhysicsControl.setSpatial(AbstractPhysicsControl.java:437)
	at com.jme3.scene.Spatial.addControl(Spatial.java:777)
	at jme3utilities.tutorial.HelloBoneLinks.simpleInitApp(HelloBoneLinks.java:122)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:240)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:139)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:221)
	at java.base/java.lang.Thread.run(Thread.java:833)

        // Add a model to the scene.
        Spatial ninjaModel
                = assetManager.loadModel("Models/lina/Character.j3o");

I changed the code

Based on your screenshot from the other thread,

https://hub.jmonkeyengine.org/uploads/default/original/4X/2/f/e/2fef51ea4f91d99bfdcb3879c487ee449ec55c79.png

It looks like your AnimComposer and SkinningControl are nested 1 node deeper in your model, and I believe the DynamicAnimControl needs to be attached to your node named “armature” that contains the SkinningControl.

So something like this should solve that error:

Spatial ninjaModel
                = assetManager.loadModel("Models/lina/Character.j3o");
Node animControlsNode = ninjaModel.getChild("Armature");
animControlsNode.addControl(dac);

However, I also am not sure if that tutorial will work with your own model in place of the ninja, because it appears that tutorial has its DAC links set up to reference Joints that are unique to the ninja model:

So your model would need to have joints named “join9” “joint11” and “joint12” in order for this code to work with your model.

I would suggest using the DACWizard (Minie/DacWizard at master · stephengold/Minie · GitHub) it is an excellent visual editor that comes with the Minie library and will allow you to setup the bone links for a DynamicAnimControl that is unique to your model.

Here is an excellent tutorial video that shows how to set up a model in DACWizzrd DacWizard walkthru - April 15, 2019 - YouTube

1 Like

https://www.youtube.com/watch?v=A1Rii99nb3Q
Do you know where the demo for this video is?
I want to use physics to wrap the model around

I believe that video is from this example:

1 Like

Thank you for your help

2 Likes