Bone Attachment point?

Switching away from placeholder models and want to use bones to mark points of interest/attachment does bone attachment reference the head or the tail of bones as the the connection point.

I want to treat with as much attachment orientation issues as possible inside blender, where I can, my model has four holster locations presently using constraint driven empties to move weapons from holster to hand and back, I want to replace them with bones for the game version of the model

thanks

just to be clear I am not asking how to export the constraint system I am asking which part of the bone jme3 would attach attachment by default

It probably only takes a few seconds to try it and see.

As pspeed said, try it out. But I bet it’s the head of the bone.

I assumed it was a known piece of info that could be easily conveyed, without much fanfare, my bad, still though why the head or choice since the tail is the default pivot in blender, unless you apply constraints that allow for the pivot to be reversed locations for bones are denoted by the tail as default…i can work around that but it’s a cumbersome extra step

Thanks anyways

you can try with this code snippet:
NOTE: the example refers to the old animation system

SkeletonControl control = ...
Skeleton skeleton = control.getSkeleton();
int numBones = skeleton.getBoneCount();
for (int boneIndex = 0; boneIndex < numBones; ++boneIndex) {
	Bone bone = skeleton.getBone(boneIndex);
	Node boneHook = control.getAttachmentsNode(bone.getName());
	Node axes = getAxes("Axes__" + bone.getName());
	boneHook.attachChild(axes.scale(25));
}

...

/**
 * Get default axes.
 *
 * @param id
 * @return 
 */
public Node getAxes(String id) {
	Node node = new Node(id);
	node.attachChild(getArrow("X", Vector3f.UNIT_X, ColorRGBA.Red));
	node.attachChild(getArrow("Y", Vector3f.UNIT_Y, ColorRGBA.Green));
	node.attachChild(getArrow("Z", Vector3f.UNIT_Z, ColorRGBA.Blue));
	return node;
}

/**
 * Get an arrow with name, dir and color.
 *
 * @param name
 * @param dir
 * @param color
 * @return
 */
public Geometry getArrow(String name, Vector3f dir, ColorRGBA color) {
	Arrow arrow = new Arrow(dir);
	Geometry geo = new Geometry(name, arrow);
	Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
	mat.setColor("Color", color);
	geo.setMaterial(mat);
	return geo;
}

for new animation system:

SkinningControl skControl = ...;
for (Joint bone : skControl.getArmature().getJointList()) {
	Node boneHook = skControl.getAttachmentsNode(bone.getName());
	Node axes = getAxes("Axes__" + bone.getName());
	boneHook.attachChild(axes.scale(25));
}

...

seems I had my understanding of the bone parts upside-down, so I was doing the right thing all along, gotta stop thinking in layman’s for this shit

This was one of the difficulties in answering the original question. There was any room for misinterpretation in either direction. And while I know how I use attachment nodes and how they work for me, before answering, I would have had to try it myself to make sure I gave valid information.

Given that my idea of what “head and tail” might be different than your idea of what “head and tail” meant, there was a good chance that even if I did answer that it would be unsatisfying and you might have to try it yourself anyway.

Figuring that regardless of which way it worked, you were still probably going to attach something to the bone… and that it would take less time to try it than to write two paragraphs… I suggested that it would be quicker to just try it.

Especially when you are going to be doing “a thing” anyway, never be afraid to try it. Maybe it works. Maybe it doesn’t… but you’ll be almost there and in some cases the question gets better and the answers become more understandable.

1 Like

Yeah I know, it just seemed a small enough detail to avoid the distraction of an export test while I was still preparing the model, but I get where you’re coming from though

I would argue that regardless of how the discussion turned out, you should have your model make sense in the tool where the model is edited… then deal with any issues on the game side.

90% likely you are going to stick a node between the attachment node and whatever spatial you loaded anyway.

1 Like