Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'materials_library_vx/sendmat.py')
-rw-r--r--materials_library_vx/sendmat.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/materials_library_vx/sendmat.py b/materials_library_vx/sendmat.py
new file mode 100644
index 00000000..3cbb8aa7
--- /dev/null
+++ b/materials_library_vx/sendmat.py
@@ -0,0 +1,15 @@
+
+import bpy, json
+class EmptyProps(bpy.types.PropertyGroup):
+ pass
+bpy.utils.register_class(EmptyProps)
+bpy.types.Scene.matlib_categories = bpy.props.CollectionProperty(type=EmptyProps)
+cats = []
+for cat in bpy.context.scene.matlib_categories:
+ materials = []
+ for mat in bpy.data.materials:
+ if "category" in mat.keys() and mat['category'] == cat.name:
+ materials.append(mat.name)
+ cats.append([cat.name, materials])
+with open("D:\Blender Foundation\Blender\2.78\scripts\addons\matlib\categories.txt", "w") as f:
+ f.write(json.dumps(cats, sort_keys=True, indent=4))