Category:
- Import-Export
Location:
File --> Import-Export --> My Virtual Rig (.mvr)
File --> Import --> General Device Type Format (.gdtf)
Authors:
- Sebastian Schrand, Vanous, Hugo Aboud
Maintainer:
Extension for importing and exporting My Virtual Rig (.mvr) files and General Device Type Format (.gdtf), currently only importing is supported. GDTF files will be imported with targets to easily focus the fixture or they can be controlled with a trackball. The attributes and features of a fixture can be controlled from the custom property panel of the base model. Supported attributes are Pan, Tilt, RGB, CTC, Focus, Frost, Zoom, Intensity, Iris, Gobo and Gobo Rotate. Each fixture has its own index and will be replaced if another fixture with the same index is imported. MVR files wich are not including GDTF files will import a generic default fixture for the placeholders.
-Initial release upload
This extension requests the following permission:
General Device Type Format and My Virtual Rig files
Can you explain what is the difference between this and DMX add-on (https://extensions.blender.org/add-ons/open-stage-blender-dmx/). Feels like taking functionality and just making separate add-on for it?
Is there a justification for it? Does this do anything differently? Does it cover different scenarios?
The only common is that both can import mvr and gdtf files. BlenderDMX is capable of networking and was made for remote visualizing the gdtf fixtures. This addon is developed to import the fixtures for editing, the attributes will be added as custom properties wich also have the drivers for controlling the fixture. The goal is to have a fixture builder for gdtf files as stand alone addon to export the models as gdtf to use for lighting applications.
I uploaded an updated version wich is more developed in the direction it should go. Fixtures can be controlled with blender widgets as custom properties instead of using a DMX connection to control them. Files for testing are available at https://gdtf-share.com/
BTW here is a video https://www.facebook.com/NRGSille/videos/8431144186936971
Hey everyone,
Just a heads-up about a recent change regarding the licensing of add-ons on the Blender extension platform. Moving forward, all add-ons will need to be released under the GNU/GPL 3.0 license (SPDX:GPL-3.0-or-later). This is mainly to keep things simple and consistent across the board.
Previously, we accepted various licenses as long as they were compatible with Blender’s distribution. However, to avoid any confusion and streamline the process, all add-ons using the bpy API should now be presented as GPL 3 (the same license the Blender bundle is distributed). Regardless of whether the original code was under GPL 2, or something else like MIT or ZLIB.
Existing add-ons versions won't be affected. However, new updates will need to comply to the revised requirements.
Thanks for understanding, and feel free to reach out if you have any questions.
From automatic code review:
error_prone_dunder_file:
Use of __file__
.
Uses of __file__
often hint at things that should not be done, using the add-ons directory.
sys.path
.output\io_scene_mvr\source\io_scene_mvr\import_gdtf.py:44:51:
folder_path = os.path.dirname(os.path.abspath(__file__))
output\io_scene_mvr\source\io_scene_mvr\import_mvr.py:370:53:
current_path = os.path.dirname(os.path.realpath(__file__))
error_prone_no_string_escape: Use of error prone quoting.
A common mistake is to assume a name can be quoted in a string, for example:
data_path = 'objects["{:s}"]'.format(object.name)
Is incorrect because object.name
may contain a "
character.
To resolve:
repr(..)
bpy.utils.escape_identifier(..)
.output\io_scene_mvr\source\io_scene_mvr\import_gdtf.py:127:30:
red_target.data_path = f'["{path}"][0]'
output\io_scene_mvr\source\io_scene_mvr\import_gdtf.py:128:32:
green_target.data_path = f'["{path}"][1]'
output\io_scene_mvr\source\io_scene_mvr\import_gdtf.py:129:31:
blue_target.data_path = f'["{path}"][2]'
output\io_scene_mvr\source\io_scene_mvr\import_gdtf.py:187:14:
path = f'["{prop}"][0]' if check_pan else f'["{prop}"][1]'
PS C:\blender-git\blender-extensions-review>
The use of __file_
is needed to create a folder to extract .zip files. Is there an alternative to the addon path? I tried to use a temporary directory but because the extracted files are used more than one time, a temporary directory would not work. For the blender driver target data path the quotation is needed and the path inside is a fixed variable wich never contains a name or object name
Are you trying to store files inside extension directory? Why and which files?
A .gdtf or .mvr file is basically a .zip wich has to be extracted because the files can not be accessed inside the zip. The GDTF files wich are .3ds, .glb, .png and .svg will be stored inside the fixture_profiles folder (wich is part of the addon already containing default models). MVR files wich are also either .3ds .glb and .png will be stored inside another folder called "extracted_files" wich will be created into th addon directory. I have seen other addons on this extension platform wich are doing the same.
I would advise not to use extensions repository for storing/deleting items, especially for each new import. Its not safe to modify repository and should be avoided. Instead, I would let users create "temp" folder where all of that happens. It's always good to provide customizability to users like me who are more OCD about their file organization.
btw if you see examples of add-ons modifying their own repositories like this one I would like to know about them too.
As I mentioned above, I tried the solution of using a temp folder but a mvr file can contain the same fixture file multiple times and the temp folder solution would create multiple folders with the same content. The blenderDMX addon for example uses the same approach. The first version of my code had the solution to delete the created folder after the import process, but then with every import it would create a new one wich later is deleted again. I would really like to have a nice solution for this, are there any examples of how the user can be prompted to provide a path for extracted files? In my opinion the addon repo seemes to be the most safe place because if you uninstall the addon, the folder will also be gone.
After testing I found an issue regarding the image textures, because the images are linked they are not showing up after import because the linked folder was the temporary directory wich will be deleted after import, I have to find another solution. Maybe pack the images to the blender file? Or is there a standard folder for the imported textures?
Is there anything I can do to solve this problem? For blender the textures have to be stored somewhere to show up, even if I want to pack them into the blend file, they have to be somewhere. It is essential and how blender works. Even blender itself creates a textures folder if the images are unpacked.
Sign in to comment.
Ready for review