Giter VIP home page Giter VIP logo

needle-tools / needle-engine-support Goto Github PK

View Code? Open in Web Editor NEW
530.0 12.0 44.0 20.48 MB

Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible and includes networking and XR - across platforms. Documentation at https://docs.needle.tools

JavaScript 99.62% Batchfile 0.38%
engine export exporter threejs typescript unity unity3d webdevelopment webgl webxr augmented-reality augmentedreality xr virtualreality vr

needle-engine-support's Introduction


logo

Needle Engine

Version Downloads Discord Shield


Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible and has built-in support for networking and XR!

Needle Exporter for Unity bridges the Unity Editor and the web runtime. It helps you to export your assets, animations, lightmaps and so on to the web. It is built around the glTF standard for 3D assets.

Together, they enable incredible iteration speeds and help you to bring your content to the web.
Some have called it the "Missing Link" between artist-friendly workflows and modern web development!


needle-engine-support's People

Contributors

devpika avatar hybridherbst avatar kipash avatar krisrok avatar marwie avatar needle-bot avatar xzilja 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

needle-engine-support's Issues

Getting .getWorldPosition() in Update or OnBeforeRender causes jittering when on animated object

Have sent over a repro for this, the jitter is only there when using worldposition - when using normal position there is no jitter

In the repro, refer to OrbitControlsEpm.ts and change out the commented lines to see the difference in jitter when running and clicking the button in the scene

update ()
{
    if(this.stickyTarget)
    {
        if(this.stickyPosition != null && this.stickyAim != null)
        {
            const followWp = getWorldPosition(this.stickyPosition);
            const aimWp = getWorldPosition(this.stickyAim);
            this._cameraTargetPosition = followWp;

            //Local
            //this._cameraTargetPosition = this.stickyPosition.position;
            //this.targetPosition.copy(this.stickyAim.position);
            
            //World
            this.targetPosition.copy(aimWp); 
            this.setCameraTarget(followWp);

        }
    }
}

Local position (smooth):
local

World position (jittery):
world

When installing package in empty project, ShaderNotFoundExceptions result

Following option 2 in the Quickstart page. At end of step 3, I get these errors in the console.

ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant5.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/CactusBig.glb using Guid(f747010238922ae448abd02d66270030) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/CactusBig.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Flower2.glb using Guid(28e75797c10217042830cd75c6d801cd) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Flower2.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/BenchSmall.glb using Guid(78e382a95436ca24cb13f2e28dcea642) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/BenchSmall.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant2.glb using Guid(aa705018c8fd6c343be2219bdec460e5) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant2.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant3.glb using Guid(3bd8a5e11f916684ea7a82cc80d5fed6) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant3.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/GroundCubeQuad.glb using Guid(acb013f31cad638439273ba3bcca8c39) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/GroundCubeQuad.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/GroundSand2.glb using Guid(2d0e7e9e3a92c6c43b8ba9db1d431990) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/GroundSand2.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant1.glb using Guid(3e1162219392c0d418059c435572ff39) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant1.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/RockSmall.glb using Guid(9e8141a86b75494439477208a33b6d49) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/RockSmall.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant7.glb using Guid(2f8ba4c41a4dc724f9dea2cd9f6b5378) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant7.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant6.glb using Guid(4f521bcaeda9b9647b799715f43ad4b9) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant6.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/CactusRound.glb using Guid(4f8908b5be8aa20408ffdc0ad114008d) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/CactusRound.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant4.glb using Guid(cf8000961f38c6640b879aa179b6529d) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/Plant4.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/CactusFlat.glb using Guid(dfb458ee6005cff41928ff5135bac444) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/CactusFlat.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Start importing Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/BinBarrel.glb using Guid(ff341511bebd94b45835b85c6ba3315b) Importer(-1,00000000000000000000000000000000) ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?
Asset import failed, "Packages/com.needle.engine-exporter/Core/Editor/SceneTemplates/Models/Needle/BinBarrel.glb" > ShaderNotFoundException: GLTF/PbrMetallicRoughness not found. Did you forget to add it to the build?

