Babylon3D: Standard Edition

Post your completed addons to share with the community

Post » Sat Dec 17, 2016 4:14 pm

1)/2) Great!
3) I mean an axis helper on running the game as in Q3D plugin
B
23
S
7
Posts: 8
Reputation: 1,391

Post » Sat Dec 17, 2016 9:21 pm

@X3M I'm testing out skeletal animations. Currently, it's a lot of trial and error because I have no idea what the setup procedure in C2 is:
1. Camera --> (Babylon Animation) Begin animation?
2. Mesh --> (Babylon Animation) Begin animation?
3. Mesh + (Behavior) Skeleton --> (Babylon Skeleton) Begin animation range?
4. Scene + (Behavior) Skeleton --> (Babylon Skeleton) Begin animation range?

For now I get JS errors and assume my procedure is totally wrong. I think the armature and animation names I had defined in the .babylon file is probably right as I had checked the animation range, name entries etc. in Notepad ++ and they do exist.

Question: Do you have a quick and dirty .capx to show how animated-meshes are setup for playback?

Meanwhile, I'll go and read up how it's done using pure BabylonJS to get an idea, but it must be quicker if you just summarized the procedure.
I don't need a better iPhone, I need to be better.
B
26
S
10
G
20
Posts: 68
Reputation: 11,913

Post » Sat Dec 17, 2016 10:12 pm

@fuego96 I can't share anything right now because we don't have the same version.
It's simple, you create an animation range (ex: "Walk" from 0 to 20) And then you play it using Begin animation range.

If you have multiple ranges (ex: "Walk" from 0 to 20 and "Run" from 21 to 40) , then you should activate blending before playing the animations.
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Sat Dec 17, 2016 10:51 pm

X3M wrote: ...It's simple, you create an animation range (ex: "Walk" from 0 to 20) And then you play it using Begin animation range...


So, am i right in adding the Skeleton behavior to the Scene object?
It doesn't seem right to add it to Mesh objects (the browser gives a "could not find the skeleton property of null" sort of error).

As with your explanation, the "Create animation range" bit was easy to figure out, but I get:
Image

I am also not confident if my babylon data is sane. Would you mind taking a look?
http://crxmedia.com/test/ss/worm.babylon

Basically, the file does have a "skeletons" property which is an array of objects. Each object does indeed have bones and each bone has 30 frames (so, range from 0 to 30). And at the end of the "skeletons" property, there is a "ranges" property (defined in Blender) named "MoveForward".

So I also assumed that the "Create animation range" can also refer to "MoveForward" that was defined in Blender. Is that right?
Image

Btw, worm.babylon look like this.
Image

If that's the babylon file is sane and my process was right, then perhaps I just need an updated version of B3D :-)
Last edited by fuego96 on Thu Feb 09, 2017 4:23 am, edited 2 times in total.
I don't need a better iPhone, I need to be better.
B
26
S
10
G
20
Posts: 68
Reputation: 11,913

Post » Sat Dec 17, 2016 10:59 pm

@fuego96 The Skeleton Behavior should be applied to a Mesh , look at the picture :
Image
Every behavior belongs to a category.

1- Create a mesh instance for the worm
2- Apply a skeleton behavior to the mesh
3- Create animation range
4- Play it

Whats the name you have given to the worm mesh ?
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Sat Dec 17, 2016 11:28 pm

X3M wrote:1- Create a mesh instance for the worm
2- Apply a skeleton behavior to the mesh
3- Create animation range
4- Play it


I saw that the Skeleton behavior belonged to a mesh category (which is why i said that it kinda' didn't make sense during my tests).

The reason for saying this is that the SkeletonCreateAnimRange function needed to access the mesh.skeleton data. A null value was being returned, thus throwing the JS error, meaning that the mesh object (of mesh.skeleton) needed to refer to the root level of the model file as the "skeletons" property resided there.

Strange that the Scene object, which already has the full model data to begin with, couldn't simply be re-used (note that I prefer loading an entire scene with models, anims etc.). The above solution only loads an instance of the worm.js file into a separate OBJ-JS Mesh so as to circumvent the JS error.

Anyway, I'll take that solution (maybe). Many thanks!
Testing...
Last edited by fuego96 on Sun Dec 18, 2016 12:18 am, edited 1 time in total.
I don't need a better iPhone, I need to be better.
B
26
S
10
G
20
Posts: 68
Reputation: 11,913

Post » Sat Dec 17, 2016 11:53 pm

X3M wrote:Whats the name you have given to the worm mesh ?


@X3M The mesh names are from the green tip with the eyes to the blue tail:
cy0, cy1, cy2, cy3, cy4, cy5

All of them are children of "Armature".

Image
Last edited by fuego96 on Thu Feb 09, 2017 4:23 am, edited 1 time in total.
I don't need a better iPhone, I need to be better.
B
26
S
10
G
20
Posts: 68
Reputation: 11,913

Post » Sun Dec 18, 2016 3:57 am

matriax wrote:
This time i'm not was talking about clone objects in realtime and control them, i guess you refer to gamecorpstudio. I'm talking about duplicate objects in the C2 layout to create my level from scratch and after that in events set actions that affects to all the duplicates, that can be items like coins, diamonds,etc... without use MeshArrays, loopindex, duplicate events and all that.

As you can see in the video i have in the C2 layout a level designed with duplicated items to pick. This trick only works for NewMesh.Objects not for cloned in realtime or scenes from 3D editors, as i said i prefer do all in C2 also i guess will works for Obj-Js.mesh or i hope.


i was talking about duplicates also. maybe i talked weird.


(but live duplicates in B3D is made with mesh.array thats what i was trying to say. i can work with it no problem, its still low resource consumption, just its better to have individual duplicates in stead of clones. (they sound the same, they are not entirely))
B
77
S
23
G
69
Posts: 1,353
Reputation: 43,958

Post » Sun Dec 18, 2016 10:27 am

@gamecorpstudio The clones issue is solved in 0.6, you can now duplicate meshes from the C2 event using System->Create object
@fuego96 Well I've noticed two things :
1- The worm.babylon is a scene file and not a single model file, when opened, I saw a camera and a light alongside the skeleton, which should not be the case for a single mesh.
2- Armature or Skin rigging should be applied to one mesh which should have a name so you could reference it in C2.

I'll post examples as soon as I upload 0.6
Banned User
B
17
S
7
G
24
Posts: 388
Reputation: 14,494

Post » Sun Dec 18, 2016 10:36 am

X3M wrote:@gamecorpstudio The clones issue is solved in 0.6, you can now duplicate meshes from the C2 event using System->Create object


that is awesome :D cant wait to see what was deprecated or what was improved uhuu :D
B
77
S
23
G
69
Posts: 1,353
Reputation: 43,958

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests