ETL replacement


#1

Hi!
I have some more free time nowadays after finishing my degree (yay).
The ETL doesn’t look very nice to me. I think the implementation is very partial and looks to me more like a bunch of shared utilities, which don’t live up to the name “Extended Template Library”.
At least the majority of the functionality is already implemented in the boost libraries, which have a very high quality, are broadly used, peer-reviewed and well tested.
We are already dependent on the boost libraries so why not use them to a bigger extent and get rid of the ETL as much as possible and simplify the code of synfig.

I will start replacing the ETL with boost libraries first in the command-line interface, then in synfig library and synfig modules and then in synfig-studio in this order.
Along the way I can most probably simplify/improve some stuff and make synfig’s code cleaner.

Follow the progress of the implementation in this branch of my repository: https://github.com/eldruin/synfig/tree/eldruin_etl_replacement
I also opened an issue in the bug tracker: http://www.synfig.org/issues/thebuggenie/synfig/issues/723


#2

Excellent news!
Please consider to read the coding commenting guidelines outlined in the following thread, for this and rest of your contributions.


Also, please think on provide some sort of batch of tests for those kind of global changes. It is easy break things when the deep core of the application is refurbished.
Cheers!


#3

Congrat’s for your degrees and welcome on code again…


#4

Hi,
The ETL replacement is going well.
However, I need a fat sif file to test several things (right now, the ETA calculation). I need one single file that takes a couple of minutes to render in a couple-year-old computer (I can also use cpulimit but I don’t have any that takes more than a few seconds).
Could anyone please give me one?

I created a wiki page where the replacement functions will be posted: http://wiki.synfig.org/wiki/Dev:ETL_replacement

Regards.


#5

logolaboite-002-bulles.sifz (133 KB) synfig will complains of missing images … but anyway … isn’t it ?

Also from this thread

ETL : I finish a build, and will test you branch … any advice ? dependencies ?


#6

Great, thank you!

To test my branch you just need to install the boost libraries. New dependencies are boost-chrono, boost-system, boost-filesystem and boost-format (on ubuntu I would just install libboost-all-dev).

Thanks for checking out my branch, let me know any comments.


#7

boost format : you would say libboost-locale i guess ?


#8

No, boost::format is safe replacement to the C-style etl::strprintf. I guess it is packed together with libboost-dev in ubuntu.


#9

I am doing a refactor in the remaining rendering time calculation of synfig-tool.
The synfig-tool reports its progress with a class inherited from synfig::ProgressCallback, which reimplements amount_complete().
The code looks like the initial intention was to call this function while rendering a frame in scanline mode up to once per line.
Since then the code has changed and this looks like it is not supported any more, and that this is called per frame instead of per rendering line.
Is this the case for the synfig::ProgressCallback::amount_complete() function? If so, I can rename the variables and messages to be consistent. Right now it works correctly with several example sifs.

Here is the major refactor commit: github.com/eldruin/synfig/commi … 8f22ec6f42


#10

Hi, sorry for the insistence but does anyone know about the question I asked in the post above?


#11

Hi, if it is just a rename thing, do it and keep in code comments the reason for the name change. I never looked in deep that part of code.
Keep it up!
-G


#12

Hello,

What’s the latest update on the Boost replacement of ETL?

I have the following questions about etl::dirname and synfig::get_binary_path:

Reference code gui\main.cpp:

	String binary_path = synfig::get_binary_path(String(argv[0]));
	
#ifdef ENABLE_NLS
	String locale_dir;
	locale_dir = etl::dirname(etl::dirname(binary_path))+ETL_DIRECTORY_SEPARATOR+"share"+ETL_DIRECTORY_SEPARATOR+"locale";

What is the difference between synfig::get_binary_path and etl::dirname?
In Python, is etl::dirname the same as os.path.dirname and is synfig::get_binary_path equivalent to os.path.abspath or os.path.dirname(os.path.abspath(filename))?

The interpretation I am getting does not look correct:

binary_path = os.path.dirname(os.path.abspath(sys.argv[0])) #C:\Program Files\Synfig\bin

#                           C:\Program Files\Synfig           \\          share        \\          locale
locale_dir = os.path.dirname(os.path.dirname(binary_path)) + os.path.sep + "share" + os.path.sep + "locale"

Does it mean that locale_dir = “C:\Program Files\Synfig\share”? This is not correct.

I am engaging on an ambitious project to port synfig-studio to wxPython then use Boost to call the C++ synfig-core part from Python.


#13

Hello, eshikafe,

you can get an eye on eldruin repo … but, actually nothings new since 15’ october … and the work on core unit test he has done is not upstream : github.com/eldruin/synfig/tree/core_unittests

!!!

has you say … what an ambitious project! … but…

I don’t want to be pedantic or trying to frustrate your motivation, but(bis), if you want to both help the synfig community and work around Python, a very terrible and useful work could be to look at a real plugin system for synfig aka “synfig python api” (in the way of blender / gimp / natron / …) … even drafting some wiki doc could be extremely useful!

Anyway … it’s just my feeling!

see’u!