Uncaught TypeError: newTarget.getComponentInChildren is not a function - Exporter 2.17.0-pre

These scripts worked fine on earlier Exporter versions such as 2.15 and 2.16, may be related to regressions in 2.17.0-pre

I have a button in the UI calling a script that calls getComponent using a passed gameObject

If you pull up the repro project I sent over Wetransfer, Scenes>Test (or the only scene in there) and click the buttons in the scene you will see this behaviour too. If you roll back to 2.15.1-pre which I was using before, you will see the code works fine

Error:

SetCamTarget.ts:19 Uncaught TypeError: newTarget.getComponentInChildren is not a function
    at SetCamTarget.setTarget (SetCamTarget.ts:19:47)
    at invokeFunction (engine_serialization_builtin_serializer.ts:226:33)
    at CallInfo.method (engine_serialization_builtin_serializer.ts:215:57)
    at CallInfo.invoke (EventList.ts:17:14)
    at EventList.invoke (EventList.ts:31:15)
    at Button.onPointerClick (Button.ts:97:23)
    at EventSystem.handleEvents (EventSystem.ts:372:30)
    at EventSystem.handleIntersections (EventSystem.ts:259:22)
    at EventSystem.onBeforeUpdate (EventSystem.ts:180:14)
    at EventSystem.onPointerDown (EventSystem.ts:125:14)

Broken/distorted skybox on export

Using Unity 2022.1.16f1, Exporter 2.23.0-pre

I have sent a repro scene across, this project was upgraded from 2020.3.38f1

In Editor:
image

In Build:
image

Canvas Data > Cast Shadows is sometimes ignored - Exporter 2.21.1-pre

Able to repro this with the recently wetransfer sent project about lights being too bright, in some instances the Canvas Data is totally ignored when resaving the scene and now I have an instance where the Canvas UI is always casting shadows despite the Canvas Data being set to Cast Shadows 'off'

image

The type or namespace name 'MS' could not be found when copying OrbitControls.ts into a new custom script

When copying OrbitControls.ts into a new script to mess around with my own version of it, a line referring to MS.internal.xml.. is added by the codegen when it makes a Unity Component for it. See below for repro steps.

Error is: Assets\Needle\Components.codegen\Test.cs(10,34): error CS0246: The type or namespace name 'MS' could not be found (are you missing a using directive or an assembly reference?)

Generated line causing error: public void onStartInteraction(MS.Internal.Xml.XPath.Function @func){}

1.Clone example repo
2. Add new Scripts in src/scripts/test.ts
3. Copy the code from OrbitControls.ts in the engine folder (ctrl+shift+f to find the script in VS code) to the test.ts
4. Change class name in code to test.ts
5. Make sure all paths to includes at top of script are corrected
6. Save script, see generated component has public void onStartInteraction(MS.Internal.Xml.XPath.Function @func){} which produces the error.

You can edit the generated component to remove the line but that's not ideal.

DirectoryNotFoundException: Could not find a part of the path - Exporter 2.17.0-pre

Getting these errors in a project migrated from 2.16~ Exporrter to 2.17.0-pre

DirectoryNotFoundException: Could not find a part of the path "C:\Unity_Projects\ProjName\Temp\Needle\Export\Debug\MyGltf.debug.json".
—
System.IO.DirectoryNotFoundException: Could not find a part of the path "Temp/Needle/Export/Debug/MyGltf.debug.json".
DirectoryNotFoundException: Could not find a part of the path "C:\Unity_Projects\ProjName\Library\Basic\cache~\2f03f3a162fd0d24389f92f0a3ef46a1.hash".
—
System.IO.DirectoryNotFoundException: Could not find a part of the path "Library/Basic/cache~/2f03f3a162fd0d24389f92f0a3ef46a1.hash".

[Exporter 2.9.5-pre] After updating package, failed to resolve import "../../node_modules/@needle-tools/engine/engine-components/AlignmentConstraint.ts" from "src\generated\scripts.js". Does the file exist?

In project: https://github.com/needle-tools/needle-engine-support.git

When I updated Exporter Package from 2.9.4-pre.1 to 2.9.5-pre (on Windows), I got this error when trying to run:

Failed to resolve import "../../node_modules/@needle-tools/engine/engine-components/AlignmentConstraint.ts" from "src\generated\scripts.js". Does the file exist?
In the server page in Chrome I get this:
errorneedle

In Editor I get a lot of errors like these when trying to run install and then also using the fix button that appears after on the Export gameobject in the scene:
image

Setup error on work computer: Win32Exception: ApplicationName='cmd.exe', CommandLine='/c npm', CurrentDirectory='', Native error= The system cannot find the file specified.

We get the following errors on a fresh clone and open of the Needle Engine Starter repo (cloned with LFS on) using Unity 2020.3.38f1

We have installed Node.js and restarted, versions:
node v16.17.0
npm 8.15.0

Needle tools tutorial popup window says 'Installing nodejs' with advice to restart computer

Win32Exception: ApplicationName='cmd.exe', CommandLine='/c npm', CurrentDirectory='', Native error= The system cannot find the file specified. — System.ComponentModel.Win32Exception: ApplicationName='cmd.exe', CommandLine='/c npm', CurrentDirectory='', Native error= The system cannot find the file specified.

Win32Exception: ApplicationName='cmd.exe', CommandLine='/c npm set registry https://registry.npmjs.org && npm install --force --progress=false 2>&1 > "D:/Unity/Needle/starter/Needle Engine Starter 2020_3/Assets/../Temp/NeedleTinyCmdProcess.log"', CurrentDirectory='D:\Unity\Needle\starter\Needle Engine Starter 2020_3\Library\PackageCache\[email protected]\package~', Native error= The system cannot find the file specified. — System.ComponentModel.Win32Exception: ApplicationName='cmd.exe', CommandLine='/c npm set registry https://registry.npmjs.org && npm install --force --progress=false 2>&1 > "Assets/../Temp/NeedleTinyCmdProcess.log"', CurrentDirectory='Library/PackageCache/[email protected]/package~', Native error= The system cannot find the file specified.

Proposition - Custom unity inspectors to hide irrelevant settings

Common components like MeshRenderers or Camera could have a custom editor which would hide the unused features and potentially could hardcode states for unused features.

For an example: Disable "occlusion culling" since this setting is not considered in the conversion.

Potentially the original editor could be rendered in a foldout under it, just for clarity.

Code of a custom inspector which renders the original inspector made by unity AND has the ability to render anything before and behind it.
https://gist.github.com/ChrissTman/bebf9fefd525019454235ceb1f6fb020

Obviously, the custom editor would have to check for the presence of the Needle component in the scene which hopefully wouldn't be too expensive.

Might be a nice streamline and would be simpler to understand supported and unsupported unity/needle features.

``@syncField`` field decorator broken

@sync() is not working correctly since changed init function to ___newInstanceCreated > test with auto playerdata sync if it still works when we return to __internalAwake

onCollision events not firing

Using Exporter 2.21.1-pre

Make a box with a box collider on it, add a box collider to your camera and add the below script to it, move the camera through the cube and see the collision event doesn't fire.

import { Behaviour, GameObject } from "@needle-tools/engine/engine-components/Component";

export class CollisionRadius extends Behaviour
{
    onCollision(eventInfo) 
    { 
        console.log(eventInfo); 
    }
}

Animation export- fine with 2 animations but issues if there are 3 animations

Find attached a cactus example prefab, in Assets>TEMP there are the animations and animation controller for it. The prefab should be Assets>CactusBig.prefab. Any animations in the animator may be called jump or spin but the transitions are called open close.

  1. Make example scene, add the cactus prefab

  2. Add worldspace UI, a button for 1 animation and a button for the other.

  3. Make the UI buttons call onclick > CactusBig>Animator.SetTrigger(string) Open and Close respectively to set the triggers

  4. Build and run, animations should trigger fine from the buttons, your animator should look like this below:
    image

  5. Now we want to add a third animation to the cactus, in this case I want an idle animation for the cactus before I call the Open/Close animations (you can imagine this is for a product that opens/closes)

  6. Make a new 'idle' animation which is just a new animation for the cactus, and make it the default state for Entry to animation transition like below, set the transition out of idle to open state to be the 'Open' trigger

image

  1. Hit play again and see that the buttons setting the trigger don't take it out of that idle state

CactusBug.zip

'CompileVariant' and no accessible extension method 'CompileVariant' accepting a first argument of type 'ShaderData.Pass'

Hi there,

I am using Unity 2020.3.3f1, and when I installed the package via Registry, this is the error I keep on getting.. Any attempt to resolve it?

Thanks.

Library\PackageCache\[email protected]\Shaders\Editor\ShaderExporter.cs(110,30): error CS1061: 'ShaderData.Pass' does not contain a definition for 'CompileVariant' and no accessible extension method 'CompileVariant' accepting a first argument of type 'ShaderData.Pass' could be found (are you missing a using directive or an assembly reference?)

Error: Compression reduced vertex count unexpectedly, corrupting morph targets. Applying the "weld" function before compression may resolve the issue.

Trying to compile production build with humanoid animated avatar and were met with the following error message.

error: Compression reduced vertex count unexpectedly, corrupting morph targets. Applying the "weld" function before compression may resolve the issue.
<b>Production build <color=#ff2222>failed</color></b>, check the console for errors
UnityEngine.Debug:Log (object)
Needle.Engine.MenuItems/<InternalBuildTask>d__23:MoveNext () (at Library/PackageCache/[email protected]/Core/Editor/MenuItems/MenuItems.cs:283)
System.Runtime.CompilerServices.AsyncTaskMethodBuilder1<bool>:SetResult (bool)
Needle.Engine.Utils.ProcessHelper/<RunCommand>d__0:MoveNext () (at Library/PackageCache/[email protected]/Common/Runtime/Utils/ProcessHelper.cs:225)
UnityEngine.UnitySynchronizationContext:ExecuteTasks ()`

Building with Development yields a successful build, but the avatar is upside down and t-posed without animation.
not working as expected.

Issue communication -> [https://discord.com/channels/717429793926283276/1012484258033573919]

AR bug - Skinned Mesh Renderer in scene is showing up huge in the AR view before placing content with the viewing circle

This is reproducible with the project I sent Marcel privately, when you deploy to glitch and load on a phone then press view in AR, the animated model in the scene I added is showing up huge in the AR view in the middle of the space, the placement circle pointer is there though too. Once you tap on the pointer circle to place the scene, the huge version of the animated model disappears.

Hopefully this is enough to repro, I will share a glitch url privately with Marcel for this too to see what we are seeing our end

Stop local server on package update

When updating the package the local server should be stopped and restarted to prevent runtime errors after the installation (while the server is running)

Animations don't allow enable/disable of components

I was trying to use a script that would run something in onEnable and onDisable and was finding those events don't fire when the gameobject itself was enabled or disabled. So I tried animating the component itself enable/disabling on the animation track instead of the gameobject it is on. I get this error:

three.module.js:44609 THREE.PropertyBinding: Trying to update property for track: .nodes.CamResetter.userData.components.0.m_Enabled but it wasn't found.

Sample code, using my OrbitControlsEpm script but these onEnable/onDisable don't fire when the Gameobject it is is set active/inactive in an animation:

import { Behaviour, GameObject } from "@needle-tools/engine/engine-components/Component";
import { serializeable } from "@needle-tools/engine";
import * as THREE from "three";
import { Object3D } from "three";
import { OrbitControlsEpm } from "./OrbitControlsEpm";

export class ResetCameraPos extends Behaviour
{
    @serializeable(OrbitControlsEpm)
    public orbitCam?: OrbitControlsEpm;

    @serializeable(GameObject)
    public target?: GameObject;

    onEnable()
    {
        this.orbitCam?.setTarget(this.target);
    }

    onDisable()
    {
        console.log("disabling");
        this.orbitCam?.enableDisableControls();
    }
}

Fix Create Git Ignore Fix failed: Could not find any gitignore to create - Exporter 2.18.0-pre

Using Exporter 2.18.0-pre in the starter project cloned from here (and the repro projects I sent), the warning

The warning here has incorrect capitalisation of 'Projects\newProject', it should be 'projects\newProject'
image

I get this in console always: Fix Create Git Ignore Fix failed: Could not find any gitignore to create

Could be if there is no gitignore, make a blank one automatically and log a warning (not error) about it?

.gitignore is sometimes missing from generated projects

This can be very confusing as suddenly version control shows ~40.000 changes (everything in node_modules) instead of the ~35 changes generating a project actually should show.

Still not sure in which conditions this happens.


For people stumbling upon this issue, here's the .gitignore that should be generated inside each project's folder:

node_modules/
assets/
src/generated/
dist/
stats.html
include/draco/
include/ktx2/
include/three/
include/console/
include/three-mesh-ui-assets/
cache~

Exporter 2.16.0-pre.3: Uncaught TypeError: newTarget.getComponentInChildren is not a function

Exporter 2.16.0-pre.3, in Unity 2020.3.38f1 - Code that previously worked (unchanged) from Exporter 2.14-pre versions reports that getComponentInChildren is not a function now. I can send a repro project

SetCamTarget.ts:22 Uncaught TypeError: newTarget.getComponentInChildren is not a function
    at SetCamTarget.setTarget (SetCamTarget.ts:22:60)
    at invokeFunction (engine_serialization_builtin_serializer.ts:226:33)
    at CallInfo.method (engine_serialization_builtin_serializer.ts:215:57)
    at CallInfo.invoke (EventList.ts:17:14)
    at EventList.invoke (EventList.ts:31:15)
    at Button.onPointerClick (Button.ts:97:23)
    at EventSystem.handleEvents (EventSystem.ts:372:30)
    at EventSystem.handleIntersections (EventSystem.ts:259:22)
    at EventSystem.onBeforeUpdate (EventSystem.ts:180:14)
    at Context.render (engine_setup.ts:437:31)

Usage of "addEventListener"

Is it possible to use "addEventListener" like
document.addEventListener('mousemove', mouseMove);

Im trying to port a Three.js native Camera Control script to Needle Engine and im a little bit stuck.

GameObjects that are inactive on export or immediately set inactive in awake don't receive shadows

Exporter 2.24.1-pre, Unity 2022.1.16f1

Make a scene with a directional light, something to case a shadow like a cube and a few planes with different materials, set the planes all inactive except one and make a button or way to set them active via code using GameObject.setActive. See that only the first plane that was active on export receives shadows.

The same happens if you leave all the planes active but in code set them all inactive in awake(). Works fine if you use start() instead.

Disabled UI that is built is missing parts

Make a Worldspace canvas and 2 buttons - set them to enable/disable each other with Gameobject.setactive

Hide one of the buttons by making it inactive in the inspector and hit play, in browser see that when one button enables the other, the one that was inactive either doesn't have its children gameobjects or text (try also making a button as a child of this button and rebuilding to see this)

Clicking on World Space UI Canvas disables ability to rotate camera

Not sure if this is unique to the example scene you get with the cacti when you make a new scene using the getting started popup:

  1. Make a new scene with the cactus example
  2. Make a world space UI canvas with 2 regular buttons in it
  3. Place the canvas and scale it so it fits in the middle of the scene to easily press
  4. Export and play using the Export gameobject
  5. Click the buttons in the canvas and notice the left click camera rotation no longer works, nor does the scroll or right click move

register_types.js can have multiple of the same registered type (causing errors) - Exporter 2.17.2-pre

Haven't fully found the repro for this yet consistently but I wonder if any duplicate checking can be done when adding to register_types.js automatically?

To repro:
I made a new script and copy pasted another script but left the class name the same as the old script, hit save. Then I go back and correct the class name, save again. Seems to add a duplicate into the register_types.js file

My file:

import "test-npmdef/codegen/register_types.js"

import { TypeStore } from "@needle-tools/engine/engine/engine_typestore"

// Import types
import { AnimateUV } from "../scripts/AnimateUV.ts";
import { SetCamTarget } from "../scripts/ChangeSkybox.ts";
import { GetAnimationState } from "../scripts/GetAnimationState.ts";
import { LookTarget } from "../scripts/LookTarget.ts";
import { OrbitControlsEpm } from "../scripts/OrbitControlsEpm.ts";
import { ResetCameraPos } from "../scripts/ResetCameraPos.ts";
import { SetCamTarget } from "../scripts/SetCamTarget.ts";
import { UiInFront } from "../scripts/UiInFront.ts";

// Register types
TypeStore.add("AnimateUV", AnimateUV);
TypeStore.add("SetCamTarget", SetCamTarget);
TypeStore.add("GetAnimationState", GetAnimationState);
TypeStore.add("LookTarget", LookTarget);
TypeStore.add("OrbitControlsEpm", OrbitControlsEpm);
TypeStore.add("ResetCameraPos", ResetCameraPos);
TypeStore.add("SetCamTarget", SetCamTarget);
TypeStore.add("UiInFront", UiInFront);

Animated UI anchored position incorrect + jittering

Using Exporter 2.13.0-pre in Unity 2020.3.38f1

Exported UI with a button that is animated (another button is a child of it, rotated 180 degrees so the button is 2 sided on the web). Added keyframes for scale, move and rotate and the animation is jittering + the button seems to be floating forward from its position when I only animated it flying up not forward.

Hope the gif helps and I can send a repro if needed

wbbblbutton

Ability to export project to send repro's and bug reports - Feature Request

When using 7zip to zip up the following folders from a project top level-

  • Assets
  • Packages
  • projects
  • ProjectSettings
  • UserSettings

We get these errors and projects folder is missing from the zip as a result, which is due to node_modules subfolders. The same folder issues arise when you try to copy the entire project between folders on Windows 10/11 if you try to copy or move the project.

C:\Unity_Projects\ReboundPlatform\Assets\ExampleModules\MyFirstModule~\node_modules\@needle-tools\engine\
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\ExampleModules\MyFirstModule~\node_modules\three\
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\CustomShader\com.needle.shader-example~\node_modules\@needle-tools\engine\
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\CustomShader\com.needle.shader-example~\node_modules\three\
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\Lightmaps\com.needle.lightmaps-example~\node_modules\@needle-tools\engine\
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\Lightmaps\com.needle.lightmaps-example~\node_modules\three\
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\ExampleModules\MyFirstModule~\node_modules\@needle-tools\engine
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\ExampleModules\MyFirstModule~\node_modules\three
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\CustomShader\com.needle.shader-example~\node_modules\@needle-tools\engine
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\CustomShader\com.needle.shader-example~\node_modules\three
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\Lightmaps\com.needle.lightmaps-example~\node_modules\@needle-tools\engine
The system cannot find the path specified.
C:\Unity_Projects\ReboundPlatform\Assets\Scenes\Lightmaps\com.needle.lightmaps-example~\node_modules\three
The system cannot find the path specified.

Preview animation state is what gets exported in play mode

When in editor playing back an animation on an object in the scene, the exported object is frozen on the keyframe it was in animation preview mode on, rather than respecting its normal state in the scene when you are not in animation preview mode (see screenshot below)

image

Clean Export Error - System.IO.DirectoryNotFoundException: Could not find a part of the path 'Projects/newProject/cache~'.

Windows 11, using Unity 2022.1.16f1, Exporter 2.23.0-pre

Holding alt to do a clean Export on the Exporter component gives me this error, happens in the repro project I sent for issues #59 and #60

DirectoryNotFoundException: Could not find a part of the path 'C:\Unity_Projects\projname\Projects\newProject\cache~'.
—
System.IO.DirectoryNotFoundException: Could not find a part of the path 'Projects/newProject/cache~'.

Could be worth checking if it exists or not to prevent this error blocking a full clean export

Support for bone animations

Hey, looking at the examples and the docs, there is no mention of bone animations. Are they supported (even partially)? Or are they planned for a later date?

I know Three has skinned mesh and blending animation support https://threejs.org/examples/?q=animation#webgl_animation_skinning_blending

but playing around with their demo, the blending kinda sucks compared to the system Unity provides. That was also a massive issue with Luna engine when I used it in the past; the bone animation system was by far the hardest thing to work around when making games using it.

Identical named gameobjects override each other on export

Use template scene, add 2x Worldspace Canvas, add gltf Object component to them and make sure they are both called Canvas.

Add a button or image to each so you can see which is which - only one of them will show when you export is they are named identical.

If you change their names to Canvas1 and Canvas2, they both show

Unable to deploy to Glitch with Build & Deploy: Prod using 2.24.1-Pre Exporter

I have sent a repro for this, this project runs fine on local server but the glitch deployment to prod produces lots of errors on scripts that usually worked fine like

src/scripts/ChangeSkybox.ts(7,36): error TS2339: Property 'material' does not exist on type 'GameObject'.
Open C:\Unity_Projects\Projname\Projects\newProject/src/scripts/ChangeSkybox.ts

Have sent over a repro and logs

UI Anchoring and Positioning is off

When anchoring the text or image component, the anchoring will be mirrored when exporting (left and right is switched).

Set it up in Unity like this:
unityAnchoring

And got this result:
webResultAnchoring

Version: 2.16.0-pre (Exporter) and 2.12.o-pre (Engine)

engine_serialization_core.ts:440 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'isMaterial') with Exporter 2.16.0-pre.2

Getting this error and black screen in builds with Exporter 2.16.0-pre.2, I can send a repro, just using this starter repro with it on Scene/Basic to repro this though, in Unity 2020.3.38f1

engine_serialization_core.ts:440 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'isMaterial')
    at deserializeObjectWithType (engine_serialization_core.ts:440:14)
    at tryResolve (engine_serialization_core.ts:287:36)
    at deserializeObject (engine_serialization_core.ts:274:36)
    at handleDeserialization (engine_gltf_builtin_components.ts:194:20)
    at engine_gltf_builtin_components.ts:66:13
    at Module.processNewScripts (engine_mainloop_utils.ts:23:13)
    at Context.internalOnCreate (engine_setup.ts:362:13)
    at async EngineElement.connectedCallback (engine_element.ts:162:17)

Custom Shader Graph Shaders with Custom Function Node have Invalid Conditional Expression errors

Using 2020.3.38f1 and Needle Engine Starter Project, I was trying to make a shadow catcher material using this https://brownbot.com/2021/03/09/realtime-ar-shadows-unity-shader-graph/

In the Shader, I get errors about 'Invalid Conditional Expression'

image

Pretty much the same as this project and the file in it: https://github.com/Unity-Technologies/arfoundation-demos/blob/master/Assets/Shaders/Shadows/ShaderGraphs/TransparentShadowReceiver.shadergraph

Not sure if this is an error with the URP version or Needle? Is there an alternative for transparent AR plane shadow catching?

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.