Jump to content

Online assets converter


Dad72
 Share

Recommended Posts

It would be possible to have the sources of the converter for use in local?
I would like to be able to generate the files .Babylon and stored in a specific folder automatically.

It is for an editor, I would like that the user imports a file .fbx and it is automatically converted to the destination folder.

 

Thanks

Link to comment
Share on other sites

Hi dad72, 

 

Do you want to: 1) create a local web app similar to the online creator, or 2 ) are you just looking for a way to automatically convert your .fbx files to .babylon without the need to create a web app ?

 

For 1) : Deltakosh suggests to open the visual studio project you can retrieve from github.

For 2) : You can download the zip file BabylonExport.zip here : https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/FBX%20-%20OBJ

Extract the zip file somewhere on your computer, you will find a file named BabylonExport.exe. This executable takes two arguments : the .fbx you want to convert and the folder where the .babylon will be produced.

For example, open a Windows console (start -> run -> cmd), and try the following command : 

cd <babylon_path>BabylonExporter.exe /i:"<path_to_fbx>\myScene.fbx" /o:"<output_path>

Your fbx will be converted to babylon format (if everything is correct on your scene :) )

You can do this automatically by creating a .bat (on windows) and call this previous command line with the right parameters.

 

If you want me to be more precise, I can create a full tutorial on this part. Just ask me !

Link to comment
Share on other sites

Hi Temechon.

 

Thanks for help.

I am seeking a way to create an HTML page or i want to import a file .fbx and when I submit the form, it converted the file in .Babylon. As the online converter.
Your command line is for Windows, me I would like to do this via a web interface.
I want to well a tutorial if you please.

Thanks

 

------------------------

Salut Temechon

 

Merci pour l'aide.

Je cherche un moyen de créer une page html ou je veux importé un fichier .fbx et quand je soumets le formulaire, cela convertie le fichier en .babylon. Comme le convertisseur en ligne.
Votre ligne de commande est pour Windows, moi je souhaite le faire par une interface web.
Je veux bien un tutoriel s'il vous plaît.

Merci

Link to comment
Share on other sites

Indeed, the web application sources are not in the Github project... But basically, you will just have only one class that unzip the uploaded file in a temporary folder, call the BabylonExporter.exe located on your server, and zip the output babylon file.

 

Maybe Deltakosh can provide you with the source.

Link to comment
Share on other sites

Thank You Temechon.
Yes, it would be well indeed. That is what I was wondering at the opening of the subject.

@Deltakosh: it is possible to offer me the sources of Web application ( online converter) please? As confirmed by Temechon, this source of Web applications is not available. It is that which I asked you at the beginning of this topic. I may be poorly explained. :(

 

Thank you in advance

Link to comment
Share on other sites

hi,

 

The website is only a static html page connected to API

<form name="form1" method="post" action="converter" enctype="multipart/form-data"><input name="myFile" type="file" />        <input type="submit" value="Upload" /></form>

The MVC API Controler in C# used a pipe to connect to console running App on server session open

public class ServiceProxy : ClientBase<IService>    {        public ServiceProxy()            : base(new ServiceEndpoint(ContractDescription.GetContract(typeof(IService)),                new NetNamedPipeBinding(), new EndpointAddress("net.pipe: / / localhost/exportservice")))        {        }        public bool InvokeConvert(string file, string outputName)        {            return Channel.Convert(file, outputName);        }    }
Link to comment
Share on other sites

Hi and thank You pierlag.

I think I will do otherwise. I will use a .bat file like this:

set curdir = %CD%BabylonExport.exe  /i:"Assets\A_convertir\epee.fbx" /o:"Assets\Convertis"

By against another question. When we converted a fbx file in .Babylon, the images are rename in 1.png, 2.png, 3.png ...

Why the names of the images does not remain appointed as they are?

 

Thanks

 

 

Link to comment
Share on other sites

No, when I converted my file .fbx, all the textures have been copied to the destination folder and renamed.

 

sw_dusk&down.dds -> après la conversion 1.jpg

wp_blade01.dds -> after conversion 2.jpg

wp_hilt04.dds -> after conversion 3.jpg

 

May be that the character _ and & renames the images (just an idea)

Link to comment
Share on other sites

You can use PHP to execute whatever program you want on your server. Just upload the files to whatever directory you want, then call a shell / comand line function from PHP to convert the files.

 

French: http://us3.php.net/manual/fr/book.exec.php

 

If your server is running something other than windows, you would need to tweak the conversion program to run on your web server's distro.

Link to comment
Share on other sites

My serveur is Linux. But I have abandoned this idea.

 

My problem now :  when I converted my file .fbx, all the textures have been copied to the destination folder and renamed.

 

sw_dusk&down.dds -> après la conversion 1.jpg

wp_blade01.dds -> after conversion 2.jpg

wp_hilt04.dds -> after conversion 3.jpg

 

May be that the character _ and & renames the images (just an idea)

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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