[Bf-extensions-cvs] [c613fb19] master: matlib vx fix add/remove from library

Alfonso noreply at git.blender.org
Sun May 28 10:37:28 CEST 2017


Commit: c613fb199f231f61ac9bd26dd5603d1f1ae4749a
Author: Alfonso
Date:   Sun May 28 18:36:37 2017 +1000
Branches: master
https://developer.blender.org/rBAc613fb199f231f61ac9bd26dd5603d1f1ae4749a

matlib vx fix add/remove from library

===================================================================

M	materials_library_vx/__init__.py
D	materials_library_vx/createlib.py
D	materials_library_vx/save_categories.py
D	materials_library_vx/sendmat.py

===================================================================

diff --git a/materials_library_vx/__init__.py b/materials_library_vx/__init__.py
index c25bb425..01dac494 100644
--- a/materials_library_vx/__init__.py
+++ b/materials_library_vx/__init__.py
@@ -785,7 +785,7 @@ class MatlibRemove(bpy.types.Operator):
 	
 	def execute(self, context):
 		matlib = context.scene.matlib
-		success = matlib.remove_material(context.object.active_material)
+		success = matlib.remove_material()
 		if type(success).__name__ == "tuple":
 			print(success)
 			self.report({success[0]}, success[1])
diff --git a/materials_library_vx/createlib.py b/materials_library_vx/createlib.py
deleted file mode 100644
index a98c6833..00000000
--- a/materials_library_vx/createlib.py
+++ /dev/null
@@ -1,3 +0,0 @@
-
-import bpy
-bpy.ops.wm.save_mainfile(filepath="D:\\Blender Foundation\\Blender\\2.73\\scripts\\addons\\matlib\\Otherlib.blend", check_existing=False, compress=True)
\ No newline at end of file
diff --git a/materials_library_vx/save_categories.py b/materials_library_vx/save_categories.py
deleted file mode 100644
index 7f90fcdf..00000000
--- a/materials_library_vx/save_categories.py
+++ /dev/null
@@ -1,19 +0,0 @@
-
-print(30*"+")
-import bpy
-if not hasattr(bpy.context.scene, "matlib_categories"):
-	class EmptyProps(bpy.types.PropertyGroup):
-		pass
-	bpy.utils.register_class(EmptyProps)
-	bpy.types.Scene.matlib_categories = bpy.props.CollectionProperty(type=EmptyProps)
-cats = bpy.context.scene.matlib_categories
-for cat in cats:
-	cats.remove(0)
-
-cat = cats.add()
-cat.name = "Colors" 
-cat = cats.add()
-cat.name = "Nature" 
-cat = cats.add()
-cat.name = "Woods" 
-bpy.ops.wm.save_mainfile(filepath="D:\\Blender Foundation\\Blender\\2.73\\scripts\\addons\\matlib\\Otherlib.blend", check_existing=False, compress=True)
\ No newline at end of file
diff --git a/materials_library_vx/sendmat.py b/materials_library_vx/sendmat.py
deleted file mode 100644
index 3cbb8aa7..00000000
--- a/materials_library_vx/sendmat.py
+++ /dev/null
@@ -1,15 +0,0 @@
-
-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))



More information about the Bf-extensions-cvs mailing list