mul = [1,1,-1][ index ]
#}
+ if name == 'rotation_euler':
+ #{
+ index = [1,0,2][ index ]
+ mul = -1
+ #}
+
id = F"{name}:{index}"
print( F" Appending curve '{id}'" )
for marker in bpy.context.scene.timeline_markers:
#{
print( F"Marker {marker.name}: {marker.camera}" )
+ out_strip = ms_strip()
+ out_strip.data_start = 0
+ out_strip.data_count = 0
+ out_strip.data_mode = 2
+ out_strip.offset = marker.frame
+ out_strip.length = 0
+ out_strip.pstr_name = _af_pack_string( marker.name )
+ out_strip.pstr_internal_name = 0
+ out_strip.instance_id = 0xffffffff
+ out_strip.object_id = sr_entity_id( marker.camera )
+ _ms_compiler.strips.append( out_strip )
#}
_ms_compiler.strips.sort( key=lambda s: s.offset )
samplers[32];
u32 active_samplers;
+ ent_camera *active_camera;
+
u32 strip;
f32 time;
}
+ A[1] * (-1.0f*t3 + 3.0f*t2 - 3.0f*tc + 1.0f);
}
+ent_camera *_cutscene_active_camera(void)
+{
+ return _cutscene.active_camera;
+}
+
void cutscene_update( f32 delta )
{
_cutscene.time += delta;
continue;
}
+ if( strip->data_mode == 2 )
+ {
+ if( strip->object_id )
+ {
+ struct cs_asoc asoc;
+ _cutscene_get_strip_asoc( strip, &asoc );
+
+ VG_ASSERT( asoc.entity_type == k_ent_camera );
+ ent_camera *cam =
+ af_arritm( &_cutscene.meta.cameras, asoc.entity_index );
+
+ _cutscene.active_camera = cam;
+ }
+ else
+ _cutscene.active_camera = NULL;
+ }
+ else
+ {
if( strip->instance_id == 0xffffffff )
{
/* internal link */
samp->override = asoc.override;
}
}
-
+ }
+
_cutscene.strip ++;
}
if( kl && kr )
{
-#if 0
- f32 A = kl->co[0],
- D = kr->co[0],
- L = D-A,
- B = (kl->r[0] - A) / L,
- C = (kr->l[0] - A) / L,
- a = 1.0f + 3.0f*B - 3.0f*C,
- b = -6.0f*B + 3.0f*C,
- c = 3.0f*B,
- d = -(t - A) / L;
-
-/* ILLINOIS */
- f32 fa = d,
- fb = a+b+c+d,
- xMin = 0.0f,
- xMax = 1.0f,
- e,x1;
-
- for( u32 j=0; j<6; j ++ )
- {
- x1 = xMax - fb*(xMax-xMin)/(fb-fa);
- e = x1*x1*x1*a + x1*x1*b + x1*c + d;
-
- if( fabsf(e) < 0.0001f )
- break;
-
- if( fb*e < 0.0f )
- {
- xMin = xMax;
- fa = fb;
- }
- else
- fa = fa*0.5f;
-
- xMax = x1;
- fb = e;
- }
-
-/* BISECTION */
-#if 0
- /* One day I will have my revenge on cubics I swear */
- f32 x1 = 0.5f,
- xMin = 0.0f,
- xMax = 1.0f,
- e;
- for( u32 j=0; j<16; j ++ )
- {
- e = x1*x1*x1*a + x1*x1*b + x1*c + d;
- if( e > 0.0f ) xMax = x1;
- else xMin = x1;
- x1 = (xMin+xMax)*0.5f;
- }
-#endif
-
- if( samp->curves.semantic == CS_LOCATION+1 )
- vg_info( "convergence: %.9f\n", e );
-
- f32 x2 = x1*x1,
- x3 = x2*x1,
- Ay = kl->co[1],
- By = kl->r[1],
- Cy = kr->l[1],
- Dy = kr->co[1],
- y = Dy*x3
- + Cy*(-3.0f*x3 + 3.0f*x2)
- + By*( 3.0f*x3 - 6.0f*x2 + 3.0f*x1)
- + Ay*(-x3 + 3.0f*x2 - 3.0f*x1 + 1.0f );
-#endif
-
*samp->curves.target =
explicit_bezier( kl->co, kl->r, kr->l, kr->co, t );
}
{
*samp->curves.target = kl->co[1];
}
+
+ if( samp->curves.semantic == CS_FOV )
+ {
+ f32 mm = *samp->curves.target,
+ fov = 2.0f * 57.2957795f * atanf( (36.0f*0.5f) / mm );
+ *samp->curves.target = fov;
+ }
}
}
for( u32 i=0; i<af_arrcount(&_cutscene.meta.strips); i ++ )
{
ms_strip *strip = af_arritm(&_cutscene.meta.strips, i );
+
+ if( strip->data_mode == 2 )
+ {
+ ui_rect box = { root[0] + strip->offset, root[1], 1, rect[3]-16 };
+ ui_fill( ctx, box, 0xff00ff00 );
+
+ box[1] += box[3] -16;
+ box[2] = 200;
+ box[3] = 16;
+
+ if( ui_clip( rect, box, box ) )
+ {
+ ui_text( ctx, box, af_str( &_cutscene.meta.af, strip->pstr_name ),
+ 1, k_ui_align_middle_left, 0 );
+ }
+ continue;
+ }
u32 layer = 0;
for( u32 k=0; k<VG_ARRAY_LEN(usage); k ++ )