2 registered members (AndrewAMD, Ayumi),
903
guests, and 3
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
bone vertex weighting problem (when weight on child <.5)
#304074
01/04/10 21:40
01/04/10 21:40
|
Joined: Mar 2007
Posts: 197
yorisimo
OP
Member
|
OP
Member
Joined: Mar 2007
Posts: 197
|
7.82.2 Pro The vertex weighting doesn't seem to be working properly. I have set max_bones to 4 (also tried 2 and 3). I have made a very simple test case to demonstrate the problem. I made two long blocks in MED. The one on the bottom uses unweighted vertices, where the left side is attached to the parent bone, and the right side to the child bone. In the block on top, the left most vertices are weighted to the parent bone with a value of 1, and decrease by 20% leftwards, and weighted to the child bone with a value of 1 to the child bone and decrease by 20% rightwards. The model looks correct when animated in MED, and indicates that there are a maximum of two bones per vertex (see image): When the child bone of each block is rotated in the engine with max_bones=1, the blocks behave as expected, with only the vertices closest to the center being affected: With max_bones=4, I would expect the blocks to look like they do in MED, but for some reason the left vertices (where the weight on the child bones is less than .5) do not move at all with the child bone: Here's my script:
#include <acknex.h>
#include <windows.h>
#include <default.c>
PANEL* info = {
digits(10, 10, 1, "Courier#12b", 1, max_bones);
flags = SHOW;
}
action boneweightblocks(){
var r;
wait(3);
while(1){
r+=mickey.x*time_step;
ent_bonereset_all(me);
ent_bonerotate(me, "weighted_c", vector(0,0,r));
ent_bonerotate(me, "unweighted_c", vector(0,0,r));
wait(1);
}
}
function main(){
max_bones = 1;
level_load("world.wmb");
}
I added the bone weights to the model using the ascii bone export and import feature:
Bones: 4;
"weighted_p", "", -50.000000 0.000000 29.000000;
"weighted_c", "weighted_p", 108.000000 0.000000 -1.000000;
"unweighted_p", "", -49.000000 0.000000 -26.000000;
"unweighted_c", "unweighted_p", 107.000000 0.000000 0.000000;
Groups: 1;
Group: 0 {
Bone: "weighted_p" 20;
4, 1.000000;
5, 1.000000;
6, 1.000000;
7, 1.000000;
8, 0.8000000;
9, 0.8000000;
10, 0.8000000;
11, 0.8000000;
12, 0.600000;
13, 0.600000;
14, 0.600000;
15, 0.600000;
16, 0.400000;
17, 0.400000;
18, 0.400000;
19, 0.400000;
20, 0.200000;
21, 0.200000;
22, 0.200000;
23, 0.200000;
Bone: "weighted_c" 20;
0, 1.000000;
1, 1.000000;
2, 1.000000;
3, 1.000000;
8, 0.2000000;
9, 0.2000000;
10, 0.2000000;
11, 0.2000000;
12, 0.400000;
13, 0.400000;
14, 0.400000;
15, 0.400000;
16, 0.600000;
17, 0.600000;
18, 0.600000;
19, 0.600000;
20, 0.800000;
21, 0.800000;
22, 0.800000;
23, 0.800000;
Bone: "unweighted_p" 12;
28, 1.000000;
29, 1.000000;
30, 1.000000;
31, 1.000000;
32, 1.000000;
33, 1.000000;
34, 1.000000;
35, 1.000000;
36, 1.000000;
37, 1.000000;
38, 1.000000;
39, 1.000000;
Bone: "unweighted_c" 12;
24, 1.000000;
25, 1.000000;
26, 1.000000;
27, 1.000000;
40, 1.000000;
41, 1.000000;
42, 1.000000;
43, 1.000000;
44, 1.000000;
45, 1.000000;
46, 1.000000;
47, 1.000000;
};
you can download all the files i used here
|
|
|
Re: bone vertex weighting problem (when weight on child <.5)
[Re: jcl]
#305006
01/12/10 14:57
01/12/10 14:57
|
Joined: Jan 2004
Posts: 3,023 The Netherlands
Helghast
Expert
|
Expert
Joined: Jan 2004
Posts: 3,023
The Netherlands
|
Yes. Bones weights are definitely only supported by animation, but not by bone manipulating functions.
It can be implemented for such functions too, but it's not decided yet in which release. It would definatly be ALOT better... For example, my ragdolls are based on scripted rotations, if that has weighted bones to it, it would look a ton better. and ofcourse, alot of other things could potentially be alot better (think heads scripted to follow another entity). just my 2 cents, but it would definatly make a difference. regards,
|
|
|
|