JCPalmer

Members
  • Content count

    2,213
  • Joined

  • Last visited

  • Days Won

    8

JCPalmer last won the day on January 5

JCPalmer had the most liked content!

3 Followers

About JCPalmer

  • Rank
    Advanced Member

Contact Methods

  • Twitter
    whoopstopia

Profile Information

  • Gender
    Male
  • Location
    Rochester, NY
  • Interests
    Power Napping

Recent Profile Visitors

3,303 profile views
  1. Too many uniforms for simple mesh

    Technically, I think the minimum # of uniforms that must be supported is 128, which is what iOS uses. Each bone matrix takes 4, so 24 * 4 - 128 leaves 32 for everything else. One thing you might do is reduce your max simultaneous lights for the material. In the Blender exporter, it is in the Mesh section, but it is applied on the materials for the mesh.
  2. Changes for Blender exporters

    As per my test of using ES6 classes which are sub-classes ES3 simulations of classes. It is safe to just change to ES6 without a switch for ES3.
  3. Blender exporter - isPickable flag

    What I meant by serializable is, will something in a .babylon file be used? Answer, yes. As far as default, it is True. Next week for both .babylon & .js exporters. Other changes here
  4. Blender exporter - isPickable flag

    I am in the process of updating the exporters. The javascript exporter will come first. I see no problem with doing this as long as this is serializable. In that case whatever is the default in BJS, will be the default in the python UI.
  5. Uglify for ES6

    "compilerOptions": { "module": "esnext", "target": "es6", "noImplicitAny": true, "removeComments": true, "declaration": true, "outDir": "./out" }, I do not show a 'es2018' for a target in my dropdown. Above is one of the last ones I tried. I double checked my version of tsc, which is 2.7.2. Thanks for pointing out that something is not right, even though I get the result I want. In fact, if I use 'system' as a module, then I can specify outFile & get everything I need already merged to 1 file. I am still using files to control order, but since I use references in all the .ts files, I am not sure I need to do this.
  6. Uglify for ES6

    Ok, I think you guys are talking about the ES6 module type. Where as I am talking about the ES6 Target type, where Typescript classes get transpiled into javascript classes, and basically everything in es6 EXCEPT modules. I actually tried to get Typescript modules to transpile into ES2015 modules, but still get this transpiled: var NameSpace; (function (NameSpace) { . . . }) (NameSpace || (NameSpace = {})); This is fine for me. I probably do not want to have to do imports anyway. My target environment is Cordova. I know Cordova uses Node to do its building, but I do not want to muck with that. I am making all my hand-built code in a separate area using typescript, then just doing a simple copy to the Cordova project's "www" directory to deploy. Pretty sure iOS & Android are good for most of ES6, but have not gotten ES6 code all the way through yet. The good news is, I just did a test against the current CDN (3.1.1) babylon. There I put a small script tag in the html for simplicity. This tag has an ES6 subclass of BABYLON.Mesh generated from Tower of Babel Blender exporter. It works fine! I have a constructor. It is calling super(), as well as setVerticesData() & setIndices(). The problem a few posts back was, I converted my QI extension to Target ES6, but had not modified the exporter from ES3, so probably an ES3 "faked" class cannot "fake subclass" an ES6 class. Here is the script tag from the test: var TEST; (function (TEST) { function CONTIG(array, offset, begin, end) { for(var i = 0, len = 1 + end - begin; i < len; i++) { array[offset + i] = begin + i; } } class Mesh extends BABYLON.Mesh { constructor(name, scene, parent = null, source, doNotCloneChildren) { super(name, scene, parent, source, doNotCloneChildren); this.setVerticesData(BABYLON.VertexBuffer.PositionKind, new Float32Array([ 1,-1,-1,-1,-1,1,1,-1,1,-1,1,1,1,1,-1,1,1,1,1,1,1,1,-1,-1,1,-1,1,1,1,-1,-1,-1,-1,1,-1,-1,-1,-1,-1,-1,1,1,-1,-1,1,1,-1,1,-1,1,1 ,1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,-1,1,-1,-1,1,-1,-1,-1,1 ]), false); let _i = new Uint32Array(36); CONTIG(_i, 0, 0, 17); _i.set([0,18,1,3,19,4,6,20,7,9,21,10,12,22,13,15,23,16], 18); this.setIndices(_i); } } TEST.Mesh = Mesh; })(TEST || (TEST = {})); var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true, { stencil: true }); var scene = new BABYLON.Scene(engine); new BABYLON.PointLight("Lamp", new BABYLON.Vector3(4.08,5.90,-3.98), scene); var camera = new BABYLON.UniversalCamera("Camera", new BABYLON.Vector3(7.48,5.34,-6.51), scene); camera.rotation = new BABYLON.Vector3(.46,-.81,0); scene.setActiveCameraByID("Camera"); new TEST.Mesh('name', scene); engine.runRenderLoop(function () { scene.render(); });
  7. I think I have enough to do a small update to the Blender exporters. Am thinking about dropping a couple of kind of obsolete features. Both of these are used in the very "involved" loop of reading a meshes geometry. Pulling these out would simplify this area. They are gone for sure in the source code generator, but input with regard to the JSON generator would be good. Remove the checking for, and splitting up of meshes with more than 64k vertices. This seems like an option which is becoming irrelevant. The code complexity involved actually spills into the caller too. Flat shading both for the mesh and the entire scene. It seems this can be replaced with SplitEdges modifier. This causes exports of fewer vertices. It is documented. Using as many features that Blender already has sounds advisable. As far as new stuff: Separate scene level control of # of decimals of scalable (positions) & non-scalable(everything else) geometry. Currently 4 decimals for all, but do you really need 4 decimals if your model is scaled in inches (micro-inches)? Hundredths of inches are probably not even going to be visible with an extremely close camera. 9999 possibilities in each dimension for a normal seems like overkill. My calculation blew out with 99993. Default for each would still be 4. ES3 / ES6 switch for source code generation. Better checking for un-applied transforms when using an armature. Thoughts?
  8. Uglify for ES6

    Sorry, I really need to read better. I found the es6.js file. Is it really es6 though? It has that __extends function? There are comments for the class syntax, so I am not sure you could really subclass anything in an es6 way. There was no announcement topic for this so I am wondering how this is es6 & what this file is for?
  9. Uglify for ES6

    Update: I have been able to use the ES6 capable uglify, giving very comparable results to the gulp tailored one. I used it against many of the Tower of Babel source generation files (currently ES3), & things work the same. The QueuedInterpolation module I have does transpile to ES6, and looks right. When I try use it with one of ToB source files, things go south though. I have not read anything that mixed between ES "levels". I am doing it 2 different ways: I am subclassing BABYLON.Mesh, BABYLON.Skeleton, BABYLON.Bone, BABYLON.ArcRotateCamera, & BABYLON.Action extending the QI versions. ToB is generating subclasses of QI.Mesh. The error that is tripped is TypeError: class constructors must be invoked with |new|. I do not know if this is going from BJS to QI, but if it is, then it is game over. I can always make the minor python changes to use ES6 syntax for ToB. Action is the smallest subclass. Here it is out of transpile: class SeriesAction extends BABYLON.Action { constructor(triggerOptions, _target, _eSeries, _clearQueue, _stopCurrentSeries, condition) { super(triggerOptions, condition); this._target = _target; this._eSeries = _eSeries; this._clearQueue = _clearQueue; this._stopCurrentSeries = _stopCurrentSeries; } execute(evt) { this._target.queueEventSeries(this._eSeries, this._clearQueue, this._stopCurrentSeries); } } I have a bad feeling that this is not going to work with the tightness of my integration to BJS. Also moving BJS to ES6 is more than I want to bite off right now. In conclusion, ES6 might work for some unless mixing is done. Overall, the move to Nebeans & dumping Gulp was very successful, but going to make a couple character change to tsconfig.json to not generate ES6.
  10. canAffectMesh in link from @Deltakosh (where the includedOnlyMeshes is evaluated) is in done in a loop of this.getScene().lights, so you need to make sure that lights with the includedOnlyMeshes are early in the array or all the slots could get filled up with lights that are too far away.
  11. I see nothing involving the .range of a light where they get bound. There is a _lightSources property of AbstractMesh. It can updated in. I would look into that first, cause I am not sure when / if this gets called. IncludeOnlyMeshes for each light seems like another way to go. If it helps, the max can also be changed at the material level. One thing I do is attach a point light to a camera, which moves / rotates to match the light to the camera in a scene.beforeCameraRender. This can really reduce the number of lights needed in the first place. Does a part of the scene really need to have a light when it is not on the frame.
  12. onProgress can't run second time

    Perhaps evt.lengthComputable is not evaluating to true. The refresh should also be much faster, since there is no network delay. I would make a counter which gets incremented in an else to the evt.lengthComputable if. Then in the success callback write the value to the console. You can then compare between runs. Does not fix, but being able to refine the issue at little cost is always of great importance. If right so far, then investigate the code behind lengthComputable in the repo. It may be that this is really a browser call. In that case, nothing is really doable by the framework. Do not tell anybody, but in that case just fake it. I can remember just incrementing manually a very small amount (not here), then when done shoot the value to 100% at the end. No one will every know.
  13. Uglify for ES6

    Fortunately I am not building node modules, webpacks, or browserify. I guess since I have the fallback of the es5 uglify, & it only takes a couple of keystrokes in the tsconfig.json file to fallback, I'll give es6 a chance. I also have the benefit of a number of working es3 modules, so I'll know right away to back off if it is not working. I can also isolate it to es6 or the uglify if the transpiled code works, but not after it run through uglify.
  14. Uglify for ES6

    I have begun migration of all my stuff away from Eclipse back to Netbeans. The support for the Eclipse Typescript add-in has not worked for a while. I have been using Gulp to actually do any building. Netbeans editor for Typescript is much better, & importantly being updated / improved. Cordova projects is also nicer. I always use Netbeans anyway until I needed to work with Typescript. Eclipse was very early out of the gate. with Typescript. While Netbeans does gulp commands from a cascading menu, since the typescript editor relies on a tsconfig.json file, I wanted to move away from gulp. Netbeans also runs npm scripts (in a scripts collection in a package.json file) from a menu as well. I only really need one liners like "tsc" & "uglifyjs". I was intending to transpile to ES6 (do not care about ie11), so I need an uglify which supports it. By far the most downloaded Uglify is https://www.npmjs.com/package/uglify-js. It notes that you should use https://github.com/mishoo/UglifyJS2/tree/harmony for ES6. The first thing I noticed is this repo link is not the master branch, hence the question, is it just a little too early for es6? Has anyone used this?
  15. [SOLVED] Blender to babylon.js issue

    A better place to change would be where hasUnAppliedTransforms is determined. I did quite follow all that work flow. An armature modifier can be on a mesh & exported where the parent is not also the armature, but I do not know how to get automatic weights that way. Perhaps, abs() could be used in the check to mitigate this -0 stuff. # ensure no unapplied rotation or scale, when there is an armature self.hasUnappliedTransforms = (self.scaling.x != 1 or self.scaling.y != 1 or self.scaling.z != 1 or (hasattr(self, 'rotation' ) and (abs(self.rotation .x) != 0 or abs(self.rotation .y) != 0 or abs(self.rotation .z) != 0)) or (hasattr(self, 'rotationQuaternion') and (abs(self.rotationQuaternion.x) != 0 or abs(self.rotationQuaternion.y) != 0 or abs(self.rotationQuaternion.z) != 0 or self.rotationQuaternion.w != 1)) )