Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty worlds, checkTargetFiles, and renderMode #1017

Merged
merged 33 commits into from
Mar 15, 2024
Merged

Empty worlds, checkTargetFiles, and renderMode #1017

merged 33 commits into from
Mar 15, 2024

Conversation

benptc
Copy link
Contributor

@benptc benptc commented Mar 15, 2024

  • Adds POST /object/:id/renderMode - to toggle a world's render mode from mesh to ai
  • Adds POST /object/:id/checkFileExists/:filePath - to check existence of a single file within the object's .identity directory (e.g. targets/target.glb) (instead of continuously checking the file itself to see when the mesh is available, which results in an extra download of a potentially large file)
  • Adds POST /object/:id/checkTargetFiles/ - to get the existence of each of the target files (xml, dat, splat, 3dt, glb, jpg) in a single fetch
  • Implements new uploadTarget function that refactors/imitates a lot of logic from the /content/:id upload route, that isn't actually used because it's not supported by toolsocket, but I left it there because the content route pains me and we might want something like this in the future
  • World objects are initialized by default, don't auto-generate an XML file on creation, and can be clicked on in the 8080 interface to go the metaverse page even without target data attached
  • Better cleanup the target folder after uploading a target zip file

benptc and others added 30 commits January 10, 2024 09:46
…rator, even if object doesnt have target data yet (enables placeholder world objects)
…ar to how avatars, anchors, humanPoses get sent anyways
…get files are uploaded (if autogeneratexml=false in the headers)
@benptc
Copy link
Contributor Author

benptc commented Mar 15, 2024

Oops I'll fix the errors, just trying to get some of my code merged into main instead of relying on alpha forever...

Copy link
Contributor

@hobinjk-ptc hobinjk-ptc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test failure is the rather weird:

 FAIL tests/data-streams.test.js
  ● Test suite failed to run

    TypeError: hardwareAPI.setup is not a function

      662 | };
      663 | // set all the initial states for the Hardware Interfaces in order to run with the Server.
    > 664 | hardwareAPI.setup(objects, objectLookup, knownObjects, socketArray, globalVariables, __dirname, objectsPath, nodeTypeModules, blockModules, services, serverPort, hardwareAPICallbacks, sceneGraph, worldGraph);
          |             ^
      665 |
      666 | const utilitiesCallbacks = {
      667 |     triggerUDPCallbacks: hardwareAPI.triggerUDPCallbacks

      at Object.setup (server.js:664:13)
      at Object.require (controllers/object.js:7:16)
      at Object.require (libraries/hardwareInterfaces.js:26:26)
      at Object.require (libraries/DataStreamInterface.js:2:16)
      at Object.require (tests/data-streams.test.js:10:29)
      ```

@@ -4,6 +4,8 @@ const formidable = require('formidable');
const utilities = require('../libraries/utilities');
const {fileExists, unlinkIfExists, mkdirIfNotExists} = utilities;
const {startSplatTask} = require('./object/SplatTask.js');
const server = require('../server');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this kind of circular import is well-liked by the server but I might be wrong here

Copy link
Contributor

@hobinjk-ptc hobinjk-ptc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@benptc benptc merged commit 4704907 into main Mar 15, 2024
3 checks passed
@benptc benptc deleted the gs-upload-test branch March 15, 2024 20:14
@benptc benptc restored the gs-upload-test branch March 15, 2024 20:14
@benptc benptc deleted the gs-upload-test branch March 19, 2024 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants