SVGTEX - vector texture plugin for Blender 2.49

This problem to compile reminds me of an issue I had met with Vectex:
How would you handle network anim rendering (simply using touch and no overwrite) on a multi platform network, I guess you have to link the same blend file to two versions of the plugin one linux SO one Windows DLL (though in windows they can be named SO, the one I had tried seemed like just a name hack, because the SO didn’t work on Linux). So you would have to do it in an “on render” script by switching the between the path of the DLL or SO files with an “if platform” test ?

mato: I managed to repeat this g++ errors on MinGW. It seems to me, that the proper resolution for the error “no matching function for call” should be something different (compare the type of local variables):

 
                //to_root(req_prepare(request::prepare_measure, measure));  
                req_prepare req(request::prepare_measure, measure);
                to_root(req);

I am afraid, that I will face problems with linking the version compiled with g++ on Windows. But still I am able to compile whole thing with g++ and remove all thsese errors. In paralel, I check if this modified code still works in VC 6.0. The corrected source for you should be ready on Friday or Saturday. I send the post on this thread, when it will be finished.

Maurice: Do you mean the situation, that:

  1. there are two computers: one with Windows and one with Linux.
  2. on both you have opened the same blender file, located on a common network share. This file uses the vectex plugin for texture
  3. you want just to run the rendering process on both, without changing anything in the *.blend file

I the problem, described above is correct, the answer is following:

  1. have two different binaries of vectex plugin: one for Linux, one for Windows.
  2. gave them the same name - for example “vectex.so”. For Windows, it does not matter, what is the extension of the dynamic linked library. It is just a custom, that they usually have *.dll extension
  3. place both of them in a directory, that is listed in the PATH environment variable on both systems: Linux and Widows. (These directories are “scanned” by OS, when you use the name of shared component without any path)
  4. Use in the *.blend file plugin names (like “vectex.so”), without any path (every OS will find them, performing lookup along the PATH environment variable directories)

I have experimented with the PATH environmet variable and plugin placement on Windows, some weeks ago.

