Comments (9)
should be possible. I will look into it
Thanks
from babylonjs-editcontrol.
I figured it out. All you have to do is import babylon at the top of the .js file:
import * as BABYLON from 'babylonjs';
And then export the full path at the bottom:
export default org.ssatguru.babylonjs.component.EditControl;
Then you can import the control where you need it with:
import EditControl from '../lib/EditControl.js';
and use it as you would otherwise with:
var ctrl = new EditControl(mesh,camera, canvas, 0.75, false);
Thanks for doing this...
from babylonjs-editcontrol.
Nice.
I am still looking into how to package it into npm repository.
from babylonjs-editcontrol.
That would make things much easier...
from babylonjs-editcontrol.
I have added this to npm . See readme.
For now I am thinking of leaving this as vanilla "namespaced" JavaScript application.
Converting it to a nodejs or amd module, adds module system dependencies .
Doesn't webpack provide a way to add non-module third party apps?
from babylonjs-editcontrol.
It does, but not using the script tag. I've tried to get this working by using
import * as EditControl from 'babylonjs-editcontrol';
which is how you import Babylon. I had to edit the package.json adding the line:
"main": "dist/EditControl.js",
so webpack could find the right file, but the problem is that if the edit control doesn't add Babylon, webpack can't compile it (because BABYLON isn't defined).
from babylonjs-editcontrol.
The EditControl is not a module. It does not export anything and it does not import anything.
WebPack provides "exports-loader" and "imports-loader" to add exports and imports to such apps.
See if this works
var EditControl=require("exports-loader?org.ssatguru.babylonjs.component.EditControl!imports-loader?BABYLON=babylonjs!babylonjs-editcontrol/dist/EditControl");
you will, ofcourse, have to npm install the following
exports-loader
imports-loader
babylonjs
babylonjs-editcontrol
from babylonjs-editcontrol.
have added
"main": "dist/EditControl.js",
to the package json
from babylonjs-editcontrol.
new version adds module support
from babylonjs-editcontrol.
Related Issues (20)
- Scale and Trans bounds HOT 9
- Scale bounds behaves erratically when min bound is set to zero HOT 1
- Implement Rotation Bounds
- right hand coordinate system issue HOT 1
- scaling of planes, 2d object fails HOT 1
- scaling in all three axis together not uniform HOT 1
- right hand object in left hand system issue HOT 1
- setTransSnap (true) does not work if we do not add setTransSnapValue () HOT 1
- translate and scalar planar guides should move to face camera HOT 1
- translation and scaling in "all/any" directions works erratically HOT 1
- scaling along plane not intuitive HOT 1
- parent/child issue HOT 1
- handle mesh with non uniformed scaled parent HOT 1
- scaling is slow when switching from a large mesh HOT 1
- How can I get the scaling values? HOT 1
- editControl.setTransSnapValue doesn't work in sample-global HOT 1
- Different designs for TwoAxisDraggingButtons (triangles, rectangles)? HOT 1
- Editor tools interfering with bounding box + re-sizing when camera moves HOT 10
- Trouble compiling from typescript HOT 5
- Update during transform HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babylonjs-editcontrol.