Mardy (Articoli su 3D)http://mardy.it/it/categories/3d.atom2024-02-02T20:11:09ZAlberto MardeganNikolaCaption generator addon for Blenderhttp://mardy.it/it/blog/2017/07/caption-generator-addon-for-blender.html2017-07-26T14:36:00+03:002017-07-26T14:36:00+03:00Alberto Mardegan<div style="text-align: center;"><iframe allowfullscreen="" frameborder="0" height="270" src="https://www.youtube.com/embed/wW1jVhHRU0I" width="480"></iframe></div><div style="text-align: center;"><br></div><div style="text-align: left;">Doing <a href="http://blog.mardy.it/2017/07/evolution-of-qml-application.html" target="_blank">yesterday's video</a> was fun, but one thing that frustrated me a lot was the preparation of the subtitles; it frustrated me to such a point, that after doing just a couple of subtitles I decided to write a Blender addon which would do much of the hard work for me. So, welcome the <a href="https://gitlab.com/mardy/blender-addons" target="_blank">Caption generator</a>!</div><div style="text-align: left;"><br></div><div style="text-align: left;">You can watch the video or read the description (or the code!) in Gitlab if you want to learn how to use it; what I care about writing here, is my impressions after writing my first Blender addon. Well, thanks to the easiness of the Python language and to a <a href="https://docs.blender.org/api/blender_python_api_current/" target="_blank">well documented internal API</a>, writing this addon was very easy.</div><div style="text-align: left;">What I did find hard, and made me waste quite some time without even finding a good solution, was how to open the file selection dialog only after the user had clicked over a "Generate" button on the addon's side panel. The addon API's <tt>invoke()</tt> method doesn't seem to be well documented, and the <a href="https://blender.stackexchange.com/questions/42193/how-to-delay-execution-of-execute-function-in-an-addon" target="_blank">example I found in the Blender stackexchange</a> did fix that issue while introducing new ones. So I gave up on this, and just let my addon fire up the file selection dialog as soon as it's activated.<br><br>
<br><br>
Summing up, <b>writing an addon for Blender is extremely easy</b>; polishing it to make it behave exactly as you wish might be a challenge (depending on your requirements, of course). But all in all, I suspect that I'll write more Blender addons, should I find some actions which I wish to automate.</div><div style="text-align: center;"><iframe allowfullscreen="" frameborder="0" height="270" src="https://www.youtube.com/embed/wW1jVhHRU0I" width="480"></iframe></div><div style="text-align: center;"><br></div><div style="text-align: left;">Doing <a href="http://blog.mardy.it/2017/07/evolution-of-qml-application.html" target="_blank">yesterday's video</a> was fun, but one thing that frustrated me a lot was the preparation of the subtitles; it frustrated me to such a point, that after doing just a couple of subtitles I decided to write a Blender addon which would do much of the hard work for me. So, welcome the <a href="https://gitlab.com/mardy/blender-addons" target="_blank">Caption generator</a>!</div><div style="text-align: left;"><br></div><div style="text-align: left;">You can watch the video or read the description (or the code!) in Gitlab if you want to learn how to use it; what I care about writing here, is my impressions after writing my first Blender addon. Well, thanks to the easiness of the Python language and to a <a href="https://docs.blender.org/api/blender_python_api_current/" target="_blank">well documented internal API</a>, writing this addon was very easy.</div><div style="text-align: left;">What I did find hard, and made me waste quite some time without even finding a good solution, was how to open the file selection dialog only after the user had clicked over a "Generate" button on the addon's side panel. The addon API's <tt>invoke()</tt> method doesn't seem to be well documented, and the <a href="https://blender.stackexchange.com/questions/42193/how-to-delay-execution-of-execute-function-in-an-addon" target="_blank">example I found in the Blender stackexchange</a> did fix that issue while introducing new ones. So I gave up on this, and just let my addon fire up the file selection dialog as soon as it's activated.<br><br>
<br><br>
Summing up, <b>writing an addon for Blender is extremely easy</b>; polishing it to make it behave exactly as you wish might be a challenge (depending on your requirements, of course). But all in all, I suspect that I'll write more Blender addons, should I find some actions which I wish to automate.</div>Making snap packages of photogrammetry softwarehttp://mardy.it/it/blog/2017/03/making-snap-packages-of-photogrammetry.html2017-03-24T21:11:00+03:002017-03-24T21:11:00+03:00Alberto Mardegan<div dir="ltr" style="text-align: left;" trbidi="on">
Some time ago I got vaguely interested into <a href="https://en.wikipedia.org/wiki/Photogrammetry" target="_blank">photogrammetry</a>, that is the reconstruction of a 3D model out of a set of plain 2D photographs. I just thought that it was cool, and wanted to try it.<br>
<br>
Unfortunately, the most popular of these tools, <a href="http://ccwu.me/vsfm/index.html" target="_blank">VisualSFM</a>, was not packaged for Ubuntu and didn't come with ready binaries. Furthermore, the steps to build it are far from trivial: they include modifying a few of the source files!<br>
<br>
So, while I was going through this ordeal in order to compile it, I though of how I could avoid running through all this pain once more, had the need emerged to build this program again in the future. I initially thought of writing a shell script to automate it, but then I realized that there exists a much better solution: a <a href="https://snapcraft.io/" target="_blank">snapcraft</a> recipe!<br>
This solution has the big advantage that the resulting binary (called a "snap" package) can be shared with other Linux users, by publishing it into the snap store. Therefore, one doesn't need to be a programmer or a computer expert anymore in order to install the software.<br>
<br>
As I quickly found out, other "structure from motion" and "multi-view stereo" (the two parts of the 3D reconstruction pipeline) programs are also unavailable as binaries for Linux, and require quite some effort to be built. As a matter of fact, this problem is quite common for scientific and academic software: always written by authentic geniuses in the field of research, but who often are not as experienced (or interested) in software distribution.<br>
<br>
So I thought — well, given that I've just made a snap package (and that I've even enjoyed the process!), why stop here? :-)<br>
<br>
And here you have it: most of this photogrammetry software is now available as snap packages, which makes it trivial to install them and try them out. Though indeed, the 3d reconstruction can take a lot of time, so that's another thing to be considered.<br>
<br>
To help you out in deciding which software to use, I made a video review of structre from motion and multi-view stereo tools; without any pretense of scientificity, — be it clear! — just with the goal of giving an overview of what is available out there, and how easy (or difficult!) to use it is:<br>
<div class="separator" style="clear: both; text-align: center;">
<br></div>
<iframe allowfullscreen="" frameborder="0" height="360" src="https://www.youtube.com/embed/ELHOjC_V-FE?ecver=1" width="640"></iframe><br>
<div class="separator" style="clear: both; text-align: center;">
<br></div>
I also "snapped" a couple of other programs related to 3D reconstructions. One of them is <a href="http://www.cloudcompare.org/" target="_blank">CloudCompare</a>, a 3D point cloud and mesh processing software.<br>
<br>
I might be making more videos on this subject, so stay tuned. :-)<br>
<h3 style="font-family: Arial, Helvetica, sans-serif;">
<br></h3>
</div><div dir="ltr" style="text-align: left;" trbidi="on">
Some time ago I got vaguely interested into <a href="https://en.wikipedia.org/wiki/Photogrammetry" target="_blank">photogrammetry</a>, that is the reconstruction of a 3D model out of a set of plain 2D photographs. I just thought that it was cool, and wanted to try it.<br>
<br>
Unfortunately, the most popular of these tools, <a href="http://ccwu.me/vsfm/index.html" target="_blank">VisualSFM</a>, was not packaged for Ubuntu and didn't come with ready binaries. Furthermore, the steps to build it are far from trivial: they include modifying a few of the source files!<br>
<br>
So, while I was going through this ordeal in order to compile it, I though of how I could avoid running through all this pain once more, had the need emerged to build this program again in the future. I initially thought of writing a shell script to automate it, but then I realized that there exists a much better solution: a <a href="https://snapcraft.io/" target="_blank">snapcraft</a> recipe!<br>
This solution has the big advantage that the resulting binary (called a "snap" package) can be shared with other Linux users, by publishing it into the snap store. Therefore, one doesn't need to be a programmer or a computer expert anymore in order to install the software.<br>
<br>
As I quickly found out, other "structure from motion" and "multi-view stereo" (the two parts of the 3D reconstruction pipeline) programs are also unavailable as binaries for Linux, and require quite some effort to be built. As a matter of fact, this problem is quite common for scientific and academic software: always written by authentic geniuses in the field of research, but who often are not as experienced (or interested) in software distribution.<br>
<br>
So I thought — well, given that I've just made a snap package (and that I've even enjoyed the process!), why stop here? :-)<br>
<br>
And here you have it: most of this photogrammetry software is now available as snap packages, which makes it trivial to install them and try them out. Though indeed, the 3d reconstruction can take a lot of time, so that's another thing to be considered.<br>
<br>
To help you out in deciding which software to use, I made a video review of structre from motion and multi-view stereo tools; without any pretense of scientificity, — be it clear! — just with the goal of giving an overview of what is available out there, and how easy (or difficult!) to use it is:<br>
<div class="separator" style="clear: both; text-align: center;">
<br></div>
<iframe allowfullscreen="" frameborder="0" height="360" src="https://www.youtube.com/embed/ELHOjC_V-FE?ecver=1" width="640"></iframe><br>
<div class="separator" style="clear: both; text-align: center;">
<br></div>
I also "snapped" a couple of other programs related to 3D reconstructions. One of them is <a href="http://www.cloudcompare.org/" target="_blank">CloudCompare</a>, a 3D point cloud and mesh processing software.<br>
<br>
I might be making more videos on this subject, so stay tuned. :-)<br>
<h3 style="font-family: Arial, Helvetica, sans-serif;">
<br></h3>
</div>