Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Object linked to animation

Author
Message
Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 7th Oct 2014 07:03
There is a way to link an object to an animated object? for example linking a sword to an animated character? I mean a bone animated character NOT limb one!

I ask this because if you try the commands to attach an object to a limb of an object all what you get is just following the normal movement of the character (when walking for example), but doesn t follow the animation of the character.

For example, i link a cap on the head of the character, when i animate the character to crouch for example, the hair will stay floating where they was, as the position x,y,z of the characters are the same, but actually the character moved the head so the cap should follow the head with the rotation as well, there is a way to link perfectly an object to an animated bone character?

The only way to do this so far is make each animation WITH the object included in it, which works, BUT its more Tricky, take way more memory and more time to program it, instead of making just a secondary object which just links to the animated object.

I make you an example, if i have like 20 different swords, i should make 20 different animation for the characters just to do the same thing (like walking or running), BUT if i could be able to link it i could just make 1 animation for the character and attach the swords i need to use for him, is that clear what i ask?
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th Oct 2014 08:42 Edited at: 7th Oct 2014 08:50
each bone actually is considered a limb, and so you can do such:



where "Armature_hand_r" is the literal entry in the .x file, and is composed of the export of a bone named "hand_r" within the skeleton/armature named "Armature"

glue to limb does tend to cause the scale to go off, so you will need to correct this after it is glued, as well as the base rotation.

the 'get limb by name' function is from the Matrix1 Utilities which I cannot recommend strongly enough if you are not already using them.

If you want native language set, you can get the limb number using a checklist, or you can get it by reading through the .x file in a text editor.

Quote: "
I ask this because if you try the commands to attach an object to a limb of an object all what you get is just following the normal movement of the character (when walking for example), but doesn t follow the animation of the character."


This should only happen if you are attaching to limb 0, which is the root limb of the object itself.

WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 7th Oct 2014 12:08 Edited at: 7th Oct 2014 12:10
Ya know, I have no issues with the use of 3D Party Plug-ins. GetLimbByName is a simple function without using Matrix1 Utilities.



Instead of glueing the object to the limb. Would it not be better to make a mesh from the sword object, add it to the limb and then link it as a child.

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 7th Oct 2014 19:26
Are you sure this will work?
I know my character has over 100 bones but when i textured him it used up just a few limbs, maybe the first limbs are the actual mesh parts of the object and the further ones will be assigned to each bone?

(i used MakeHuman to do the character so it has basicly 1 limb for the body part head included, 1 limb for the shirt, 1 for the jeans and 1 for the shoes)
Ortu
DBPro Master
18
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 7th Oct 2014 20:18
I would suggest performing a checklist for limbs, dumping them all to screen or file, and see what exactly you have available within the object. Or look at the .x file itself, each bone will have an entry as

Frame full_bone_name {
FrameTransformMatrix {

And then some numbers.

Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 7th Oct 2014 20:27
How can i open the .x file to see that? if i use notepad i see strange symbols
WickedX
17
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 8th Oct 2014 02:17
This code will print out all the objects checklist data for object 1 to a text file.



Cescano
11
Years of Service
User Offline
Joined: 4th Sep 2014
Location: Italy
Posted: 10th Oct 2014 23:27
very helpfull thank you so much!!!

Login to post a reply

Server time is: 2026-07-18 09:25:03
Your offset time is: 2026-07-18 09:25:03