rikrik527

Members
  • Content Count

    6
  • Joined

  • Last visited

  1. rikrik527

    webpack loading babylon file trouble

    i am sorry , i have github , its here https://github.com/rikrik527/heroku-yushan-li the 3d model is in the src /app /babylon/Dude i am studying babylon and stuck on loading 3d model with webpack after importing the model error log this babylon.js?0ab6:35 Uncaught TypeError: o._addPendingData is not a function at Function.i.ImportMesh (babylon.js?0ab6:35) at createScene2 (app.js?11ea:44) at Object.module.exports.Game (app.js?11ea:22) at eval (index.js?9bdc:58) at Object.<anonymous> (shanli.bundle.js?bdd3d48eab09f8f92a18:1) at m (shanli.bundle.js?bdd3d48eab09f8f92a18:1) at l (shanli.bundle.js?bdd3d48eab09f8f92a18:1) at Object.<anonymous> (shanli.bundle.js?bdd3d48eab09f8f92a18:1) at m (shanli.bundle.js?bdd3d48eab09f8f92a18:1) at shanli.bundle.js?bdd3d48eab09f8f92a18:1 i.ImportMesh @ babylon.js?0ab6:35 createScene2 @ app.js?11ea:44 module.exports.Game @ app.js?11ea:22 (anonymous) @ index.js?9bdc:58 (anonymous) @ shanli.bundle.js?bdd3d48eab09f8f92a18:1 m @ shanli.bundle.js?bdd3d48eab09f8f92a18:1 l @ shanli.bundle.js?bdd3d48eab09f8f92a18:1 (anonymous) @ shanli.bundle.js?bdd3d48eab09f8f92a18:1 m @ shanli.bundle.js?bdd3d48eab09f8f92a18:1 (anonymous) @ shanli.bundle.js?bdd3d48eab09f8f92a18:1 (anonymous) @ shanli.bundle.js?bdd3d48eab09f8f92a18:1 maybe its because i should upgrade my webpack? because its only version 2 ?
  2. rikrik527

    webpack loading babylon file trouble

    brianzinni what is rootURL
  3. rikrik527

    webpack loading babylon file trouble

    is other file type like obj etc different than babylon file?
  4. rikrik527

    webpack loading babylon file trouble

    i get this after i use import 'babylonjs-loaders' babylon.js?0ab6:36 GET http://localhost:8080/Dude/dude.babylon.manifest?1538105830756 404 (Not Found) t._checkManifestFile @ babylon.js?0ab6:36 t @ babylon.js?0ab6:36 i._loadData @ babylon.js?0ab6:35 i.ImportMesh @ babylon.js?0ab6:35 createScene2 @ app.js?11ea:42 module.exports.Game @ app.js?11ea:22 (anonymous) @ index.js?9bdc:58 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 m @ shanli.bundle.js?782050f335416b1f2bdf:1 l @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 m @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 babylon.js?0ab6:4 GET http://localhost:8080/Dude/dude.babylon 404 (Not Found) s @ babylon.js?0ab6:4 d @ babylon.js?0ab6:4 t.LoadFile @ babylon.js?0ab6:4 b @ babylon.js?0ab6:35 i @ babylon.js?0ab6:36 (anonymous) @ babylon.js?0ab6:36 load (async) t._checkManifestFile @ babylon.js?0ab6:36 t @ babylon.js?0ab6:36 i._loadData @ babylon.js?0ab6:35 i.ImportMesh @ babylon.js?0ab6:35 createScene2 @ app.js?11ea:42 module.exports.Game @ app.js?11ea:22 (anonymous) @ index.js?9bdc:58 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 m @ shanli.bundle.js?782050f335416b1f2bdf:1 l @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 m @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 babylon.js?0ab6:4 BJS - [11:37:10]: Unable to import meshes from ./Dude/dude.babylon: Failed to load scene. t._ErrorEnabled @ babylon.js?0ab6:4 f @ babylon.js?0ab6:35 (anonymous) @ babylon.js?0ab6:35 p @ babylon.js?0ab6:4 XMLHttpRequest.send (async) s @ babylon.js?0ab6:4 d @ babylon.js?0ab6:4 t.LoadFile @ babylon.js?0ab6:4 b @ babylon.js?0ab6:35 i @ babylon.js?0ab6:36 (anonymous) @ babylon.js?0ab6:36 load (async) t._checkManifestFile @ babylon.js?0ab6:36 t @ babylon.js?0ab6:36 i._loadData @ babylon.js?0ab6:35 i.ImportMesh @ babylon.js?0ab6:35 createScene2 @ app.js?11ea:42 module.exports.Game @ app.js?11ea:22 (anonymous) @ index.js?9bdc:58 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 m @ shanli.bundle.js?782050f335416b1f2bdf:1 l @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 m @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1 (anonymous) @ shanli.bundle.js?782050f335416b1f2bdf:1
  5. rikrik527

    webpack loading babylon file trouble

    i get this Uncaught TypeError: o._addPendingData is not a function at Function.i.ImportMesh (babylon.js?0ab6:35) at createScene2 (app.js?11ea:42) at Object.module.exports.Game (app.js?11ea:22) at eval (index.js?9bdc:58) at Object.<anonymous> (shanli.bundle.js?782050f335416b1f2bdf:1) at m (shanli.bundle.js?782050f335416b1f2bdf:1) at l (shanli.bundle.js?782050f335416b1f2bdf:1) at Object.<anonymous> (shanli.bundle.js?782050f335416b1f2bdf:1) at m (shanli.bundle.js?782050f335416b1f2bdf:1) at shanli.bundle.js?782050f335416b1f2bdf:1 after i use import * as a from 'babylonjs-loaders' a.SceneLoader.ImportMesh('him','./Dude/Dude.babylon',scene,function( newMeshes,particleSystems,skeletons){ newMeshs[0].position = new BABYLON.Vector3(0,0,5) scene.beginAnimation(skeleton[0],0,120,1.0,true)})
  6. i am using webpack and i try to load 3d model for babylonjs here is how i write the code , i require it after i require it ,the images files can not be shown also, i have tried this and that SceneLoader.loader or SceneLoader.ImportMesh and i have npm install --save babylongjs-loaders also but ican not load 3d model i am stucked here help BABYLON.SceneLoader.ImportMesh("him",require('./Dude/dude.babylon'), scene, function (newMeshes, particleSystems, skeletons) { newMeshes[0].position = new BABYLON.Vector3(0, 0, 5); // The original dude scene.beginAnimation(skeletons[0], 0, 120, 1.0, true); }) the error log is Uncaught TypeError: o._addPendingData is not a function at Function.i.ImportMesh (babylon.js?0ab6:35) at createScene2 (app.js?11ea:42) at Object.module.exports.Game (app.js?11ea:22) at eval (index.js?9bdc:58) at Object.<anonymous> (shanli.bundle.js?e7156e9c7a7b9cbf4463:1) at m (shanli.bundle.js?e7156e9c7a7b9cbf4463:1) at l (shanli.bundle.js?e7156e9c7a7b9cbf4463:1) at Object.<anonymous> (shanli.bundle.js?e7156e9c7a7b9cbf4463:1) at m (shanli.bundle.js?e7156e9c7a7b9cbf4463:1) at shanli.bundle.js?e7156e9c7a7b9cbf4463:1 my webpack is webpack 2.7.0 i have also npm install --save babylon-file-loader my webpack.config.js const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const webpack = require('webpack'); const autoprefixer = require('autoprefixer'); const PurifyCSSPlugin = require('purifycss-webpack'); const glob = require('glob-all'); module.exports = { devtool: 'inline-source-map', context: path.resolve(__dirname, './src'), entry: { shanli: ["./app/index.js"] // 'vendor': ['./app/index.js'] }, output: { path: path.join(__dirname, 'public', 'assets'), filename: 'js/[name].bundle.js', publicPath: '/public/assets/' }, externals:{ oimo:'OIMO', cannon:'CANNON', earcut:'EARCUT' }, module: { rules: [{ test: /\.css$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: ['css-loader', 'postcss-loader'], }), }, // { // test: /\.(scss)$/, // use: [{ // loader: 'style-loader', // inject CSS to page // }, { // loader: 'css-loader', // translates CSS into CommonJS modules // }, { // loader: 'postcss-loader', // Run post css actions // options: { // plugins: function () { // post css plugins, can be exported to postcss.config.js // return [ // require('precss'), // require('autoprefixer') // ]; // } // } // }, { // loader: 'sass-loader' // compiles SASS to CSS // }] // }, { test: /\.scss$/, loader: ExtractTextPlugin.extract({ fallback: 'style-loader', use: ['css-loader', 'sass-loader', 'postcss-loader'], }) }, { test: /\.(js|jsx)$/, exclude: /node_modules/, use: [{ loader: 'babel-loader', options: { presets: [ ['es2015'] ] } }] }, { test: /\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp3|wav|mp4)(\?.*)?$/, use:[ { loader: 'file-loader', query: { name: 'images/[name].[ext]?[hash]' } },{ loader:'img-loader' } ], },{ test: /\.babylon$/, use: [ { loader: 'babylon-file-loader', query:{ name:'models/[name].[ext]?[hash]' } } ] }, { test: /\.(mp4|webm|wav|mp3|m4a|aac|oga)(\?.*)?$/, loader: 'url-loader', query: { limit: 10000, name: 'media/[name].[ext]?[hash]' } }, { test: /\.json$/, loader: 'json-loader', query: { name: 'models/[name].[ext]?[hash]' }, }, ] }, devServer: { overlay: true, proxy: { '/web': { target: 'http://localhost:8000', pathRewrite: {'^/web': ''} } }, contentBase:path.resolve(__dirname,'./public/assets/html'), headers:{ 'Access-Control-Allow-Origin':'*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Headers': 'X-Requested-With, content-type' } }, node:{ fs:'empty' }, plugins: [ new webpack.LoaderOptionsPlugin({ options: { minimize: true, postcss: [ autoprefixer({ browsers: ['last 2 version', 'Chrome >=49', 'Firefox >=49', 'Edge >= 11', 'ie >= 9'] }), ] } }), new HtmlWebpackPlugin({ title: 'shanli', minify: { removeComments: true, collapseWhitespace: true, removeRedundantAttributes: true, useShortDoctype: true, removeEmptyAttributes: true, removeStyleLinkTypeAttributes: true, keepClosingSlash: true, minifyJS: true, minifyCSS: true, minifyURLs: true, collapseWhitespace: true }, hash: true, inject: true, template: './template/index.html', //load custom template .ejs by default. filename: 'html/index.html', chunks: ['shanli'] }), new webpack.optimize.UglifyJsPlugin({ test: /(\.jsx|\.js)$/, minimize: true, sourceMap: true, compress: { sequences: true, dead_code: true, unused: true, warnings: false, screw_ie8: true, conditionals: true, comparisons: true, evaluate: true, if_return: true, join_vars: true }, compressor: { warnings: false }, output: { comments: false } }), new ExtractTextPlugin({ filename: 'css/[name].bundle.css', disable: false, allChunks: true, }), new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery", "window.jQuery": "jquery" // Popper:['Popper.js', 'defalut'] // in case you imported plugins individually, you must also require them there ; }), new webpack.HotModuleReplacementPlugin(), new webpack.NoEmitOnErrorsPlugin() ] }