0

I have a simpĺe python script that triggers an animation base on the location of a cube.

import bpy

scene = bpy.context.scene obj = scene.objects['Text']

def recalculate_text(scene): x = scene.objects['Cube'].location[0] obj.data.body = '{0:.1f}'.format(x)

bpy.app.handlers.frame_change_pre.append(recalculate_text)

Using a text Object it shows the location of the cube in the Viewport.

The problem is that because my python skills are very basic, i can't Render the animation; once i hit "Render animation" ( Itried: EEVEE and CYCLES: Image sequence and video) it only shows the first frame of the text object. Here is the Blend File

Emir
  • 5,701
  • 1
  • 14
  • 31
  • The "Duplocate" solution did not work – Emir Nov 19 '20 at 16:33
  • 1
    Why not? "Doesn't work for me" doesn't really tell us what you've tried and where it failed, nor can we suggest other alternatives. – Duarte Farrajota Ramos Nov 19 '20 at 16:42
  • @DuarteFarrajotaRamos I tried to change the things that answered the question (the Duplicate), like frame_change_post and add scene,depsgraph, print(depsgraph), obj = obj.evaluated_get(depsgraph). But that did not work. As i mentioned in my question, my Python knowledge is very basic, and this could look easy for some one that knows Python, but for me it is not and that's why i asked for some help – Emir Nov 19 '20 at 17:36
  • 1
    The code in the dupe is actually working pretty well, you just have to call evaluated_get(depsgraph) on the cube itself -> Demo: https://pasteall.org/iA93, output as expected: https://i.stack.imgur.com/dwNhz.png – brockmann Nov 19 '20 at 18:16
  • @brockmann not sure why is not working, i also copy and pase the code directly to a blend file and nothing happens, not even in the viewport now. I'm also testing Blender 2.81, 2.83 (from blender website, linux versions) and 2.90.1 (linux snap) – Emir Nov 19 '20 at 20:24
  • I can confirm that is working only on my 2.80 Blender (linux), not sure why – Emir Nov 20 '20 at 02:09
  • No issues on windows/blender 2.90.1, blend: https://blend-exchange.giantcowfilms.com/b/DRQePDdQ -> Open up the file, run the script and move the cursor in the timeline. – brockmann Nov 20 '20 at 08:31
  • Still nothing? Any news or further issues? – brockmann Nov 21 '20 at 18:39
  • No, just 2.80, i ended up using that Blender version to make the project, thanks for everything – Emir Nov 22 '20 at 02:09
  • 1
    Just can tell that the blend file I posted is working across all versions on all systems for me. If you do not willing to provide any further information, I can't do much for you... – brockmann Nov 22 '20 at 10:27

0 Answers0