diff --git a/Assets/Plugins.meta b/Assets/Plugins.meta new file mode 100644 index 0000000..0a2f44d --- /dev/null +++ b/Assets/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9b5678f8652281242a629c7d5eb2a212 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/BlenderImporter.meta b/Assets/Plugins/BlenderImporter.meta new file mode 100644 index 0000000..5de1dbb --- /dev/null +++ b/Assets/Plugins/BlenderImporter.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6eb3ee5bb49580c4f9ab3c9592ed9dc7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/BlenderImporter/Demo.meta b/Assets/Plugins/BlenderImporter/Demo.meta new file mode 100644 index 0000000..c33a627 --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Demo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b93b485e04d5c604faf01e3872809e3a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/BlenderImporter/Demo/Demo.unity b/Assets/Plugins/BlenderImporter/Demo/Demo.unity new file mode 100644 index 0000000..8f16be4 --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Demo/Demo.unity @@ -0,0 +1,420 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &263510931 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 263510934} + - component: {fileID: 263510933} + - component: {fileID: 263510932} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &263510932 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 263510931} + m_Enabled: 1 +--- !u!20 &263510933 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 263510931} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 1.33 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &263510934 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 263510931} + m_LocalRotation: {x: 0.14952636, y: 0.8504356, z: -0.35226196, w: 0.3609886} + m_LocalPosition: {x: -2.36, y: 3.19, z: 2.2670066} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 45, y: 134, z: 0} +--- !u!1 &690316332 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 690316333} + m_Layer: 0 + m_Name: Origin + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &690316333 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 690316332} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &831492742 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -927199367670048503, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_Name + value: xyz + objectReference: {fileID: 0} + - target: {fileID: -8684251187902555887, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -4216859302048453862, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -2911857058776738603, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: -2911857058776738603, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0.5629765 + objectReference: {fileID: 0} + - target: {fileID: -2911857058776738603, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6234474985816639746, guid: e7a567351d54f92469ae28e37ef34e7b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0.5594692 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: e7a567351d54f92469ae28e37ef34e7b, type: 3} +--- !u!1 &2061143066 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2061143068} + - component: {fileID: 2061143067} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &2061143067 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2061143066} + m_Enabled: 1 + serializedVersion: 9 + m_Type: 1 + m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} + m_Intensity: 1 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 0 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 6570 + m_UseColorTemperature: 0 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &2061143068 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2061143066} + m_LocalRotation: {x: 0.42191747, y: -0.05217068, z: 0.024327585, w: 0.904805} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 50, y: -6.6, z: 0} diff --git a/Assets/Plugins/BlenderImporter/Demo/Demo.unity.meta b/Assets/Plugins/BlenderImporter/Demo/Demo.unity.meta new file mode 100644 index 0000000..5f4b0ac --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Demo/Demo.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a3727f889ba51d444be12700e67cc620 +DefaultImporter: + externalObjects: {} + userData: '' + assetBundleName: '' + assetBundleVariant: '' diff --git a/Assets/Plugins/BlenderImporter/Demo/xyz.blend b/Assets/Plugins/BlenderImporter/Demo/xyz.blend new file mode 100644 index 0000000..bbf19b4 Binary files /dev/null and b/Assets/Plugins/BlenderImporter/Demo/xyz.blend differ diff --git a/Assets/Plugins/BlenderImporter/Demo/xyz.blend.meta b/Assets/Plugins/BlenderImporter/Demo/xyz.blend.meta new file mode 100644 index 0000000..2f72a46 --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Demo/xyz.blend.meta @@ -0,0 +1,95 @@ +fileFormatVersion: 2 +guid: e7a567351d54f92469ae28e37ef34e7b +ModelImporter: + serializedVersion: 26 + internalIDToNameTable: [] + externalObjects: {} + materials: + importMaterials: 1 + materialName: 0 + materialSearch: 1 + materialLocation: 1 + animations: + legacyGenerateAnimations: 4 + bakeSimulation: 0 + resampleCurves: 1 + optimizeGameObjects: 0 + motionNodeName: '' + rigImportErrors: '' + rigImportWarnings: '' + animationImportErrors: '' + animationImportWarnings: '' + animationRetargetingWarnings: '' + animationDoRetargetingWarnings: 0 + importAnimatedCustomProperties: 0 + importConstraints: 0 + animationCompression: 1 + animationRotationError: 0.5 + animationPositionError: 0.5 + animationScaleError: 0.5 + animationWrapMode: 0 + extraExposedTransformPaths: [] + extraUserProperties: [] + clipAnimations: [] + isReadable: 0 + meshes: + lODScreenPercentages: [] + globalScale: 1 + meshCompression: 0 + addColliders: 0 + useSRGBMaterialColor: 1 + sortHierarchyByName: 1 + importVisibility: 1 + importBlendShapes: 1 + importCameras: 1 + importLights: 1 + swapUVChannels: 0 + generateSecondaryUV: 0 + useFileUnits: 1 + keepQuads: 0 + weldVertices: 0 + preserveHierarchy: 0 + skinWeightsMode: 0 + maxBonesPerVertex: 4 + minBoneWeight: 0.001 + meshOptimizationFlags: -1 + indexFormat: 0 + secondaryUVAngleDistortion: 8 + secondaryUVAreaDistortion: 15.000001 + secondaryUVHardAngle: 88 + secondaryUVPackMargin: 4 + useFileScale: 1 + tangentSpace: + normalSmoothAngle: 60 + normalImportMode: 0 + tangentImportMode: 3 + normalCalculationMode: 4 + legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0 + blendShapeNormalImportMode: 1 + normalSmoothingSource: 0 + referencedClips: [] + importAnimation: 1 + copyAvatar: 0 + humanDescription: + serializedVersion: 3 + human: [] + skeleton: [] + armTwist: 0.5 + foreArmTwist: 0.5 + upperLegTwist: 0.5 + legTwist: 0.5 + armStretch: 0.05 + legStretch: 0.05 + feetSpacing: 0 + globalScale: 1 + rootMotionBoneName: '' + hasTranslationDoF: 0 + hasExtraRoot: 0 + skeletonHasParents: 1 + lastHumanDescriptionAvatarSource: {instanceID: 0} + animationType: 0 + humanoidOversampling: 1 + additionalBone: 0 + userData: '' + assetBundleName: '' + assetBundleVariant: '' diff --git a/Assets/Plugins/BlenderImporter/Editor.meta b/Assets/Plugins/BlenderImporter/Editor.meta new file mode 100644 index 0000000..2f896f3 --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ba7d785b0be823648be0a01eede4a941 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Plugins/BlenderImporter/Editor/BlenderImporter.cs b/Assets/Plugins/BlenderImporter/Editor/BlenderImporter.cs new file mode 100644 index 0000000..636d6e8 --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Editor/BlenderImporter.cs @@ -0,0 +1,63 @@ +using UnityEngine; +using UnityEditor; +using System.Collections.Generic; +namespace Ogxd { + + public class BlenderImporter : AssetPostprocessor { + + void OnPostprocessModel(GameObject gameObject) { + + if (!assetPath.EndsWith(".blend")) + return; + + gameObject.transform.localScale = Vector3.one; + List gameObjects = gameObject.GetChildrenRecursive(); + gameObjects.Add(gameObject); + + foreach (GameObject current in gameObjects) { + if (current == gameObject) + current.transform.rotation = Quaternion.identity; + else + current.transform.Rotate(Vector3.right, 90); + Vector3 localPosition = current.transform.localPosition; + current.transform.localPosition = new Vector3(-localPosition.x, localPosition.y, -localPosition.z); + } + + MeshFilter[] meshFilters = gameObject.GetComponentsInChildren(); + HashSet meshes = new HashSet(); + for (int mf = 0; mf < meshFilters.Length; mf++) { + meshes.Add(meshFilters[mf].sharedMesh); + } + + foreach (Mesh mesh in meshes) { + processMesh(mesh); + } + } + + private void processMesh(Mesh mesh) { + + if (!mesh) + return; + + Vector3[] vertices = mesh.vertices; + for (int i = 0; i < vertices.Length; i++) { + vertices[i] = new Vector3(-vertices[i].x, vertices[i].z, vertices[i].y); + } + mesh.vertices = vertices; + + Vector3[] normals = mesh.normals; + for (int i = 0; i < normals.Length; i++) { + normals[i] = new Vector3(-normals[i].x, normals[i].z, normals[i].y); + } + mesh.normals = normals; + + Vector4[] tangents = mesh.tangents; + for (int i = 0; i < tangents.Length; i++) { + tangents[i] = new Vector4(-tangents[i].x, tangents[i].z, tangents[i].y, tangents[i].w); + } + mesh.tangents = tangents; + + mesh.RecalculateBounds(); + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/BlenderImporter/Editor/BlenderImporter.cs.meta b/Assets/Plugins/BlenderImporter/Editor/BlenderImporter.cs.meta new file mode 100644 index 0000000..46dfc85 --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Editor/BlenderImporter.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70db60406974cab4592ad054fed4af81 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: '' + assetBundleName: '' + assetBundleVariant: '' diff --git a/Assets/Plugins/BlenderImporter/Editor/Extensions.cs b/Assets/Plugins/BlenderImporter/Editor/Extensions.cs new file mode 100644 index 0000000..7b9b5ba --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Editor/Extensions.cs @@ -0,0 +1,38 @@ +using System.Collections.Generic; +using UnityEngine; + +namespace Ogxd { + + public static class Extensions { + + public static Mesh GetMesh(this GameObject gameObject) { + MeshFilter meshFilter = gameObject.GetComponent(); + if (meshFilter) + return meshFilter.sharedMesh; + else + return null; + } + + public static Material[] GetMaterials(this GameObject gameObject) { + Renderer renderer = gameObject.GetComponent(); + if (renderer) + return renderer.sharedMaterials; + else + return new Material[0]; + } + + public static List GetChildrenRecursive(this GameObject gameObject) { + List gameObjects = new List(); + Queue queue = new Queue(); + queue.Enqueue(gameObject); + while (queue.Count != 0) { + GameObject current = queue.Dequeue(); + foreach (Transform transform in current.transform) { + queue.Enqueue(transform.gameObject); + gameObjects.Add(transform.gameObject); + } + } + return gameObjects; + } + } +} \ No newline at end of file diff --git a/Assets/Plugins/BlenderImporter/Editor/Extensions.cs.meta b/Assets/Plugins/BlenderImporter/Editor/Extensions.cs.meta new file mode 100644 index 0000000..2dc3eaa --- /dev/null +++ b/Assets/Plugins/BlenderImporter/Editor/Extensions.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 897840e52e815104fa786d005507f1eb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: '' + assetBundleName: '' + assetBundleVariant: '' diff --git a/Packages/manifest.json b/Packages/manifest.json index 7f93ce5..ddf2021 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -6,6 +6,7 @@ "com.unity.ide.rider": "3.0.17", "com.unity.ide.visualstudio": "2.0.17", "com.unity.ide.vscode": "1.2.5", + "com.unity.probuilder": "5.0.6", "com.unity.test-framework": "1.1.33", "com.unity.textmeshpro": "3.0.6", "com.unity.timeline": "1.6.4", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 8ee27b0..8586c58 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -83,6 +83,17 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.probuilder": { + "version": "5.0.6", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.settings-manager": "1.0.3", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.imgui": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.services.core": { "version": "1.6.0", "depth": 1, @@ -96,7 +107,7 @@ }, "com.unity.settings-manager": { "version": "1.0.3", - "depth": 2, + "depth": 1, "source": "registry", "dependencies": {}, "url": "https://packages.unity.com" diff --git a/ProjectSettings/Packages/com.unity.probuilder/Settings.json b/ProjectSettings/Packages/com.unity.probuilder/Settings.json new file mode 100644 index 0000000..31b2ce2 --- /dev/null +++ b/ProjectSettings/Packages/com.unity.probuilder/Settings.json @@ -0,0 +1,33 @@ +{ + "m_Name": "Settings", + "m_Path": "ProjectSettings/Packages/com.unity.probuilder/Settings.json", + "m_Dictionary": { + "m_DictionaryValues": [ + { + "type": "UnityEngine.ProBuilder.LogLevel, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "log.level", + "value": "{\"m_Value\":3}" + }, + { + "type": "UnityEngine.ProBuilder.LogOutput, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "log.output", + "value": "{\"m_Value\":1}" + }, + { + "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", + "key": "log.path", + "value": "{\"m_Value\":\"ProBuilderLog.txt\"}" + }, + { + "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "about.identifier", + "value": "{\"m_Value\":{\"m_Major\":5,\"m_Minor\":0,\"m_Patch\":6,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}" + }, + { + "type": "UnityEngine.ProBuilder.SemVer, Unity.ProBuilder, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", + "key": "preferences.version", + "value": "{\"m_Value\":{\"m_Major\":5,\"m_Minor\":0,\"m_Patch\":6,\"m_Build\":-1,\"m_Type\":\"\",\"m_Metadata\":\"\",\"m_Date\":\"\"}}" + } + ] + } +} \ No newline at end of file diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 4fd1d05..1796c36 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -269,7 +269,196 @@ PlayerSettings: AndroidValidateAppBundleSize: 1 AndroidAppBundleSizeToValidate: 150 m_BuildTargetIcons: [] - m_BuildTargetPlatformIcons: [] + m_BuildTargetPlatformIcons: + - m_BuildTarget: iPhone + m_Icons: + - m_Textures: [] + m_Width: 180 + m_Height: 180 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 0 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 167 + m_Height: 167 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 152 + m_Height: 152 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 76 + m_Height: 76 + m_Kind: 0 + m_SubKind: iPad + - m_Textures: [] + m_Width: 120 + m_Height: 120 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 80 + m_Height: 80 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 3 + m_SubKind: iPad + - m_Textures: [] + m_Width: 87 + m_Height: 87 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 58 + m_Height: 58 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 29 + m_Height: 29 + m_Kind: 1 + m_SubKind: iPad + - m_Textures: [] + m_Width: 60 + m_Height: 60 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPhone + - m_Textures: [] + m_Width: 40 + m_Height: 40 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 20 + m_Height: 20 + m_Kind: 2 + m_SubKind: iPad + - m_Textures: [] + m_Width: 1024 + m_Height: 1024 + m_Kind: 4 + m_SubKind: App Store + - m_BuildTarget: Android + m_Icons: + - m_Textures: [] + m_Width: 432 + m_Height: 432 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 324 + m_Height: 324 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 216 + m_Height: 216 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 162 + m_Height: 162 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 108 + m_Height: 108 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 81 + m_Height: 81 + m_Kind: 2 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 1 + m_SubKind: + - m_Textures: [] + m_Width: 192 + m_Height: 192 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 144 + m_Height: 144 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 96 + m_Height: 96 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 72 + m_Height: 72 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 48 + m_Height: 48 + m_Kind: 0 + m_SubKind: + - m_Textures: [] + m_Width: 36 + m_Height: 36 + m_Kind: 0 + m_SubKind: m_BuildTargetBatching: - m_BuildTarget: Standalone m_StaticBatching: 1