API Question Animation arraying

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
104
Points
78
Hi all,

I have an issue with multiple animations definitions with a simple for cycle.

I made a very big animation of a crawler, so it's 64 elements of the crawler times 8 of them so the for cycle was essential.

everything worked fine at the beginning, so I thought of letting also the crawlers orient, so I created a parent animation to the crawler one and added the animation component handle as a parent in the crawler definitions.
well I found out that even if I make proper array indications with the animations the parent animation is readded at every cycle.
As an example I have the parent animation which is a 45 deg rotation. in the following code NCING is 8 and NANIM is 64. the inside cycle seems to work fine, but final animation of my piece is a 360 deg... which is 45*8... so it's readding the parent property at each cycle...

Code:
for(int j=0;j<NCING;j++)
{
	for(int i=0;i<NANIM;i++)
	{
		
		Tr1[i][j] = new MGROUP_TRANSLATE(0,&ElementsCing[i][j],1,Translate1);
		
		animCing[i][j]=CreateAnimation(Beginnings[i]);
	
	AddAnimationComponent(animCing[i][j],0,0.113683,Tr1[i][j],rotb);

rotb is the parent animation component handle.


But I made a test and took out the add animation component from the for cycle, calling it Tr1_11 simply removed all the indexes and.... it was perfectly working. My small piece of mesh was staying and behaving exactly as it was supposed to... so it's the arraying that I don't know why, but it's not working.

now, there's no way I can do this for 64 elments*8 girdles * 8 animations, so 4096 times... any idea on how to make the arraying of the parent animation working properly?

Thanks!

Fred

---------- Post added at 09:16 ---------- Previous post was at 03:36 ----------

Never mind... I just realized that I was using 8 animations and I was giving to each one the parent animation information, so that is the reason why it was added 8 times, not for the for cycle.... :facepalm:
 
Top