Thanks, it’s simper than a script. I’ll try to remember that, next time I setup files using inkscape to build them more futureproof. (I had made a character’s tatoo with Vectex. Thanks for both your plugins which I hope are going to be merged under a single name?
and will no more need for a special build?

Thank you Witold.
Now I can understand what was wrong with my changes.
I only thought how I can remove the error and I changed the code without understanding the programs well.
I should have examined the meaning of the program in detail.

I want to change my build’s SVG renderer from QtSVG to your improved AGG SVG renderer.
I think I should do it with more good understanding of the source code.
I want to learn more about your program.

Hi, mato. I have just finished “cleaning” of the source files for g++ compiler. They are ready for downloads. The workaround, you have showed me, although only partially correct, saved a lot of time. Without this tip with local variable, I could spend many hours, trying to find the way to eliminate this g++ error.

Now g++ compiles the source without any error nor warning (at least on my MinGW on Windows). To be sure, that I have not spoiled the original code, I compiled them also with VC++ 6.0, and tested against the examples (both: svgtex.dll and svgview.exe).
I have not linked the g++ versions into executables, because I still have to determine, how to build the static EXPAT library with g++ on Windows. It think, that I will prepare a “test place” for it on an old computer with Ubuntu, I have home.
The makefiles, used to compile with g++, are named Compile.mak and placed in the directory of each project (in svgtex and its svgview subdirectory). Notice the preprocessor declarations there - they are also important

Let me know, If you have faced any errors with this code, or just want to learn more about it :eyebrowlift:.

Maurice: vectex is not mine (I have just started form the original plugin’s source, like mato. I had concentrated on different aspect of it). From the replies to this thread, it seems that a separate Blender branch is also requested by users (see Meta-Androcto’s reply, at the first page). I have received similar suggestion also from local, Polish, Blender forum. What I can say, is that both solutions are possible: as long, as the mato’s barnch will not become the standard Blender, I will keep the plugin up to date. During our co-operation on this code, we will also prepare Freetype implementation, I hope. It would allow me to prepare a full svgtex version for Linux.

Thanx for the information!

Hi Witold,
About the preprocessor declarations I didn’t pay attention to it. They are the compiler option with ‘-D’ at CXXFLAGS? Probably I need to investigate them quite a lot. Thank you for giving me a very important informations.

I got your new source code from the link above. I still have some error which it seems to me due to the difference of the version of gcc. This error was reported from previous version. It’s like below.

In file included from svg_element.h:31,
                 from svg_element.cpp:30:
svg_parser.h:248: error: extra qualification ‘svg::parser::’ on member ‘remove_spaces’
svg_parser.h:261: error: extra qualification ‘svg::parser::’ on member ‘create_line’
svg_parser.h:268: error: extra qualification ‘svg::parser::’ on member ‘create_ellipse’
svg_parser.h:276: error: extra qualification ‘svg::parser::’ on member ‘create_rect’
svg_parser.h:296: error: extra qualification ‘svg::parser::’ on member ‘parse_painter’

In file included from svg_req_filter.h:35,
                 from svg_filter.cpp:30:
svg_shape.h:131: error: extra qualification ‘svg::shape::’ on member ‘bounding_box’
In file included from svg_filter.cpp:30:
svg_req_filter.h:70: error: extra qualification ‘svg::req_filter::’ on member ‘req_filter’

In file included from svg_linear_text_position.h:31,
                 from svg_tspan.h:33,
                 from svg_text.h:32,
                 from svg_parser.cpp:44:
svg_text_position.h:142: error: extra qualification ‘svg::text_position::’ on member ‘internal_transform’
svg_parser.cpp: In member function ‘void svg::parser::parse(const char*)’:
svg_parser.cpp:345: warning: format ‘%d’ expects type ‘int’, but argument 4 has type ‘XML_Size’

In file included from tex_tile.h:37,
                 from tex_tileset.h:37,
                 from tex_instance.h:39,
                 from svgtex.cpp:48:
tex_texel.h:142: error: extra qualification ‘tex::texel::’ on member ‘texel’
tex_texel.h:253: error: extra qualification ‘tex::texel::’ on member ‘calc_slope’

I fixed this error by removing the class name from the definition part like this.


        //char *parser::remove_spaces(const char *srcbuf, char *dstbuf, size_t max_size); 
        char *remove_spaces(const char *srcbuf, char *dstbuf, size_t max_size); 

And there are some little changes needed in the Compile.mak to complete the compiling. It’s a path delimiter in the Compile.mak. I needed to change some ‘’ to ‘/’ on my linux environment. And the other thing I needed is removing two windows specific source code from SRC_CXX.

I am still not able to get a texture plugin file from the Compile.mak. I need a little more time for making the linker process works correctly.

Thank you.

Hi, mato.
It think, that I have left by mistake the class prefix in these files, your fix is proper and clean. (The other compilers have not complained so far, so I did not noticed it).
Tell me, what gcc version you are using, I will install the same (It seems that the MinGW for Windows installs the gcc 3.2 by default). Then I will check if everything is OK, and publish the updated sources. (It is very important to keep the sources in sync, otherwise it will be very difficult to repeat and debug errors, in the future).

Yes, you are right, the preprocessor directives are “-Dxxx” items in CXXFLAGS.

About linking EXPAT library: I do not know, if it is important on Linux, but on Windows I compiled it as a multi-thread, wide-character (the _MBCS preprocessor directive selects in VC 6.0 wide-character string functions), static library. In general, all directives with _ prefix are Visual C specyfic (i.e. are used by Microsoft macros in standard headers, not mine). Probably there is no gcc equivalent for “_USRDLL” directive - it just tells VC to build a “regular” (normal, standard) shared object, which exposes its public functions in the standard way.

Thanks

Hi Witold,
I am currently using Ubuntu 9.10 and gcc is 4.4.1. But new Ubuntu 10.04 will be released soon. Probably I will update my Ubuntu within a few weeks. Ubuntu 10.04 seems to use gcc 4.4.3.

And thank you for useful information about the preprocessor directives. I tried to examine those meanings yesterday by searching the keyword in the source cord with grep command. I found XML_STATIC seems to be needed by EXPAT (Windows only) and TEX_EXTENSIONS seems to be needed by svgtex. Others were not in the source code but now I can understand those meanings well. Thank you.