Git Product home page Git Product logo

unityexporter's Introduction

Babylon.js EditorToolkit for Unity3D

Please visit our main documentation site: http://doc.babylonjs.com/resources/intro

Note: The toolkit requires Unity 2020.1 or greater.

Newtonsoft Json.NET

Unity 2020.3 and greater now ship with Newtonsoft Json.NET. If your Unity project already includes Json.NET, you may get errors in the Unity Console due to duplicate function/class definitions. In most cases, removing the Babylon Toolkit copy of the of the Json folder (Assets/[Babylon]/Plugins/Json) should solve the issue.

unityexporter's People

Contributors

deltakosh avatar mackeyk24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unityexporter's Issues

Babylon Toolkit breaks glTF loader in the playground

BABYLON.SceneLoader.OnPluginActivatedObservable.add(function (loader) {
if (loader.name === "gltf") {
if (BABYLON.SceneManager.AnimationStartMode != null) {
(<any>loader).animationStartMode = BABYLON.SceneManager.AnimationStartMode;
}
if (BABYLON.SceneManager.ForceRightHanded != null && BABYLON.SceneManager.ForceRightHanded === true) {
(<any>loader).coordinateSystemMode = BABYLON.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED;
}
(<any>loader).dispose();
}
});

I'm not sure what is going on with this code, but disposing the loader is causing issues for us in the playground. What is the reason for the dispose?

cc @sebavan @deltakosh

Problem when exporting textures from Unity

Hello there,

So I have been using the unity exporter to babylon since this monday and this is working super fine, thank you for this amazing tool!

Except.. I have a texture issue.

screen1

So this is pretty much how this is supposed to look like (or kindof)

But this is what I get as an output :

screen2

