Babylon3D: Standard Edition

Post your completed addons to share with the community

Post » Fri Dec 16, 2016 4:47 pm

@matriax No you just need to import the .OBJ file and its .MTL along with the pictures.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Fri Dec 16, 2016 5:08 pm

X3M wrote:@matriax No you just need to import the .OBJ file and its .MTL along with the pictures.


Yep, i imported the cube.obj, the cube.mtl and the cubewrap.png for de diffuse texture but not seems to work. The OBJ is loaded but not the texture.

I wonder if there is any way to add all the .OBJ info in the C2 layout object without import any file, since the textures can be added in the object as diffuse,bump,specular animations like we already do for NewMesh... and the .obj and .mtl are plain text and maybe copy and paste in to some field in the left tab property. So with that we can copy that object and paste in any project and will work.

I don't know if there will be any other solution to do that more easy.
B
23
S
10
G
3
Posts: 545
Reputation: 4,442

Post » Fri Dec 16, 2016 6:14 pm

@matriax Then your .mtl file is faulty, when you export an .obj model, Blender sets the directory url in which your pictures reside inside the .mtl file, so check your mtl file with notepad and make sure that the path link to the picture is absolut, like this : Rock-Texture-Surface.jpg

There should be no C:\User\Documtents... inside the file.
Read this : https://developer.blender.org/T28621
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Fri Dec 16, 2016 6:44 pm

@X3M Ops! You're right sorry! :S now works correctly.

Any chances to get the .OBJ file working only with the object in the C2 layout like i said? Adding the textures as in NewMesh objects and the .OBJ .MTL as text in some field or whatever?
B
23
S
10
G
3
Posts: 545
Reputation: 4,442

Post » Fri Dec 16, 2016 6:49 pm

@matriax Nah thats not practical
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Fri Dec 16, 2016 8:35 pm

X3M wrote:@matriax Nah thats not practical


Mmm... what about some options on NewMesh.Object?

New mesh properties
Type: Box, Torus... and add another called "Custom" on the list.

And at the end of the "New mesh properties":
[Custom] .Obj
[Custom] .Mtl

To add the text content of the .obj and the .mtl.

That's it!, because for NewMesh we already have the textures of diffuse,bump,etc.. on the object.

So, we can have a totally custom 3d model in a single object on the C2 layout, without import any file and easy to share or copy/paste between our projects or share with other people. I mean, if somebody shares their own models, if i want one simply copy and paste the object into my 3dlibrary.capx to use in the future.
B
23
S
10
G
3
Posts: 545
Reputation: 4,442

Post » Fri Dec 16, 2016 9:33 pm

@matriax Thats not how things work, its not as simple as you think.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Sat Dec 17, 2016 10:53 am

@X3M I guess, first C2 need to have the tools to give you the way to get the .obj/.mtl correctly from the field and after that find some way to get the code and build the files or a way to create the mesh using that information.

I know this is not simple, in fact maybe is impossible but with the things i saw how all works is the unique way i found to do that, but in my opinion can give us a more flexible way to work and do things.

1
Imagine i share my own library, if somebody like all the models i have on it, for example 50, they only have to select all, copy and paste in their own project and they will be ready to use.

2
Now we have to import the files: Obj+Mat+Texture maps. That can be 5 or more files for each model that we will have to organize in the imported files tab. After that we will have to create 50 OBJ.objects in the C2 layout and one by one set the correct name of the .OBJ or .JS model imported.

Also with the different libraries of the people they can have repeated the model/material/texture names so in that case we will have to rename it to Stairs1.obj, Stairs2.obj, stairs2.mtl, stairs2.png etc... a thing we avoid in the other way because there is no .obj/.mtl/ textures names.

And for manage add/remove models. We have to remove the object in the C2 layout and search in the imported files the ones associated.
B
23
S
10
G
3
Posts: 545
Reputation: 4,442

Post » Sat Dec 17, 2016 2:37 pm

Hey, hi X3M... i was thinking to some new features you could add int the next releases (if you think can be feasible and useful)
1) Billboard 2/3D sprites, that can be used for 2.5 games or other effects
2) Customizable pivot points in c2 image editor for meshes and other objects
3) XYZ axis debug helper and grid
What do you think? :)
B
23
S
7
Posts: 8
Reputation: 1,391

Post » Sat Dec 17, 2016 3:51 pm

@matriax It would've been possible if C2 had a text editor property. I really like the idea of a pasting text instead of loading external files, it would be awesome for people to share 3D models just by copying pasting stuff. But unfortunatly, for now, its not possible.
@vurzu 1) Sprites are already in my todo list.
2) I'll see if I can manage to do it. There must be someway to get the pivot XY from image editor.
3) Do you mean an axis helper on the C2 editor or while running the game ?
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 2 guests