Gamestudio Links
Zorro Links
Newest Posts
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
M1 Oversampling
by 11honza11. 04/20/24 20:57
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 533 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
ent_bonereset_all + end_blendpose #465521
05/02/17 14:46
05/02/17 14:46
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Hello!
1) Apparently ent_bonereset_all() is not working in the sense of updating the visible mesh of an entity (at least when not GPU animated) when it's the only bone operation called that frame.

Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

void main()
{
	fps_max = 60;
	video_mode = 10;
	level_load(NULL);
	ENTITY* ent_minitest = ent_create("minitest.mdl",vector(256,0,0),NULL);
	ent_minitest.pan = 180;
	while(1)
	{
		if(key_1) ent_animate(ent_minitest,"testB",100,0);
		if(key_2) ent_bonereset_all(ent_minitest);
		if(key_3) ent_bonereset(ent_minitest,"Bone1");
		wait(1);
	}
}


Download code + model

A workaround: Resetting a random other bone that frame. This will update the rest of the mesh as well.


EDIT:
2) Back to my original problem from which the first one originated:
I cannot copy to (or from?) another entity.pose than pose 1 unless I've used ent_animate with pose != 1 at least once:
Code:
///////////////////////////////
#include <acknex.h>
#include <default.c>
///////////////////////////////

void main()
{
	fps_max = 60;
	video_mode = 10;
	level_load(NULL);
	ENTITY* ent_minitest = ent_create("minitest.mdl",vector(256,0,0),NULL);
	ent_minitest.pan = 180;
	while(1)
	{
		if(key_w) // first press [s]
		{
			ent_minitest.pose = 2;
			ent_animate(ent_minitest,"testA",100,0);
		}
		if(key_s) // press this first, then [space] -> no effect
		{
			ent_minitest.pose = 1;
			ent_animate(ent_minitest,"testA",100,0);
			int i;
			for(i = 1; i <= 4; i++) ent_bonerotate(ent_minitest,str_printf(NULL,"Bone%d",i),vector(sinv(total_ticks*5)*15*(1-2*(i > 2)),0,0));
			ent_blendpose(ent_minitest,2,1,100); // has no effect, or the subsequent ent_blendpose call
		}
		ent_minitest.pose = 1;
		ent_animate(ent_minitest,"testB",100,0);
		if(key_space) ent_blendpose(ent_minitest,1,2,100);
		
		wait(1);
	}
}


Press [S] first. This should copy the animation to pose 2 (I use stuff like that to save an old animation state for a couple of frames, which normally works quite good - the code here is just to demonstrate the issue).
When you now press [Space] it should show that animation instead of "testB". This only happens though when you press [W] at least once.

Last edited by Superku; 05/02/17 15:37.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: ent_bonereset_all + end_blendpose [Re: Superku] #465708
05/10/17 10:50
05/10/17 10:50
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Ent_bonereset resets the bones, but does indeed not update the mesh. I've added this to our list of things to check and fix.


Moderated by  jcl, Nems, Spirit, Tobias 

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