is posible intancing with different animations?

Hello to all.
sorry for my english. i dont speak well.(write)
My question is…
I can do intancing of one model in about 40 intances. But every of them have the same animation.

        self.aux = Actor(MyWorld.mydir+"/../modelInprogress/DummyBox.egg",
                             {"izq":MyWorld.mydir+"/../modelInprogress/DummyBox-izquierda.egg",
                              "der":MyWorld.mydir+"/../modelInprogress/DummyBox-derecha.egg"})
self.aux.loop("der")
...
...
...
        self.chorus = NodePath('chorus')
        self.chorus.reparentTo(render)
        self.demasActI = []
        for demas in range(MAX_ACT):
            sitio = self.chorus.attachNewNode('posiciones')
            sitio.setPos(0-(random.uniform(-10, 10)),-(random.uniform(2, 45)),7)
            sitio.setTwoSided(True)
            sitio.setHpr(  0.0+random.uniform(0,180),0.0,0.0 )
            self.demasActI.append(self.aux.instanceTo(sitio))
            self.demasAct.append(sitio)

well. If i do a shader, i can do some of the instances have different scales, color or something. But ¿ I can do bone animation with shader, how ?
I think is posible but i dont kwon how.

Actually i have one shader

//Cg


void vshader(
			 float4 vtx_position : POSITION,
			 float4 vtx_color: COLOR,
			 in uniform float4 k_time,
			 in float3 vtx_normal: NORMAL,
			 out float4 l_position : POSITION,
			 out float4 l_color0 : COLOR0,
			 uniform float4x4 mat_modelproj,
			 in float2 vtx_texcoord0 : TEXCOORD0,
    		 out float2 l_my : TEXCOORD0){
			 float4 position = vtx_position;
			if (position.x > 0)
				position.x += 1 * (cos(k_time.x)+0.8);
			//if (position.x < 0.3)
				//position.x -= 1 * cos(k_time.x);

	    	 l_position = mul(mat_modelproj, position);
			 l_color0=vtx_color;
			 l_my = vtx_texcoord0;

}
void fshader(
			 uniform sampler2D tex_0 : TEXUNIT0,
			 float4 l_color0 : COLOR0,
			 in uniform float4 k_time,
			 in float2 l_my : TEXCOORD0,
			 out float4 o_color : COLOR){

			 //o_color=float4(l_color0[1],l_color0[0], l_color0[2],l_color0[3]);
			 //o_color = tex2D(tex_0, float2(1-l_my[0],1-l_my[1]));
			 o_color = tex2D(tex_0, float2(l_my[0],l_my[1]));

}

in this code

        self.demasActI = []
        for demas in range(MAX_ACT):

            sitio = self.chorus.attachNewNode('posiciones')
            sitio.setPos(0-(random.uniform(-10, 10)),-(random.uniform(2, 45)),7)
            sitio.setTwoSided(True)
            sitio.setHpr(  0.0+random.uniform(0,180),0.0,0.0 )
            if ( (demas % 2)==0):
                sitio.setShader(self.shader)
                pass

            self.demasActI.append(self.aux.instanceTo(sitio))
            self.demasAct.append(sitio)

The shader in ACT_MAX=4 do the 2 and 4 object expand in x an contract in x an 1 and 3 not expand, ( its different animation in each intance). If i would send the position of the ¿bones? to the shader (maybe reading the .egg animation file) i can do different animations in each instance. This will be very great. But i dont kwon

¿ some one can help my ?

thanks.

Hi, welcome to the forums!

This is not possible. The point of animation instancing is to re-use the same animation sequence for multiple models. If you want to use separate animations, you’ll need to load them as separate actors.

I think you’re confusing animation instancing for geometry instancing, however. I think what you’re looking for is geometry instancing, which is a technique that is able to do what you’re looking for.

thanks, plase to meet all.

then geometry instancing is what i need. I want create with the same actor different animation in different places ( like a army with different soldiers), but need collision object too. For this use instanceTo. But, is posible with geometry instance ? (i thing a shader, an array of positions for vexterx, a k_indexFrame and do some coding in the shader, and dummy objects for colideers ). This is the problem, how to do ?
I try do node.setinstanceid(4) and nothing happend, only one actor in the screen.

//Cg
//Cg profile gp4vp gp4fp
loadPrcFileData("", "basic-shaders-only #f")

In the shader


//Cg
//Cg profile gp4vp gp4fp

void vshader(
			 float4 vtx_position : POSITION,
			 float4 vtx_color: COLOR,
			 in uniform float4 k_time,
			 in float3 vtx_normal: NORMAL,
			 out float4 l_position : POSITION,
			 out float4 l_color0 : COLOR0,
			 uniform float4x4 mat_modelproj,
			 uniform int l_idx:INSTANCEID,
			 in float2 vtx_texcoord0 : TEXCOORD0,
    		 out float2 l_my : TEXCOORD0){




			 float4 position = vtx_position;
			if (position.x > 0)
				position.x += 1 * (cos(k_time.x)+0.8);
			//if (position.x < 0.3)
				//position.x -= 1 * cos(k_time.x);

			 float4x4 new_mat  = float4x4(1 , 0, 0, l_idx%32, 0, 1, 0, l_idx/32, 0, 0, 1, l_idx, 0, 0, 0, 1) ;
			 for (int i=0;i<l_idx;i++){
				 vtx_position.x = vtx_position.x + i;
			  }
	    	 l_position = mul(mat_modelproj, vtx_position);
	    	 //l_position = mul(new_mat, position);
			 l_color0=vtx_color;
			 l_my = vtx_texcoord0;

}

but now i have

gobj(error): Cg program too complex for driver: /c/WorkSpacePython/Actors/pru.sha. Try choosing a different profile. :cry:

I dont know if is my graphics card ( a integrated Intel GMA 950, maybe ), i will probe this code on a real nvidia but the internet is in this computer. and the nvidia is in other house.

thanks for the advice, i will investigate about geometry instancing.