+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
- RaiseWarning(string.Format("Mipmaps chain is not complete: {0} maps instead of {1} (based on texture max size: {2})", mipmapsCount, expected, width), 2);
- RaiseWarning(string.Format("You must generate a complete mipmaps chain for .dds)"), 2);
- RaiseWarning(string.Format("Mipmaps will be disabled for this texture. If you want automatic texture generation you cannot use a .dds)"), 2);
- }
-
- bool isCube = (intArray[28] & 0x200) == 0x200;
-
- return isCube;
- }
- catch
- {
- return false;
- }
- }
-
- private BabylonTexture ExportTexture(IStdMat2 stdMat, int index, out BabylonFresnelParameters fresnelParameters, BabylonScene babylonScene, bool allowCube = false, bool forceAlpha = false)
- {
- fresnelParameters = null;
-
- if (!stdMat.MapEnabled(index))
- {
- return null;
- }
- var babylonTexture = new BabylonTexture();
-
- var texMap = stdMat.GetSubTexmap(index);
-
- if (texMap == null)
- {
- RaiseWarning("Texture channel " + index + " activated but no texture found.");
- return null;
- }
-
- // Fallout
- if (texMap.ClassName == "Falloff") // This is the only way I found to detect it. This is crappy but it works
- {
- fresnelParameters = new BabylonFresnelParameters();
+ RaiseWarning(string.Format("Mipmaps chain is not complete: {0} maps instead of {1} (based on texture max size: {2})", mipmapsCount, expected, width), 2);
+ RaiseWarning(string.Format("You must generate a complete mipmaps chain for .dds)"), 2);
+ RaiseWarning(string.Format("Mipmaps will be disabled for this texture. If you want automatic texture generation you cannot use a .dds)"), 2);
+ }
+
+ bool isCube = (intArray[28] & 0x200) == 0x200;
+
+ return isCube;
+ }
+ catch
+ {
+ return false;
+ }
+ }
+
+ private BabylonTexture ExportTexture(IStdMat2 stdMat, int index, out BabylonFresnelParameters fresnelParameters, BabylonScene babylonScene, bool allowCube = false, bool forceAlpha = false)
+ {
+ fresnelParameters = null;
+
+ if (!stdMat.MapEnabled(index))
+ {
+ return null;
+ }
+ var babylonTexture = new BabylonTexture();
+
+ var texMap = stdMat.GetSubTexmap(index);
+
+ if (texMap == null)
+ {
+ RaiseWarning("Texture channel " + index + " activated but no texture found.");
+ return null;
+ }
+
+ // Fallout
+ if (texMap.ClassName == "Falloff") // This is the only way I found to detect it. This is crappy but it works
+ {
+ fresnelParameters = new BabylonFresnelParameters();
- this.ActionsBuilderWebView.Size = new System.Drawing.Size(723, 537);
- this.ActionsBuilderWebView.TabIndex = 0;
- this.ActionsBuilderWebView.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.ActionsBuilderWebView_DocumentCompleted);
+ this.ActionsBuilderWebView.Size = new System.Drawing.Size(723, 537);
+ this.ActionsBuilderWebView.TabIndex = 0;
+ this.ActionsBuilderWebView.DocumentCompleted += new System.Windows.Forms.WebBrowserDocumentCompletedEventHandler(this.ActionsBuilderWebView_DocumentCompleted);
The [Blender export plugin](http://blogs.msdn.com/b/eternalcoding/archive/2013/06/28/babylon-js-how-to-load-a-babylon-file-produced-with-blender.aspx) supports the following features:
-For a discussion of Tower of Babel exporter, along with the difference this exporter, [See]{https://github.com/BabylonJS/Extensions/tree/master/TowerOfBabel)
+For a discussion of Tower of Babel exporter, along with the difference this exporter, see [ToB readme](https://github.com/BabylonJS/Extensions/tree/master/QueuedInterpolation/Blender).
+
* **Cameras**
* Name
* Position
@@ -14,7 +15,7 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
* Check collisions
* Gravity
* Ellipsoid
- * Animations
+ * Actions exported as AnimationRanges
* 3D Camera Rigs
* All kind of Babylon.js cameras can be chosen from a custom dropdown list
* **Lights**
@@ -27,8 +28,9 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
* Energy
* Diffuse color
* Specular color
+ * Include only meshes in same Blender layer
* Shadow maps, all types (For directional lights)
- * Animations
+ * Actions exported as AnimationRanges
* **Materials**
* Name
* Name space
@@ -48,6 +50,7 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
* Procedural Texture Baking
* Cycles Render Baking
* Check Ready Only Once
+ * Maximum Simultaneous Lights
* **Multi-materials**
* Name
* Child materials
@@ -77,9 +80,9 @@ For a discussion of Tower of Babel exporter, along with the difference this expo
+ image_settings.color_mode = 'RGBA' if recipe.usePNG else 'RGB'
+ image_settings.quality = recipe.bakeQuality # for lossy compression formats
+ image_settings.compression = recipe.bakeQuality # Amount of time to determine best compression: 0 = no compression with fast file output, 100 = maximum lossless compression with slow file output
+
+ # now go thru all the textures that need to be baked
+ if recipe.diffuseBaking:
+ cycles_type = 'DIFFUSE_COLOR' if bVersion <= 2.76 else 'DIFFUSE'
+ self.rotation = scale_vector(Vector((0, 0, 0)), 1) # isn't scaling 0's by 1 same as 0?
+ self.scaling = Vector((1, 1, 1))
+
+ # ensure no unapplied rotation or scale, when there is an armature
+ self.hasUnappliedTransforms = (self.scaling.x != 1 or self.scaling.y != 1 or self.scaling.z != 1 or
+ (hasattr(self, 'rotation' ) and (self.rotation .x != 0 or self.rotation .y != 0 or self.rotation .z != 0)) or
+ (hasattr(self, 'rotationQuaternion') and (self.rotationQuaternion.x != 0 or self.rotationQuaternion.y != 0 or self.rotationQuaternion.z != 0 or self.rotationQuaternion.w != 1))
+ )
+
+ # determine parent & dataName
+ if forcedParent is None:
+ self.dataName = object.data.name # used to support shared vertex instances in later passed
+ if object.parent and object.parent.type != 'ARMATURE':
+ self.parentId = object.parent.name
+ else:
+ self.dataName = self.name
+ self.parentId = forcedParent.name
+
+ # Get if this will be an instance of another, before processing materials, to avoid multi-bakes