Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Ayumi), 903 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

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:
Code:
#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:
Code:
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


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: bone vertex weighting problem (when weight on child <.5) [Re: yorisimo] #304142
01/05/10 10:57
01/05/10 10:57
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Please try the following:

- Save the rotation in your first MED image in a couple animation frames
- Play the frames in MED, and in the engine

Does the animation then look like in MED, or does the problem still appear?

Re: bone vertex weighting problem (when weight on child <.5) [Re: jcl] #304154
01/05/10 12:45
01/05/10 12:45
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
The animation is correct when saved in MED and played in the engine using ent_animate. So this seems to be a problem only when using ent_bonerotate and ent_bonemove.


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: bone vertex weighting problem (when weight on child <.5) [Re: yorisimo] #304155
01/05/10 12:49
01/05/10 12:49
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Then the weights are correctly stored. It's possible that vertex weights are only supported by bones animation, but not when directly manipulating a bone. I haven't found yet an info about this in our documentation, and will look into the source code. Either it will be implemented in a future version, or at least mentioned in the manual. Thank you for the bug report!

Re: bone vertex weighting problem (when weight on child <.5) [Re: jcl] #304872
01/11/10 15:40
01/11/10 15:40
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
Any news on this problem, if a code error was found, and what release will fix the problem?


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: bone vertex weighting problem (when weight on child <.5) [Re: yorisimo] #304999
01/12/10 14:26
01/12/10 14:26
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
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.

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 Offline
Expert
Helghast  Offline
Expert

Joined: Jan 2004
Posts: 3,023
The Netherlands
Originally Posted By: jcl
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,


Formerly known as dennis_fantasy
Portfolio - http://www.designorhea.com/
Project - http://randomchance.cherrygames.org/
Re: bone vertex weighting problem (when weight on child <.5) [Re: Helghast] #305056
01/12/10 18:11
01/12/10 18:11
Joined: Mar 2007
Posts: 197
Y
yorisimo Offline OP
Member
yorisimo  Offline OP
Member
Y

Joined: Mar 2007
Posts: 197
Helghast,

Happy to know that someone else is looking for this feature too. I spent a while weight painting a character in Blender to then be disappointed that the deformation still didn't look smooth in the engine. All my bone movements are done via scripting (I don't use preset animations at all). So I hope this comes soon.


Joris Lambrecht
My Contributions: Relative Rotation, Window Sizing
Re: bone vertex weighting problem (when weight on child <.5) [Re: yorisimo] #305149
01/13/10 08:04
01/13/10 08:04
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, I hope we can implement it for the next update.


Moderated by  HeelX, rvL_eXile 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1