Action actuator breaks animation.
Open, NormalPublic

Description

Category: Animation

In the transition from 2.59 to 2.60, the FCurve actuator was removed. In 2.59 files, where FCurve actuators were used, 2.60 would replace them with Action actuators, which failed to properly play the original animation sequence.

The attached .blend (2.59) features a simple scene, with a Turret object that uses FCurve to play a recoil animation (press space to fire). Opening the file in 2.59, will show the appropriate behavior.

Opening the same file in 2.60, will show the inappropriate behavior, and therefore the problem itself.

Details

Type
Bug

I committed a fix (r41134). Could you grab a build off of builder.blender.org or graphicall.org that is r41134 (or newer) and confirm that the bug is fixed?

I have the source, so I can just svn up.

Your fix partially solves the problem, but there are still two left, one that I was able to fix by doing this:

Index: source/gameengine/Ketsji/BL_Action.cpp
===================================================================
--- source/gameengine/Ketsji/BL_Action.cpp (revision 41136)
+++ source/gameengine/Ketsji/BL_Action.cpp (working copy)
@@ -343,7 +343,7 @@
{
case ACT_MODE_PLAY:
// Clamp
- m_localtime = m_endframe;
+ m_localtime = m_startframe;
m_done = true;
break;
case ACT_MODE_LOOP:

And a really strange anomaly where the animation doesn't play for objects added in with scene.addObject, if those objects are on the same layer; adding in objects from an inactive/hidden layer seems to work fine.

I'm attaching an additional .blend that demonstrates this (two simple scenes: one Broken, and the other Working - press space to spawn in a copy).

I will try to take a look at tr_simple.blend when I can. As for your fix, it causes other compatibility issues (animations going back to frame one when they would stop at their last frame).

In 2.59, the FCurve animation did go back to 1 - that was normal behavior.

Anyway, your help is appreciated, and if/when you fix these issues, please be sure to tell me the revision/s, so that I can see what you did (especially for the second bug ... I tried for hours, but I couldn't narrow it down to a specific block - really curious about what the problem actually is).

Thanks again.

in Blender 2.59 [immediately before the 2.60 release] Goran's game engine tutorial 'turret defense'
works as he explains.

in Blender 2.60, as he as explained himself, the tutorial breaks, and as his tutorial is a foundational
tutorial using logic bricks its breaking is a pain both for him but also for tutors like myself who used his
work as example for more students of the game engine.

his tutorial cannot be taken past the 'hit points' video since even this basic file will crash blender.

for example, load the file and go to the game engine. everything seems to be working as required
until hit points = 0, where, upon escape back to blender, blender crashes.

colin m.





============================================
= Blender 2.60 (sub 0) System Information =
============================================


Blender:
============================================

version 2.60 (sub 0), revision 41405M. Release
build date: 2011-10-31, 05:27:18
platform: Windows:32bit
binary path: C:\blender2.6-adds-patch-yafa-lux\blender.exe
build cflags: /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /openmp -O2 -DNDEBUG -DWIN32 -D_CONSOLE -D_LIB -D_CRT_SECURE_NO_DEPRECATE -DWITH_MOD_FLUID -D__LITTLE_ENDIAN__ -DWITH_AUDASPACE
build cxxflags: /nologo /Ob1 /J /W0 /Gd /wd4018 /wd4244 /wd4305 /wd4800 /wd4065 /wd4267 /we4013 /openmp /EHsc -O2 -DNDEBUG -DWIN32 -D_CONSOLE -D_LIB -D_CRT_SECURE_NO_DEPRECATE -DWITH_MOD_FLUID -D__LITTLE_ENDIAN__ -DWITH_AUDASPACE
build linkflags: /SUBSYSTEM:CONSOLE /MACHINE:IX86 /STACK:2097152 /INCREMENTAL:NO /LARGEADDRESSAWARE /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:msvcmrt.lib /NODEFAULTLIB:msvcurt.lib /NODEFAULTLIB:msvcrtd.lib
build system: SCons

Python:
============================================

version: 3.2 (r32:88445, Mar 4 2011, 02:13:51) [MSC v.1500 32 bit (Intel)]
paths:
C:\blender2.6-adds-patch-yafa-lux\2.60\scripts\addons_extern
C:\blender2.6-adds-patch-yafa-lux\2.60\scripts\addons_contrib
C:\blender2.6-adds-patch-yafa-lux\2.60\scripts\addons
C:\blender2.6-adds-patch-yafa-lux\2.60\scripts\startup
C:\blender2.6-adds-patch-yafa-lux\2.60\scripts\modules
C:\blender2.6-adds-patch-yafa-lux\2.60\python
C:\blender2.6-adds-patch-yafa-lux\python32.zip
C:\blender2.6-adds-patch-yafa-lux\2.60\python\DLLs
C:\blender2.6-adds-patch-yafa-lux\2.60\python\lib
C:\blender2.6-adds-patch-yafa-lux
C:\blender2.6-adds-patch-yafa-lux\2.60\scripts\addons\modules
C:\blender2.6-adds-patch-yafa-lux\2.60\scripts\startup\vb25\plugins

Directories:
============================================

scripts: ['C:\\blender2.6-adds-patch-yafa-lux\\2.60\\scripts']
user scripts: None
datafiles: C:\Users\colin\AppData\Roaming\Blender Foundation\Blender\2.60\datafiles\
config: C:\Users\colin\AppData\Roaming\Blender Foundation\Blender\2.60\config\
scripts : C:\Users\colin\AppData\Roaming\Blender Foundation\Blender\2.60\scripts\
autosave: C:\Users\colin\AppData\Roaming\Blender Foundation\Blender\2.60\autosave\
tempdir: C:\Users\colin\AppData\Local\Temp\

OpenGL
============================================

renderer: ATI Mobility Radeon HD 5650
vendor: ATI Technologies Inc.
version: 3.2.9704 Compatibility Profile Context
extensions:
GL_AMDX_name_gen_delete GL_AMDX_random_access_target
GL_AMDX_vertex_shader_tessellator GL_AMD_draw_buffers_blend
GL_AMD_performance_monitor GL_AMD_seamless_cubemap_per_texture
GL_AMD_shader_stencil_export GL_AMD_texture_cube_map_array
GL_AMD_texture_texture4 GL_AMD_vertex_shader_tessellator
GL_ARB_color_buffer_float GL_ARB_copy_buffer GL_ARB_depth_buffer_float
GL_ARB_depth_clamp GL_ARB_depth_texture GL_ARB_draw_buffers
GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex
GL_ARB_draw_instanced GL_ARB_fragment_coord_conventions
GL_ARB_fragment_program GL_ARB_fragment_program_shadow
GL_ARB_fragment_shader GL_ARB_framebuffer_object
GL_ARB_framebuffer_sRGB GL_ARB_geometry_shader4
GL_ARB_half_float_pixel GL_ARB_half_float_vertex GL_ARB_imaging
GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_multisample
GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object
GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_provoking_vertex
GL_ARB_sample_shading GL_ARB_seamless_cube_map GL_ARB_shader_objects
GL_ARB_shader_texture_lod GL_ARB_shading_language_100 GL_ARB_shadow
GL_ARB_shadow_ambient GL_ARB_sync GL_ARB_texture_border_clamp
GL_ARB_texture_buffer_object GL_ARB_texture_compression
GL_ARB_texture_compression_rgtc GL_ARB_texture_cube_map
GL_ARB_texture_cube_map_array GL_ARB_texture_env_add
GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar
GL_ARB_texture_env_dot3 GL_ARB_texture_float GL_ARB_texture_gather
GL_ARB_texture_mirrored_repeat GL_ARB_texture_multisample
GL_ARB_texture_non_power_of_two GL_ARB_texture_query_lod
GL_ARB_texture_rectangle GL_ARB_texture_rg GL_ARB_texture_snorm
GL_ARB_transpose_matrix GL_ARB_uniform_buffer_object
GL_ARB_vertex_array_bgra GL_ARB_vertex_array_object
GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader
GL_ARB_window_pos GL_ATI_draw_buffers GL_ATI_envmap_bumpmap
GL_ATI_fragment_shader GL_ATI_meminfo GL_ATI_separate_stencil
GL_ATI_texture_compression_3dc GL_ATI_texture_env_combine3
GL_ATI_texture_float GL_ATI_texture_mirror_once GL_EXT_abgr
GL_EXT_bgra GL_EXT_bindable_uniform GL_EXT_blend_color
GL_EXT_blend_equation_separate GL_EXT_blend_func_separate
GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array
GL_EXT_copy_buffer GL_EXT_copy_texture GL_EXT_draw_buffers2
GL_EXT_draw_instanced GL_EXT_draw_range_elements GL_EXT_fog_coord
GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample
GL_EXT_framebuffer_object GL_EXT_framebuffer_sRGB
GL_EXT_geometry_shader4 GL_EXT_gpu_program_parameters
GL_EXT_gpu_shader4 GL_EXT_histogram GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil GL_EXT_packed_float GL_EXT_packed_pixels
GL_EXT_pixel_buffer_object GL_EXT_point_parameters
GL_EXT_provoking_vertex GL_EXT_rescale_normal GL_EXT_secondary_color
GL_EXT_separate_specular_color GL_EXT_shader_atomic_counters
GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_EXT_subtexture
GL_EXT_texgen_reflection GL_EXT_texture3D GL_EXT_texture_array
GL_EXT_texture_buffer_object GL_EXT_texture_buffer_object_rgb32
GL_EXT_texture_compression_bptc GL_EXT_texture_compression_latc
GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp
GL_EXT_texture_env_add GL_EXT_texture_env_combine
GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic
GL_EXT_texture_integer GL_EXT_texture_lod GL_EXT_texture_lod_bias
GL_EXT_texture_mirror_clamp GL_EXT_texture_object
GL_EXT_texture_rectangle GL_EXT_texture_sRGB
GL_EXT_texture_shared_exponent GL_EXT_texture_snorm
GL_EXT_texture_swizzle GL_EXT_timer_query GL_EXT_transform_feedback
GL_EXT_vertex_array GL_EXT_vertex_array_bgra
GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square
GL_NV_conditional_render GL_NV_copy_depth_to_color
GL_NV_explicit_multisample GL_NV_primitive_restart
GL_NV_texgen_reflection GL_SGIS_generate_mipmap
GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod
GL_SUN_multi_draw_arrays GL_WIN_swap_hint WGL_EXT_swap_control

i have tried to attach a .blend but cannot work

out the interface.


colin m

Colin, your issue is different than the one in this report. For such cases, please post a different report as it makes keeping track of bugs easier. And Goran, as for your two bugs, the first one is kind of tough to fix. The FCurve Actuator did indeed go back to the start frame, but the 2.59 Actuator had the same behavior as the current Action Actuator (staying at the end frame). So, either route is going to break something. I'm inclined to stick with the animation ending on it's last frame instead of resetting back to it's starting frame. Unfortunately, this will require fixing older files that relied on the old behavior. What are your thoughts on this?

As for the second bug, I'll be trying to tackle it again soon. I'd really like to see this report closed. ;)

I remember that I used 2.59, and that the animation would go back to the start frame. So, I'm a little confused by the statement that the "2.59 Actuator had the same behavior as the current Action Actuator (staying at the end frame)".

It seems to me like "going back to the start frame" would effectively sync the Action Actuator functionality with how the FCurve actuator always worked.

But, anyway: If it's too difficult, I can certainly understand that - You should do whatever makes makes things easier for you.

Thanks for all your help so far.

I'm attaching a file called fcurve_action_inconsistent.blend to demonstrate what I was saying (you'll need to run the file in 2.59). And, I should have said, "the 2.59 Action Actuator had the same behavior as the current Action Actuator"