[Bf-extensions-cvs] [068f8297] master: addons contrib: bulk remove unmaintained i/o part 2
meta-androcto
noreply at git.blender.org
Sat Sep 14 04:46:39 CEST 2019
Commit: 068f829776a81671c1a59f751f742782386af367
Author: meta-androcto
Date: Sat Sep 14 12:46:15 2019 +1000
Branches: master
https://developer.blender.org/rBAC068f829776a81671c1a59f751f742782386af367
addons contrib: bulk remove unmaintained i/o part 2
===================================================================
D io_export_marmalade.py
D io_export_md3.py
D io_import_lipSync_Importer.py
D io_mesh_raw/__init__.py
D io_mesh_raw/export_raw.py
D io_mesh_raw/import_raw.py
D io_points_pcd/__init__.py
D io_points_pcd/pcd_utils.py
D io_points_pcd/pcdparser.py
D io_points_pcd/test.pcd
D io_scene_map/__init__.py
D io_scene_map/export_map.py
D io_scene_ms3d/__init__.py
D io_scene_ms3d/ms3d_export.py
D io_scene_ms3d/ms3d_import.py
D io_scene_ms3d/ms3d_spec.py
D io_scene_ms3d/ms3d_strings.py
D io_scene_ms3d/ms3d_ui.py
D io_scene_ms3d/ms3d_utils.py
D io_scene_vrml2/__init__.py
D io_scene_vrml2/export_vrml2.py
===================================================================
diff --git a/io_export_marmalade.py b/io_export_marmalade.py
deleted file mode 100644
index 311e200c..00000000
--- a/io_export_marmalade.py
+++ /dev/null
@@ -1,1473 +0,0 @@
-# ***** GPL LICENSE BLOCK *****
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# All rights reserved.
-# ***** GPL LICENSE BLOCK *****
-
-# Marmalade SDK is not responsible in any case of the following code.
-# This Blender add-on is freely shared for the Blender and Marmalade user communities.
-
-
-bl_info = {
- "name": "Marmalade Cross-platform Apps (.group)",
- "author": "Benoit Muller",
- "version": (0, 6, 2),
- "blender": (2, 63, 0),
- "location": "File > Export > Marmalade cross-platform Apps (.group)",
- "description": "Export Marmalade Format files (.group)",
- "warning": "",
- "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/"
- "Scripts/Import-Export/Marmalade_Exporter",
- "tracker_url": "https://developer.blender.org/maniphest/task/edit/form/2/",
- "category": "Import-Export"}
-
-import os
-import shutil
-from math import radians
-
-import bpy
-from mathutils import Matrix
-
-import mathutils
-import math
-
-import datetime
-
-import subprocess
-
-
-#Container for the exporter settings
-class MarmaladeExporterSettings:
-
- def __init__(self,
- context,
- FilePath,
- CoordinateSystem=1,
- FlipNormals=False,
- ApplyModifiers=False,
- Scale=100,
- AnimFPS=30,
- ExportVertexColors=True,
- ExportMaterialColors=True,
- ExportTextures=True,
- CopyTextureFiles=True,
- ExportArmatures=False,
- ExportAnimationFrames=0,
- ExportAnimationActions=0,
- ExportMode=1,
- MergeModes=0,
- Verbose=False):
- self.context = context
- self.FilePath = FilePath
- self.CoordinateSystem = int(CoordinateSystem)
- self.FlipNormals = FlipNormals
- self.ApplyModifiers = ApplyModifiers
- self.Scale = Scale
- self.AnimFPS = AnimFPS
- self.ExportVertexColors = ExportVertexColors
- self.ExportMaterialColors = ExportMaterialColors
- self.ExportTextures = ExportTextures
- self.CopyTextureFiles = CopyTextureFiles
- self.ExportArmatures = ExportArmatures
- self.ExportAnimationFrames = int(ExportAnimationFrames)
- self.ExportAnimationActions = int(ExportAnimationActions)
- self.ExportMode = int(ExportMode)
- self.MergeModes = int(MergeModes)
- self.Verbose = Verbose
- self.WarningList = []
-
-
-def ExportMadeWithMarmaladeGroup(Config):
- print("----------\nExporting to {}".format(Config.FilePath))
- if Config.Verbose:
- print("Opening File...")
- Config.File = open(Config.FilePath, "w")
-
- if Config.Verbose:
- print("Done")
-
- if Config.Verbose:
- print("writing group header")
-
- Config.File.write('// Marmalade group file exported from : %s\n' % bpy.data.filepath)
- Config.File.write('// Exported %s\n' % str(datetime.datetime.now()))
- Config.File.write("CIwResGroup\n{\n\tname \"%s\"\n" % bpy.path.display_name_from_filepath(Config.FilePath))
-
- if Config.Verbose:
- print("Generating Object list for export... (Root parents only)")
- if Config.ExportMode == 1:
- Config.ExportList = [Object for Object in Config.context.scene.objects
- if Object.type in {'ARMATURE', 'EMPTY', 'MESH'}
- and Object.parent is None]
- else:
- ExportList = [Object for Object in Config.context.selected_objects
- if Object.type in {'ARMATURE', 'EMPTY', 'MESH'}]
- Config.ExportList = [Object for Object in ExportList
- if Object.parent not in ExportList]
- if Config.Verbose:
- print(" List: {}\nDone".format(Config.ExportList))
-
- if Config.Verbose:
- print("Setting up...")
-
- if Config.ExportAnimationFrames:
- if Config.Verbose:
- print(bpy.context.scene)
- print(bpy.context.scene.frame_current)
- CurrentFrame = bpy.context.scene.frame_current
- if Config.Verbose:
- print("Done")
-
- Config.ObjectList = []
- if Config.Verbose:
- print("Writing Objects...")
- WriteObjects(Config, Config.ExportList)
- if Config.Verbose:
- print("Done")
-
- if Config.Verbose:
- print("Objects Exported: {}".format(Config.ExportList))
-
- if Config.ExportAnimationFrames:
- if Config.Verbose:
- print("Writing Animation...")
- WriteKeyedAnimationSet(Config, bpy.context.scene)
- bpy.context.scene.frame_current = CurrentFrame
- if Config.Verbose:
- print("Done")
- Config.File.write("}\n")
- CloseFile(Config)
- print("Finished")
-
-
-def GetObjectChildren(Parent):
- return [Object for Object in Parent.children
- if Object.type in {'ARMATURE', 'EMPTY', 'MESH'}]
-
-
-#Returns the file path of first image texture from Material.
-def GetMaterialTextureFullPath(Config, Material):
- if Material:
- #Create a list of Textures that have type "IMAGE"
- ImageTextures = [Material.texture_slots[TextureSlot].texture for TextureSlot in Material.texture_slots.keys() if Material.texture_slots[TextureSlot].texture.type == "IMAGE"]
- #Refine a new list with only image textures that have a file source
- TexImages = [Texture.image for Texture in ImageTextures if getattr(Texture.image, "source", "") == "FILE"]
- ImageFiles = [Texture.image.filepath for Texture in ImageTextures if getattr(Texture.image, "source", "") == "FILE"]
- if TexImages:
- filepath = TexImages[0].filepath
- if TexImages[0].packed_file:
- TexImages[0].unpack()
- if not os.path.exists(filepath):
- #try relative path to the blend file
- filepath = os.path.dirname(bpy.data.filepath) + filepath
- #Marmalade doesn't like jpeg/tif so try to convert in png on the fly
- if (TexImages[0].file_format == 'JPEG' or TexImages[0].file_format == 'TIFF') and os.path.exists(filepath):
- marmaladeConvert = os.path.expandvars("%S3E_DIR%\\..\\tools\\ImageMagick\\win32\\convert.exe")
- if (os.path.exists(marmaladeConvert)):
- srcImagefilepath = filepath
- filepath = os.path.splitext(filepath)[0] + '.png'
- if Config.Verbose:
- print(" /!\\ Converting Texture %s in PNG: %s{}..." % (TexImages[0].file_format, filepath))
- print('"%s" "%s" "%s"' % (marmaladeConvert, srcImagefilepath, filepath))
- subprocess.call([marmaladeConvert, srcImagefilepath, filepath])
- return filepath
- return None
-
-
-def WriteObjects(Config, ObjectList, geoFile=None, mtlFile=None, GeoModel=None, bChildObjects=False):
- Config.ObjectList += ObjectList
-
- if bChildObjects == False and Config.MergeModes > 0:
- if geoFile == None:
- #we merge objects, so use name of group file for the name of Geo
- geoFile, mtlFile = CreateGeoMtlFiles(Config, bpy.path.display_name_from_filepath(Config.FilePath))
- GeoModel = CGeoModel(bpy.path.display_name_from_filepath(Config.FilePath))
-
- for Object in ObjectList:
- if Config.Verbose:
- print(" Writing Object: {}...".format(Object.name))
-
- if Config.ExportArmatures and Object.type == "ARMATURE":
- Armature = Object.data
- ParentList = [Bone for Bone in Armature.bones if Bone.parent is None]
- if Config.Verbose:
- print(" Writing Armature Bones...")
- #Create the skel file
- skelfullname = os.path.dirname(Config.FilePath) + os.sep + "models" + os.sep + "%s.skel" % (StripName(Object.name))
- ensure_dir(skelfullname)
- if Config.Verbose:
- print(" Creating skel file %s" % (skelfullname))
-
- skelFile = open(skelfullname, "w")
- skelFile.write('// skel file exported from : %r\n' % os.path.basename(bpy.data.filepath))
- skelFile.write("CIwAnimSkel\n")
- skelFile.write("{\n")
- skelFile.write("\tnumBones %d\n" % (len(Armature.bones)))
- Config.File.write("\t\".\models\%s.skel\"\n" % (StripName(Object.name)))
-
- WriteArmatureParentRootBones(Config, Object, ParentList, skelFile)
-
- skelFile.write("}\n")
- skelFile.close()
- if Config.Verbose:
- print(" Done")
-
- ChildList = GetObjectChildren(Object)
- if Config.ExportMode == 2: # Selected Objects Only
- ChildList = [Child for Child in ChildList
- if Child in Config.context.selected_objects]
- if Config.Verbose:
- print(" Writing Children...")
- WriteObjects(Config, ChildList, geoFile, mtlFile, GeoModel, True)
- if Config.Verbose:
- print(" Done Writing Children")
-
- if Object.type == "MESH":
- if Config.Verbose:
- print(" Generating Mesh...")
- if Config.ApplyModifiers:
- if Config.ExportArmatures:
- #Create a copy of the object and remove all armature modifiers so an unshape
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list