Bone.getAttachmentsNode() not visible anymore

Hello,



after changing to yesterday’s nightly build my editor does not work anymore 'cause I’m using bone.getAttachmentsNode() to stick a custom mesh to it. Is it intendet to use getModelSpacePosition(), getModelSpaceRotation(), getModelSpaceScale() instead? If not I would request to set the visibility again to public. That was a very convenient way of creating a custom model.

According to @momoko_fan, you should use SkeletonControl.getAttachmentsBone() now instead.



I guess some users were abusing it and so now no one can play. :slight_smile:

1 Like

Thanks. Feels a bit like a workaround but better than applying all transforms by hand^^ :wink:

Apparently there was some problem with the other way not really attaching the node or something. It was a method used internally and not one really supposed to be used.



There’s almost a logic to it but I’m not the best one to explain it since I don’t yet use the animation system much.

Ok, better this way than chasing bugs afterwards.

Ohh, one minor thing, I do not want to start a new thread for:

The Wiki is wrong with AppStates: it calls setEnabled and isEnabled isActive and setActive. https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:application_states

(PS: I personaly would add a notification that stateAttached is called before initialize. For me that was counter-intuitiv especially because in stateAttached you do not have access to the app-reference)

That probably needs a refresh.



For the record, always consult the Javadoc. The AppStateManager docs say precisely which order the methods are called in and when:

http://hub.jmonkeyengine.org/javadoc/com/jme3/app/state/AppStateManager.html



It used to be really inconsistent when some of the methods would get called.



Generally, stateAttached() and stateDetached() are called immediately upon attach and detach but because you may have attached or detached from a separate thread or at some random time independent of the update loop, these methods are not safe to do anything scene graph related. As such, access to Application would be kind of dangerous.



initialize(), cleanup(), and setEnabled() are the ones most app states will want to pay attention to.

1 Like

Thanks for that detailed information.



I read the JavaDoc after struggling with it but I guess many people - like me - who read the wiki will skip reading the JavaDoc as the Wiki explains things really well. So this nice explanation of yours would fit well into the wiki page :wink:

It should be a) wiki for the overview and an idea how to put things together b) javadoc to check detailed info for certain functions c) check source code to see the actual implementation and see how it works together with your code. This way you should be able to find out anything about jme3 really. :wink:

I totally agree with you (for example I looked up if the DesktopAssetManager is a Singleton yesterday) but nevertheless a beginner will maybe stick to the wiki first especially someone who is new to 3D Programming. And therefore I offer an “advanced beginner’s” view on the wiki :wink: