• Content Count

  • Joined

  • Last visited

About Swiftwork

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. The issue still persists even with the _badOS flag set to true :/
  2. @Deltakosh this issue still arises for me with MacOS Sierra 10.12.2 even with the latest build, both locally and in the playground. Do you know the cause and how the fix was attempted in the latest preview version? Is it something I must do locally? Kind Regards /Swiftwork
  3. I missed your reply @Deltakosh and I would suggest for now just add Earcut to the babylon namespace because the file is fairly small and doesnt have any specific reason to not being included in its current state. I can make a pull request for this today if I get some free time.
  4. Hi I have spoken to @Nockawa already and he suggested I turn to the forums which I agreed with. When using a bundler such as Webpack, the developer imports the the BabylonJS library rather than including it in a script tag. The problem that arises is that Earcut has been defined in it's own namespace and is available only in the babylon.js file or globally when using script tags. However in Webpack each imported module is treated as an isolated scope and doesn't have access to other modules or global variables unless they have specifically been required/provided. Because Earcut is never exported and in it's own namespace it is literally unreachable for module bundlers: > babylon.js defines Earcut module > babylon.js defines and exports BABYLON module > Webpack provides the BABYLON module from babylon.js to all other libraries > babylon.canvas2d.js extends and exports BABYLON module x babylon.canvas2d.js uses BABYLON and Earcut (but Earcut is not provided nor in the same namespace) This leave 2 solutions as I see it: Add Earcut to the BABYLON namespace so that they get exported together and can both be provided by bundlers. Keep Earcut in it's own namespace and export it so that it can be imported by both babylon.js and babylon.canvas2d.js or provided using a bundler. Ping @Deltakosh, moving forward it might be worth looking into npm more. They offer the for example the option to add @next version tag for alphas/betas of packages. I am sure Babylon.JS would benefit from having more users testing/working with the preview build and finding issues. Kind Regards Swiftwork
  5. I would like to quickly chime in that I have noticed this as well with macOS Sierra and Chrome. I will also try and figure out a work-around but this might be a tough one...
  6. Kings @Sebavan, @Deltakosh, @NasimiAsl! Thank you for your time
  7. Great work @sebavan! I'll check tomorrow then
  8. Ok great! Sorry for causing you trouble. Edit: Highlighting only one clone seems to causing the same issue. http://babylonjs-playground.com/#29SZC0#11
  9. But that's what my PR was doing, referencing the parent instead of the InstancedMesh. I believe there is another issue at play?
  10. Reporting bug regarding instances and their parents not being rendered when HighlightLayer is used. http://babylonjs-playground.com/#29SZC0#10 Ping @Sebavan /Swiftwork
  11. @Nockawa great as always. I don't mind waiting for a release and I'll report any bugs I discover
  12. @Nockawa Haha to be fair it is in my nature to investigate bugs by myself, however long it takes. Too stubborn not to ^^. I will make sure to ping you personally in the future though regarding some of the things I find while using Canvas2d, which by the by is fantastic! Mind you though I might send a lot, but I'll try and keep it concise, clear and condensed
  13. After some further investigation I figured out why the var BABYLON; was affecting the Webpack ProvidePlugin. I originally believed the plugin exposed a global variable, but what the plugin actually does is that it checks for usages of an alias such as BABYLON and then replaces each instance with the defined module require('babylonjs'); (requires are cached). What was happening in the example above was that BABYLON was never referenced before being assigned as a variable and therefore never aliased. A sneaky solution to this problem would be to add an instantiated checker the same way the other additions are added in gulp: var dependencyAddition = 'if (typeof BABYLON === "undefined")\n' + 'throw "Canvas2D depends on BabylonJS, please include both files";\n' + '};\n'; That way there is a check to see if BABYLON exists and the ProvidePlugin will do its magic, while also providing a descriptive error handler in the event of a missed babylonjs import. However after solving the above issue locally I seem to be running in to the issue that: Uncaught TypeError: BABYLON.PropertyChangedInfo is not a constructor caused by: ObservableStringDictionary.pci = new BABYLON.PropertyChangedInfo(); This might be another issue with webpack, but it seems as if it doesn't know about new BABYLON.PropertyChangedInfo(); yet because it gets defined later on in the code. I have been trying to figure out these issues for 3 days now and it is doing my head in. I hope I don't have to abandon Webpack for the project it has been running so smoothly so far. What setup do you guys use to include both canvas2d and babylonjs now after the refactoring? Kind Regards Swiftwork
  14. Hi, I am unsure if this is a bug or incompatible with my setup, but I run the latest nightly build of Babylon.js 2.5.0-beta commit 3fe3372 using a repository I set up that fetches the latest preview build and allows me to install it through npm as a package. I am then using Webpack together with Typescript to import the library. I understand that this might not be the standard workflow, but it has been running smoothly for me until the Canvas2D refactoring. So down to the issue: In a simple Javascript setup such as this using webpack for requires, CANVAS2D will fail to run due to the fact that BABYLON is undefined. const BABYLON = require('babylonjs'); const CANVAS2D = require('babylonjs/babylon.canvas2d'); new CANVAS2D.Rectangle2D({}) First I thought it was that my requires were messed up, which turned out to be half true. Webpack had to provide the CANVAS2D module with the BABYLON module, by making the BABYLON module globally available. new webpack.ProvidePlugin({ BABYLON: 'babylonjs', }), However this wasn't the entire issue, due to the fact that the CANVAS2D module is also defined as BABYLON and the first lines of the code overwrite the globally available BABYLON variable with it's own declaration of BABYLON. var BABYLON; (function (BABYLON) { // ... })(BABYLON || (BABYLON = {})); Removing all var BABYLON; in the compiled code fixed my issues, but maybe it might be worth giving Canvas2D its own CANVAS2D module/namespace, if they are now to be treated as separate modules in the repository. Regards Swiftwork
  15. Then it was as I expected @JohnK, I also found that it was easier using other parametric shapes and then scaling them up or down to get the same frame effect. @adam, I am suspecting it might be an oversight, but it might be a desired one for some, however I am not sure how ^^ Thank you for your help.