LDraw.org Discussion Forums
LDCad 1.6a Animation crash - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw Editors and Viewers (https://forums.ldraw.org/forum-11.html)
+--- Thread: LDCad 1.6a Animation crash (/thread-22751.html)



LDCad 1.6a Animation crash - Jarema - 2018-03-11

When I use Explode or Magnet Build script on attachment file, then i get a message:
Playback is too slow for 25 fps at an avg frame time of 222.56ms.

The question is how change FPS from LUA script ?!


RE: LDCad 1.6a Animation crash - Philippe Hurbain - 2018-03-11

(2018-03-11, 14:59)Jarema Wrote: When I use Explode or Magnet Build script on attachment file, then i get a message:
Playback is too slow for 25 fps at an avg frame time of 222.56ms.
It's a question of graphics board performance, size of LDCad window, complexity of model, etc.... You can try to reduce required frame rate to a lower value (open animation panel on main view top right, click on '25fps' and reduce that value). Note that for saving an animation this is not a problem since the images are not created in real time.

Or you can use setFPS in the script.

Nice mosaic BTW!


RE: LDCad 1.6a Animation crash - Jarema - 2018-03-11

Thanks for help.
Another question is: How move parts from sub-model to main-model when "Ungroup all" is not work at all ? Then delete empty sub-model.
Some scripts do not work properly without this. I need GUI and LUA behavior.


RE: LDCad 1.6a Animation crash - Roland Melkert - 2018-03-11

(2018-03-11, 14:59)Jarema Wrote: When I use Explode or Magnet Build script on attachment file, then i get a message:
Playback is too slow for 25 fps at an avg frame time of 222.56ms.

The question is how change FPS from LUA script ?!

Like Philo wrote,

It is not crashing but at some point their are too many bricks for the program to manipulate/reprep/render 25 times a second.

The bottle neck is probably not the graphics card, any semi recent card should be able to handle 8000 bricks.

The script execution is usually also below 1ms even for the biggest scripts.

The problem lies in the render prepping which is needed whenever a bricks position and or visibility changes.
This is CPU based work and uses only a single thread.
It will be even worse if the model contains many transparent parts.

If you want to view the animation regardless, You can do an OpenGL export (alt+e) at any fps and combine the images with ffmpegenc or something.


LDCad 1.6a Animation developer diary - Jarema - 2018-03-11

Currently, the script for LDCad can do such a thing: Click to watch . The chassis and the green brick are from the first step. I gave two wheels for one step.
Main script use static.lua for grounded elements - like baseplate - and horizontal.lua to know what direction obtain when moving part -- like wheel.


RE: LDCad 1.6a Animation developer diary - Roland Melkert - 2018-03-11

(2018-03-11, 21:44)Jarema Wrote: Currently, the script for LDCad can do such a thing: Click to watch . The chassis and the green brick are from the first step. I gave two wheels for one step.
Main script use static.lua for grounded elements - like baseplate - and horizontal.lua to know what direction obtain when moving part -- like wheel.

Looks promising maybe add sorting (in the start event) on y and x distance to zero to force a logical order?


RE: LDCad 1.6a Animation crash - Jarema - 2018-03-12

How extract informations about sub-model parts via LUA Script ? Because animate sub-model as one object break animation.


RE: LDCad 1.6a Animation crash - Roland Melkert - 2018-03-12

(2018-03-12, 10:55)Jarema Wrote: How extract informations about sub-model parts via LUA Script ? Because animate sub-model as one object break animation.

You can follow the references recursively trough someRef:getSubfile(), someSubfile:getRefCount(), someSubFile:getRef(index).

But the matrices/positions inside that will be relative, so you need to multiply with the higher ref's matrix.

Alternative is to use groups as they automatically manage absolute matrices.

This will only go as expected for single used submodels though.


RE: LDCad 1.6a Animation crash - Joscha - 2019-01-06

(2018-03-11, 19:28)Roland Melkert Wrote: Like Philo wrote,

It is not crashing but at some point their are too many bricks for the program to manipulate/reprep/render 25 times a second.

The bottle neck is probably not the graphics card, any semi recent card should be able to handle 8000 bricks.

The script execution is usually also below 1ms even for the biggest scripts.

I recently suffered from the same problem. When I set the fps to e.g. 60 and press play ldcad freezes and after a minute or so it returns responding but w/o starting the animation and w/o further notification.

I ran already similar animations and part numbers with 60fps on the same computer and it worked. But what I found out is that the pneumatic hoses do have a significant influence on the max fps.


RE: LDCad 1.6a Animation crash - Roland Melkert - 2019-01-07

(2019-01-06, 13:36)Joscha Wrote: I recently suffered from the same problem. When I set the fps to e.g. 60 and press play ldcad freezes and after a minute or so it returns responding but w/o starting the animation and w/o further notification.

I ran already similar animations and part numbers with 60fps on the same computer and it worked. But what I found out is that the pneumatic hoses do have a significant influence on the max fps.
Are you animating things connected to the hose? If so it will need to regenerate the whole hose every frame, depending on the length and complexity of it this will be a major bottle neck as it is done single threaded.

If the hose doesn't change it should not regenerate, if it does anyway this could indicate a bug. Could you send me the model in that case so I can investigate.