Jump to content

How To Start/Debug on BJS.


Recommended Posts


As I have seen quite a few times questions about setting up the dev environment and how to debug typescript and so on, I Changed a bit the dev process in th repo (for good I hope :-) )

You can find the entire doc here: http://doc.babylonjs.com/generals/how_to_start

It is mostly explaining how to use VSCode, but you could use any editor suporting chrome debugging. The number of steps after installing the tools is really short:

  1. npm install
  2. run the test task
  3. press f5

This helps debugging both typescript and javascript on Chrome directly from breakpoint in vscode. This includes watchers and webserver hook for you on VsCode.

Do not hesitate to try it, give feedback, and update the doc.



Link to comment
Share on other sites

Your doc shows many things i did not know. Am attempting to use Windows 10 (but have to disable NVidia 960 driver or lose signal).  If that is fixable would allow testing with Edge.  Some questions though:

  • You illustrate with Visual Studio Code & Cmder.   Do those 2 play together?  I get "It looks like git is not installed on your system" in VSC.  If git is only available from Cmder this way, would it not be better to do git-scm.com and the smaller Cmder?   I like the unix syntax coming from ubuntu /  OSX, having to everything with git as command-line is tedious though.
  • I am not sure I can use VSC though.   I added the Python add-in, but if I have to make the Blender zip file by leaving, I'll need to stick with Eclipse.  I have built that zip more times in one day then I would like to admit.  I see there is a .vsccode directory with tasks described in the repo.  Not sure how you would even trigger them in VSC, but can there be other tasks to build other things like the Blender & 3DSMax zip files.  I cannot even figure out how to register the intellisense to use babylon.d.ts.  That is simple with the Eclipse Typescript plugin.  This is my ANT script I run from Eclipse.  It  could be simplified if the scr directory were just renamed to  "bablyon-js"
<?xml version="1.0" encoding="UTF-8"?>
<project name="zipper">
	<property name="version" value="5.1"/>
	<property name="mountPoint" value= "/js-dev"/>
	<property name="project"    value= "${mountPoint}/Babylon.js"/>
	<property name="blender"    value= "${project}/Exporters/Blender"/>
	<property name="src"        value= "${blender}/src"/>
	<property name="temp-dir"   value= "${blender}/temp"/>
	<property name="BJS-dir"    value= "${temp-dir}/babylon-js"/>
    <!-- ===================== Minify Section ============================ -->
    <target name="make-zip">
        <delete dir="${BJS-dir}" quiet="true"/>
        <delete dir="${temp-dir}" quiet="true"/>
        <mkdir  dir="${temp-dir}"/>
        <mkdir  dir="${BJS-dir}"/>
        <copy todir="${BJS-dir}">
        	<fileset dir="${src}"/>
    	<zip destfile="${blender}/Blender2Babylon-${version}.zip" basedir="${temp-dir}" level="9"></zip>
        <delete dir="${BJS-dir}" quiet="true"/>
        <delete dir="${temp-dir}" quiet="true"/>



Link to comment
Share on other sites

I use locally both cmder and VScode, but you could do with only one of them, it is really a question of preference as they are only launching commands. yep agree for git-scm but still with the bigger cmder cause as it is portable, sync the folder and you can use it on any machines in case of need ;-) Could you do a PR on the doc ?

All the task from gulp are available but you ll need to use the gulp launcher cause VSC does not support mixed command so far (it is on their list for soon). About intellisense, we have it everywhere in VSC for ts and js. We usually have a ref to the .d,ts and you can add a typescript config file to your folder

/// <reference path="../../dist/preview release/babylon.d.ts"/>



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...