diff options
author | Alfonso <mackraken2023@hotmail.com> | 2017-05-28 11:36:37 +0300 |
---|---|---|
committer | meta-androcto <meta.androcto1@gmail.com> | 2017-05-28 11:36:37 +0300 |
commit | c613fb199f231f61ac9bd26dd5603d1f1ae4749a (patch) | |
tree | 319c905ea0ab3ee6714544dccde78afc1de090be /materials_library_vx | |
parent | 0510a4d77d299f85a68bba8fdb361cf2402ba81e (diff) |
matlib vx fix add/remove from library
Diffstat (limited to 'materials_library_vx')
-rw-r--r-- | materials_library_vx/__init__.py | 2 | ||||
-rw-r--r-- | materials_library_vx/createlib.py | 3 | ||||
-rw-r--r-- | materials_library_vx/save_categories.py | 19 | ||||
-rw-r--r-- | materials_library_vx/sendmat.py | 15 |
4 files changed, 1 insertions, 38 deletions
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)) |