THREE.js seems to not work on localhost server - three.js

I am just starting out with THREE and have come across some odd failures which I believe are due to localhost / same-origin-poicy.
In short I created my own animation using armatures in Blender and exported using the three.js exporter plugin. The model displays but the animation doesn't run.
I used the online skinning animation example as the basis for the code and thought I may have incorrectly stripped out certain code that was causing it to fail but after looking for a couple of hours I have come to the conclusion I haven't ripped out anything incorrectly so...
To test if the example code worked locally I copied the online skinning animation example code including the buffalo.js/png files, modified the file references to map to my local copy and tried to run it in a local IIS server and all I get is the stats and no animation or model.
I checked the firebug console and only had a coupe of depreciation warnings no errors. I also checked with my model and code and I get no errors or warnings...
Anyone had this experience before? (I tested in chrome/firefox both had same behaviour)
Am happy to post code but the JSONLoader(ed) model is massive.
Thanks (and sorry for the long windedness of this SO question)

When it comes to running things on your local machine, have you tried the steps on this wiki page? How to run things locally
One example on the page suggests: chrome --allow-file-access-from-files
It's possible that your issue is related to the steps taken during your export. Without the exact errors or screenshots it's difficult to know where the issue originates from. Things to look out for:
Is your model being exported at the first frame?
Do you have the latest .py export plugin for Blender?
Using the latest version of Three.js?
Tried using THREE.SkinnedMesh?
Here is an article that gives you a brief overview of what is required for animated meshes within Three.js: Skeletal Animation
This second article provides a much more detailed tutorial, complete with example code at the bottom of the page: Skeletal Animation +1

In order to rule out same origin policy you can actually disable the security checks chrome uses when it starts up by adding this to the target window on your shortcut properties
--disable-web-security
see here for more information : Disable same origin policy in Chrome

Related

Firefox can't load temporary addon: Error: Can't find profile directory

I'm starting to work on a small firefox plugin, it's a basic js script, no problem on this side.
I've made a few successfull tests, and had a a few satisfying results. But starting yesterday, i'm unable to laod any temporary addons in firefox.
Everytime i try to start one (even a simple console.log("hello world")), i get the error message in the console:
Error: Can't find profile directory. XULStore.jsm:66:15
It work perfectly 2 days ago, the problem appeared yesterday, and, as far as i know, i didn't made any firefox upgrade.
I've made a few reseach, a found two usefull links, one on discourse.mozilla of someone that has the exact same problem ... but no answer, and another one on bugzilla saying this bug won't be fixed because it should last long ... https://bugzilla.mozilla.org/show_bug.cgi?id=1548017
I'm askign here because i can't find any solution to my problem, and right now, it's been 24h since i'm stuck in my development progress. I'm open to any suggestion that might work.
I've checked my profiles directory and files, they're existing and ok... and that's basically everything. I'm not familiiar with the tools available for firefox so, i might have forgotten to check basic things that might help.
P.S: i'm not using selenium at any time (i've seen a few requests here about a similar issue with selenium, but i'm writing vanilla JS here, so, i think it's not the same issue)

What to do about "The Components object is deprecated. It will soon be removed." in dev tools Console

For almost every page I open in Firefox, I see this error in the Console of the developer tool bar:
(!) The Components object is deprecated. It will soon be removed.
The source is the html page. It happens with pages I create, but also on many common websites.
I found this documentation on Components object on MDN web docs, but that does not clarify a lot. Note that even that page shows this message(!)
It looks like a warning, but according to the Console filter, it is an error.
My main questions are:
Is this something for me, as a developer of the page reporting this, to solve?
If so, how do I go about that?
I am not aware of any problems as a result of this. For now, that is.
I have seen this for over a year, maybe longer. I mostly ignore this, but every now and then it starts nagging me again. I don't want my code to break suddenly and would like to get rid of this message obscuring other messages.
This is not for the developer of the page to solve.
While biking back home, a possible cause popped up in my mind: could one of the add-ons I use cause this and yes, that appears to be the case.
I restarted with disabled add-ons and the message was gone.
Then I enabled them one at a time and the culprit is
Selenium IDE.
A bug report on this issue was closed with Won't fix, with the message:
This error will resolve itself when we move to a native app later this year.
In a MozillaZine topic of 2012, it is explained how it could have been solved.
The first one is just a warning that the addon is using "Components"
directly, which won't necessarily always be possible when using the
Add-on SDK. (The preferred way to do it is to access the aliases for
Components.classes and Components.interfaces and such that the SDK
provides by requiring the "chrome" module.) It shouldn't be a problem
right now, but might become one in the future.
it happened for me after installing Selenium plugin in my FireFox.

RStudio interface / behavior changes in 1.0.136

Various things are different in 1.0.136, e.g. running code with ctrl-enter has all sorts of strange behavior in an RMarkdown document, running code that has a syntax error somehow leads to all of the code being run in a block above (below?) the wrong code, etc. Sorry for not posting an MWE, but at the moment I just want to know if anyone is aware of these new "features" and if so how they can be turned off or better yet how I can just downgrade to the previous version of RStudio (which I can't currently find on the website).
Yes they changed some default settings that were present in the old interface.
Change the setting in markdown next to the knit button, from:
Chunk Output Inline -> Chunk Output in Console
Pictured here.
You can probably mess with the the Global Setting->Rmarkdowns under Tools to get it back the way it was before, but this was the fastest way for me.

Three.js Typeface.js offline

the problem is obvious from the title, http://typeface.neocracy.org offline. It was used to convert fonts and used in conjunction with THREE.TextGeometry. But if it is offline, how is now possible to use custom fonts in three.js?
I made a new converter that outputs the same files as typeface.js.
http://gero3.github.io/facetype.js/
I loaded the source, but as far as I can see there is no chance to create the JS-font-files with this distribution. Maybe for someone with deep perl-knowledge...? In any case I installed perl, the ppm and dmake but trying to exec the Makefile only leads to errormessages about missing files. No - this is no alternative to the online-converter. Even worser: I didn't find any other converter or another side using the same one (cufon seems to create another format). So let's hope the site comes back to live - otherwise the great textfeature of three.js is worth nothing in the moment.

What is the best practice to resolve issues due to updated revisions in Three.JS?

I have some codes developed using Three.js R52. I need some features in some code developed using Three.js R56. While I tried to add those features to the original codes developed in R52 and replace the reference to R52 with that to R56, it tells me some some error.
For example, in the original code based on R52, THREE.Matrix4().multiplySelf function is used. After I change the reference to three.min.js from R52 to R56, I came across errors saying:
TypeError: multiplySelf is not a function.
Then I go through the changes listed in https://github.com/mrdoob/three.js/releases by searching "Matrix4", I did not see any note related to method 'multiplySelf'. I searched "multiplySelf" and it returns no entry found. I searched three.min.js R52 and found function "multiplySelf". But there is no 'multiplySelf' in R65.
Could anybody tell me what I should do now? And in general, what is the best practice to resolve issues due to updated revisions in Three.JS? Thanks...
I would create different sandboxes with the different versions of three.js. As such, I would be able to move from one sandbox to another and testing my functions without contaminating my code. I call sandbox a folder whose name is distinctive per three.js version where I only keep functionality relevant to that release and I never mix sandboxes. Usually you would have to keep a copy of your code in each sandbox until all the translations from one release to the other have been performed.
In addition you can use code like: if (THREE.REVISION < 58) to separate the different versions of three.js in your code.

Resources