Do you guys have any idea, did I do something wrong ? :(

Thank you very much in advance!

[Unity] Secondary texture not exported

Unity's secondary albedo texture is not used, but can very easily be used to tile the texture.
Unity merges the secondary texture, but I see no advantage for that in BabylonJS.

We would be better off by taking the secondary albedo texture as primary once given and by using the uScale and vScale on the material in the scene to map the tiling X and Y from Unity. This way the designer does not have to attach a Mesh Component, EditorScriptComponent to the component and dive into the owner.material and adjust it just for 1 simple property.

[HowTo] Augmented reality feature

Hello! I'm not sure about the best place to ask such a question.

If there any info/documentation about implementing WebAR via Unity? I've found a component called "Universal Camera System" and there you can change main camera type to "Augmented reality". When I run this project on my mobile device I can see camera feed, but the 3D object is not acting like "augmented" one, it moves with the camera.

Honestly, I'm not a web developer guy, I'm experienced only in Unity, so I can't figure it all out by myself :(

error TS2430: Interface 'Document' incorrectly extends interface 'FontFaceSource'.

../../AppData/Roaming/npm/node_modules/typescript/lib/lib.dom.d.ts(4227,11):` error TS2430: Interface 'Document' incorrectly extends interface 'FontFaceSource'.
The types of 'fonts.forEach' are incompatible between these types.
Type '(callbackfn: (value: FontFace, value2: FontFace, set: Set) => void, thisArg?: any) => void' is not assignable to type '(callbackfn: (value: FontFace, key: FontFace, parent: FontFaceSet) => void, thisArg?: any) => void'.
Types of parameters 'callbackfn' and 'callbackfn' are incompatible.
Types of parameters 'parent' and 'set' are incompatible.
Type 'Set' is missing the following properties from type 'FontFaceSet': onloading, onloadingdone, onloadingerror, ready, and 6 more.
../../AppData/Roaming/npm/node_modules/typescript/lib/lib.dom.d.ts(5223,11): error TS2300: Duplicate identifier 'FontFace'.
../../AppData/Roaming/npm/node_modules/typescript/lib/lib.dom.d.ts(5241,13): error TS2300: Duplicate identifier 'FontFace'.
../../AppData/Roaming/npm/node_modules/typescript/lib/lib.dom.d.ts(5272,11): error TS2300: Duplicate identifier 'FontFaceSetLoadEvent'.
../../AppData/Roaming/npm/node_modules/typescript/lib/lib.dom.d.ts(5276,13): error TS2300: Duplicate identifier 'FontFaceSetLoadEvent'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(28991,81): error TS2304: Cannot find name 'OffscreenCanvas'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(38573,162): error TS2304: Cannot find name 'OffscreenCanvas'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(39014,54): error TS2304: Cannot find name 'OffscreenCanvas'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(39016,62): error TS2304: Cannot find name 'OffscreenCanvasRenderingContext2D'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(39107,67): error TS2304: Cannot find name 'OffscreenCanvas'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(40361,54): error TS2304: Cannot find name 'OffscreenCanvas'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(40363,62): error TS2304: Cannot find name 'OffscreenCanvasRenderingContext2D'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(41610,67): error TS2304: Cannot find name 'OffscreenCanvas'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(84365,16): error TS2304: Cannot find name 'MSGesture'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(84407,78): error TS2304: Cannot find name 'NavigatorUserMediaSuccessCallback'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(84407,128): error TS2304: Cannot find name 'NavigatorUserMediaErrorCallback'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(84408,75): error TS2304: Cannot find name 'NavigatorUserMediaSuccessCallback'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(84408,125): error TS2304: Cannot find name 'NavigatorUserMediaErrorCallback'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(84409,74): error TS2304: Cannot find name 'NavigatorUserMediaSuccessCallback'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(84409,124): error TS2304: Cannot find name 'NavigatorUserMediaErrorCallback'.
Assets/[Babylon]/Template/Typings/fonts.d.ts(47,11): error TS2300: Duplicate identifier 'FontFace'.
Assets/[Babylon]/Template/Typings/fonts.d.ts(64,11): error TS2300: Duplicate identifier 'FontFaceSetLoadEvent'.

System.UnityTools:CompileProjectScriptBundle (System.IO.StreamWriter,string,string,string,string,bool,string)
CanvasTools.CanvasToolsExporter:ExportProject (string,EditorSceneInformation,EditorBuildType,UnityEngine.Transform[],string,string)
CanvasTools.CanvasToolsExporter:BuildProject (EditorBuildType,UnityEngine.Transform[],string,string)
CanvasTools.CVPanel:OnGUI ()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


Getting the following error when trying to Compile Script. It's a newly created Unity project and I just installed both NPM and Typescript from NPM. Not sure what I'm doing wrong?

I'm on Windows if that makes any difference..

Any help is appreciated. Thanks!

XR Rig / XR Interaction Toolkit

Hi,

Thanks for the work being done on this. I'm having some issues and some documentation seems unavailable now.

My scene renders fine in the browser, however there is no enter VR mode button appearing? I'm using the XR Rig from the XR Interaction toolkit, is this supported, or am I missing some additional configurations to make this work?

Looped animation glitches when used in a blend tree

This applies to animations being used in a Unity Animator Controller.

Please see attached examples:
glitch_example_files.zip

walk_normal.mp4:
Animation works as expected when used in a normal animation state.

walk_glitch.mp4:
The animation glitches on loop when used in a simple blend tree. The blend tree in question here uses 4 animations, all of which glitch in the same way, at the end of their respective loops (they have varrying lengths).

animation_state.jpg:
Shows the settings of the Animation State component.

animator.jpg:
The setup of the Animator Controller. Just a simple blend tree node as default starting point.

blend_tree.jpg
The setup of the blend tree.

Export Custom Shader

Hello, from the documentation is not very clear on how to have working exported custom shaders.

Imagine I have this simple shader that allows me to give gradient colors to my skybox:

Shader "GradientSkybox/Circular/Two Color" {
	Properties {
		_InnerColor ("Inner Color", Color) = (0.8, 0.8, 0.8, 0)
		_OuterColor ("Outer Color", Color) = (0.5, 0.5, 0.5, 0)
		[KeywordEnum(None, X, Y)] _Norm ("Normalization", Float) = 0
	}
	SubShader {
		Tags {
			"RenderType" = "Background"
			"Queue" = "Background"
			"PreviewType" = "Skybox"
		}
		Pass {
			ZWrite Off
			Cull Off

			CGPROGRAM

			#pragma vertex vert
			#pragma fragment frag
			#pragma multi_compile _NORM_NONE _NORM_X _NORM_Y

			fixed3 _InnerColor, _OuterColor;

			struct appdata {
				float4 vertex : POSITION;
			};

			struct v2f {
				float4 vertex : SV_POSITION;
			};

			v2f vert (appdata v) {
				v2f o;
				o.vertex = UnityObjectToClipPos(v.vertex);
				return o;
			}

			fixed4 frag (v2f i) : SV_TARGET {
				#if _NORM_X
					float2 uv = (i.vertex.xy / _ScreenParams.x - _ScreenParams.xy / _ScreenParams.x * 0.5) * 2;
				#elif _NORM_Y
					float2 uv = (i.vertex.xy / _ScreenParams.y - _ScreenParams.xy / _ScreenParams.y * 0.5) * 2;
				#else
					float2 uv = (i.vertex.xy / _ScreenParams.xy - 0.5) * 2;
				#endif
				return fixed4(lerp(_InnerColor, _OuterColor, length(uv)), 1);
			}

			ENDCG
		}
	}
	CustomEditor "GradientSkybox.CircularTwoColorGradientSkyboxGUI"
}

How would I write this in Unity/Babylon way to have it working during export?

"XMLHttpRequestBodyInit" and "VRFrameData" errors

I'm using Unity 2021.2.1f1 and Babylon Toolkit: V5.0.0-A48.3X9

I get this error message when trying to compile the script:

Assets/[Babylon]/Template/Typings/babylon.d.ts(566,32): error TS2304: Cannot find name 'XMLHttpRequestBodyInit'.
Assets/[Babylon]/Template/Typings/babylon.d.ts(90425,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'VRFrameData' must be of type '{ new (): VRFrameData; prototype: VRFrameData; }', but here has type 'any'.

How do I get around this?

toolbar is not imported

Unity2021.1.9

First i got an error with "Newtonsoft.Jsondll", and i delete this the error disappear but the toolbar is not imported.

Where to go to get started or updated documentation?

So I'm going through the documentation linked in the Readme and finding it pretty out of date..

Is there any more current resource available or any other way to learn how to get going?

I'm having trouble:

  1. figuring out how to apply physics, I read that readme as well and it says to build Ammo using cmake? Is that still what's required?
  2. figuring out how to either access my Unity C# character controller or do I have to create a separate TS file basically handling all the character control stuff and making the Unity CC irrelevant?
  3. I've seen elsewhere that blend trees aren't supported in the animator, could that be why my character controller isn't working?
  4. I see in past posts here and on the Babylon.js forum that you mention using the "Pro" version of this tool but I cannot for the life of me find any info of how to use the files included in the PRO folder. Is the pro thing still a thing and if so how do we use?
  5. The Getting Started video link is a 404 link now, is there any updated video or any more recent videos showing anything?

This seems like a great tool but without a way to learn how to use the most current version supported it leaves the best alternative seemingly to just setup the stuff in Unity and then use GLTFexport to export the assets and then just write all the game logic and player control stuff in Typescript/Babylonjs/Ammo etc and build the scene from scratch using the exported assets?

Any info would be great and sorry if this isn't the place to be asking!

Lighting artefacts after build

Hello,

I created a brand new Unity Project 2021.1.24f1, installed the Babylon Plugin, switched to linear color, added the scene manager, and simply exported.

For some reason, the exported project generates some weird lighting artifacts which shouldn't be there (see screenshot)

image

Any idea?

Thanks

FileNotFound Exceptions while Exporting

Once clicking Build and Preview, I am getting three FileNotFound Exceptions for .hdr-Files. The project itself is working, but I am concerned that these Exceptions might pose a problem in the future.
Console

how to identity the right version with unity?

hi, first of all ,it's great job !
but how to identity the right version with unity? Unity has many different versions ,like unity5 and unity 2017 and unity2018 ...etc, and this babylonsjs unityexporter also has many unitypackage versions, how to match them?
thanks

Get object mesh and material at runtime

I've got a simple unity scene with a single quad on which a texture is applied and I'm trying to access this material in my controller to change main texture offset at runtime. My problem is that I'm not sure how to get a reference to this material.

Calling the material property on the meshes returned from getAbstractMesh and getTransformMesh returns a collider material, while getInstancedMesh does not seem to have a material attached.

I have managed to get a reference to the material I'm interested in by getting the material by name in the scene.materials list and then applying the offset as I wanted to do, but I'd like to know if there is a better solution that I've missed.

MissingMethodException: Method not found: UnityEngine.Cubemap UnityEngine.RenderSettings.get_customReflection()

Greetings,

I'm using Unity 2021.2.1f1 and Babylon Toolkit: V5.0.0-A48.6X9

When try to Export Scene I get the following issue, and get stuck on Importing assets:

MissingMethodException: Method not found: UnityEngine.Cubemap UnityEngine.RenderSettings.get_customReflection()
CanvasTools.CanvasToolsExporter.OnExportScene (SceneExporterTool exporter, System.String name, UnityEngine.Transform[] rootObjTransforms) (at :0)

Could not make custom scripts work in the actual export

Hi there,
I just installed the Toolkit (version V5.0.0-A63.1X) on Unity 2021.1.6f1 and I started to play with it.
If I don't add any custom scripts and I use only the default ones (like Default Scene Controller), everything compiles, exports, and works correctly even in the Web Preview.

When I start using any additional script (including the ones from the Starter Content) then the Web Preview get stuck during loading screen with the following message in the console log:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'AlleySceneController')
at Function.n.InstantiateClass (babylon.manager.js:5)
at babylon.manager.js:7
at Array.forEach ()
at Function.n.DoProcessPendingScripts (babylon.manager.js:7)
at n.postProcessSceneComponents (babylon.manager.js:7)
at Function.n.PostParseSceneComponents (babylon.manager.js:5)
at e.startParsing (babylon.manager.js:7)
at e.onComplete (babylon.manager.js:7)
at r.callback (babylon.manager.js:7)
at e.notifyObservers (babylon.min.js:16)

If for example I use the UniversalCameraSystem script what I'm getting is "Cannot read properties of undefined (reading 'UniversalCameraSystem').
If I check in the Export folder, I don't find anywhere any reference to the scripts I'm creating or the UniversalCameraSystem itself.

Could you give me some advice for this? Seems like it's not actually compiling every script other then the default ones.
Thank you!

Unity Exporter; Wrong direction of babylon's `Spot light`

Exporter: Unity - Version 4.0.0 - Alpha 10

When Spot light is used in the parent and its parent get transform - an exported direction is wrong.

Unity scene and right light direction (pink arrows):
capture1

Exported scene:
capture2

I think problem is in Babylon/Sources/SceneBuilder.Light.cs

var direction = new Vector3(0, 0, 1);
var transformedDirection = light.transform.TransformDirection(direction);
babylonLight.direction = transformedDirection.ToFloat();

I changed it to:

var direction = light.transform.forward;
var transformedDirection = light.transform.InverseTransformDirection(direction);            
babylonLight.direction = transformedDirection.ToFloat();

and it seems to be working fine:

capture3

I can't check it for 100%, because the Inspector doesn't show me the orientation of light.

Material not rendering

Hey there!
Sorry for disturbing again but I feel stuck trying to preview my simple scene with rather basic material and shaders. I've added a basic terrain and material, like in the picture below.

image

However, when I preview the scene, the material doesn't seem to render...
image

I'm using a rather simple texture and using a standard shader in Unity. I've tried to use both Unity's and Babylon's standard shader but it doesn't seem to make any difference...

I've tried to look through the documentation regarding shader materials but it doesn't really help. Any thoughts?

Thank you!

Assets/Babylon/Sources/Editors/LightScale.cs(17,37): error CS0122: `UnityEditor.LightEditor' is inaccessible due to its protection level

Everytime I import, this is the error I get.

Assets/Babylon/Sources/Editors/LightScale.cs(17,37): error CS0122: `UnityEditor.LightEditor' is inaccessible due to its protection level

Assets/Babylon/Sources/Editors/LightScale.cs(19,30): error CS0115: `UnityEditor.LightScaleEditor.OnInspectorGUI()' is marked as an override but no suitable method found to override

It doesn't load the toolbar at the top of the unity editor.

I am using Windows 10, Unity 5.63p2 Personal(64 bit)

UniversalCameraSystem

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'UniversalCameraSystem')
at Function.n.InstantiateClass (babylon.manager.js:5)
at babylon.manager.js:7
at Array.forEach ()
at Function.n.DoProcessPendingScripts (babylon.manager.js:7)
at n.postProcessSceneComponents (babylon.manager.js:7)
at Function.n.PostParseSceneComponents (babylon.manager.js:5)
at e.startParsing (babylon.manager.js:7)
at e.onComplete (babylon.manager.js:7)
at r.callback (babylon.manager.js:7)
at e.notifyObservers (babylon.min.js:16)

Unable to build project with Preview Engine enabled

Hello,
when I enable Preview Engine = "Babylon scene manager" I get this error:

ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
System.String.Substring (System.Int32 startIndex, System.Int32 length) (at <9577ac7a62ef43179789031239ba8798>:0)
System.UnityTools.GenerateProjectPreviewFiles (System.String bundle, System.String project, System.String scenePath, System.String sceneFilename, System.String scriptPath, System.Boolean antialias, System.Boolean adaptive, System.String splash, System.String text, System.String ring, System.String spin, System.String datax, System.Boolean close, System.Int32 timeout) (at <375023dbfad14c85a9472215a019acc6>:0)
CanvasTools.CanvasToolsExporter.ExportProject (System.String project, EditorSceneInformation info, EditorBuildType mode, UnityEngine.Transform[] selection, System.String filename, System.String folder) (at <375023dbfad14c85a9472215a019acc6>:0)
CanvasTools.CanvasToolsExporter.BuildProject (EditorBuildType mode, UnityEngine.Transform[] selection, System.String filename, System.String folder) (at <375023dbfad14c85a9472215a019acc6>:0)
CanvasTools.CVPanel.OnGUI () (at <375023dbfad14c85a9472215a019acc6>:0)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <bd45cfd5e8c2437da9b5cc29b19f336f>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <bd45cfd5e8c2437da9b5cc29b19f336f>:0)
UnityEditor.DockArea.OldOnGUI () (at <bd45cfd5e8c2437da9b5cc29b19f336f>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <93ba6ea0bbfd4de09b538244d248af02>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <6cf4b8f7a4344e9e9df60cc4c1690d8c>:0)

Packages version:
Unity3d: 2020.1.14f1
Babylon Exporter: 5.0.0 A1
node: 14.15.1
OS: Windows 10 2004

Project not building on Unity 2020.3.6

Hey there, Mackey!
Thank you very much for contributing to this toolkit, I wager all the Babylon community highly appreciates it!

I'm trying to use the toolkit to create a small, low-poly styled map and I'm wishing to import it to Babylon.js running on the browser. I was trying to use Unity as the editor, and seeing your tool is kind of the de facto exporter from Unity to Babylon, I was trying to give it a whirl.

I followed the steps on this thread that but I can't seem to get it working with the latest Unity 2020.3.6 - it always says that the project failed to build.

What I changed on a fresh project

I followed the steps of the video, which included:

  • In Project Settings -> Graphics, unticked "Reflection Probes Blending" on all Tiers.
  • In Project Settings -> Players, changed "Color Space" to Linear.
  • In Project Settings -> Players, unticked "Auto Graphics API for Windows"
  • In Project Settings -> Players, put "OpenGLCore" on top on all platforms (which lead to the editor being restarted).
  • Created a lightning object, and disabled "Progressive Updates", set "Lightning Mode" to Subtractive and changed "Directional Mode" to Non-Directional.

I'm a bit lost on what I can do to make this work. Any pointers?

Thank you!

[Unity] export sometimes fails

Sometimes the exporter seems to trigger the preview too soon and the scene is not served:
image
Sources:
image
And after a reload it works fine, so it seems to me the exporter skips a job (maybe VS is still compiling and the exporter should bug out or wait even?)
image

Btw, the RollABall but then newly Babylonized! 💃

Doesn't load into Toolbar on Import

First time installer, was really confused about the instructions until I saw the video that had toolbar item for the toolkit,

Windows 10 Enterprise
Unity 5.6.3p2 (64 bit), upgraded from 5.6.something to see if that was the issue

Console Errors:

  • Assets/Babylon/Sources/Editors/LightScale.cs(17,37): error CS0122: `UnityEditor.LightEditor' is inaccessible due to its protection level
  • Assets/Babylon/Sources/Editors/LightScale.cs(19,30): error CS0115: `UnityEditor.LightScaleEditor.OnInspectorGUI()' is marked as an override but no suitable method found to override

Duplicate Ionic.zip.dll makes this incompatible with Bolt install.

I get an error with the Ionic.zip.dll file since bolt uses a version of that too. Seems deleting one or the other creates issues and i can't seem to make a working build of the most basic scene.

Perhaps using bolt at all isn't viable but I figured i'd let you guys know...

Missing Some System Components

Hello there!
Thanks a lot for this amazing plugin.

I was scanning through the documentation and there are quite a bit handy scripts that come with the plugin.

I was specifically interested in the CharacterComponent but it doesn't appear in the dropdown as well as few other mentioned in the doc. Any idea?

image

Iphone VR and Oculus Quest VR doesn't work when exported with Unity3D exporter

Good morning everyone,
I tried building the unity exporter demo ( https://github.com/BabylonJS/UnityExporter/tree/master/Redist ).
Just added a camera rig to a new empty unity project, enabled experience helper and built it.

Screen shots of the process

Screenshot (12)
Screenshot (16)

Bugs

  • Bug repro on github page
  • Expected result: VR opens and it rotates when you rotate your head
  • Current result: VR opens but doesn't rotate with your head
    -reproduced on : Iphone and Oculus quest
    -VR works with no issues on : Pc(using a mouse) ,Android and Gear VR

Exporter create wrong jpg files

Hi,

When I select jpeg format for exporting lightmaps, the exporter create .jpg files for light maps (great). But, when I open that files in Photoshop (to optimize them), Photoshop says these jpeg file are not real jpeg.

After some investigations, it looks like the exporter just create png file and rename it with .jpg extension. But in reality, the file is a png.

See this lightmap file after using Babylon exporter for Unity :

Filename: Rex2_Lightmap-0_comp_light.jpg
Filetime: 2019-08-23 14:15:05 GMT
File Type: image/png
Dimensions: 1024x1024
Color Channels: 3, 16-bit
File Size: 726,167 bytes
MD5: 911c368776ab86315e3be3cd74857fb7
SHA1: 395c522f09390b5c7167b3fa4831e609223ed7c6
SHA256: 085607ba7d2d1d5ad70f9b0ccec18f2342e87ff0389268a277f33772a4615c52

Is there a technical reason why jpg file are in reality png file ?

Regards

Source Code // Want to tinker

Hey @MackeyK24 !

Would it be possible to make the source code available? Or send to me directly?
I see it was mostly removed a few years ago in some old commits.

Would like to tinker with instanced meshes with a lightmap attached.

Thanks so much!

[Unity] UI/Canvas design time + updating GUI from TS

TL;DR
Could we introduce the unity Canvas/UI designer to the scene API somewhere in the toolkit as a GUIComponent (derived from a BABYLON component, of course)?

The Question context
So I'm wondering, in Unity we have an awesome way of designing a Canvas in 2D or 3D (yeah confusing: call it GUI canvas). Would it be possible to leverage this design awesomeness and create a Babylon interface which triggers either dat.js or the BABYLON.GUI AdvancedTexture on a canvas (only)?
My primary focus is to update the GUI from components and provide button update callbacks to Typescript, but I'm stuck in how to do this without leaving a lot of design debt (buttons/input callbacks, text updaters)

So the typescript intellisense would know, ok, you have one GUI only and you can reference that from any GUIComponent. It would error out if you have no/more than 1 GUI's instantiated on the scene (for example a EditorScriptComponent with a Unity Canvas), so that's fine (designer stupidity isnt tolerated)

GUI data interface
One of your tutorial vids (at 1:38:00) you are talking about the GUI side by introducing a .html file and injecting that into a Scene Manager option, which is not available anymore. Also, that way leaves a lot of design debt (global variables) and introduces the old way of javascript callbacks and doesnt leverage Typescript Interfaces. I come from an Angular TS/JS point of view and I no likey.

As always, let me know if I can be of any help to PR this stuff, but first, lets brainstorm.

Error on import babylon package using Unity 2019.4.14

Hi,

First time trying babylon.js,

Packages version:
Unity3d: 2019.4.14f1 (Net 4.x)
Babylon Exporter: V5.0.0-A11 (i update with this version, but still the same)
node: 14.15.1
OS: Windows 10

when I import the package the errors showed up.

Error: Could not load signature of System.UnityTools:GetLightingSettings due to: Could not resolve type with token 010000cc (from typeref, class/assembly UnityEngine.LightingSettings, UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null) assembly:UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null type:UnityEngine.LightingSettings member:(null) signature:<none>

Unloading broken assembly Assets/[Babylon]/Plugins/CanvasTools.dll, this assembly can cause crashes in the runtime

Should I use Unity 2020 instead?
I can't access the Babylon panel because of these errors.

camera not showing skybox

unity 2021.2.6f1
unity exporter - 2021

My scene is showing grey background
image

Where as in unity3d everything is showing fine

image

Please guide

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.