Babylon3D: Standard Edition

Post your completed addons to share with the community

Post » Thu Dec 08, 2016 8:11 pm

X3M wrote:
@gamecorpstudio The vertex morphing can only be used with the new created meshes because the meshes that are loaded inside a scene have their matrices locked by the 3D editor, I will add examples later


so that means, if i clone a material and morph that one the vertices should work with morphing with that one?

also i noticed, if i clone a box for example, i played with the last example myself also, the one with the wall, and i cloned a box from there, i took the one with name Box and cloned it 10 times on scene loading, everything worked perfect, but ...

when i tried to modify their scale size it didn't work for the clones, i can alter their position or colors by calling them all Crates collectively that means every Crate object wold do the changes, just the new ones, dont rescale they just react to position and color change... do i need to enable them or something? also i did enabled the mesh after creation so should work, but sadly it doesn't. am i missing something?

also if i try to pick the new clones by the name Box since their a clone of the initial crate with mesh name Box, they are not picked, are they getting a sequence number or something when created? or are they set on default to Box001?

take your time, the progress so far is amazing, i cant wait to get some Audio Analyser Demo done with it, its already taking shape :D hehe reacts awesome to music beat rates. and Performance is just incredible i dont brake under 60FPS no mater what i do. its perfect.
B
75
S
22
G
68
Posts: 1,335
Reputation: 43,267

Post » Thu Dec 08, 2016 9:24 pm

@gamecorpstudio You should follow a certain method in order to clone objects, well I forgot to mention that all the plugins can be used together in a single project , let me explain :
To clone a mesh, you need two things , your mesh (Can be New Mesh , Obj-Js Mesh or a loaded scene Mesh ) and a loaded scene Mesh.
1- The loaded scene Mesh will serve as a container for our clone, so you should give it the name of your clone .
2 - Then you add the function Clone Mesh and you set the name parameter as the same of your loaded scene Mesh.
3 - Every behavior that the loaded scene Mesh has will apply to the clone.
In other words your clone will be the loaded scene Mesh which was emply first.
You can also use the Mesh Array plugin instead of the loaded scene Mesh one when you wanna make dozens of clones, but the C2 behaviors will not work , only the Babylon ones will be applied. You will need to set :
Code: Select all
global var boxcount = 0
For from 0 to 50 with index = boxcount
Clone mesh [Box] clone name "Box"&boxcount
End For

The MeshArray should be Box[0-50]

As for picking, the clones Pickable state are set to false by default, you should enable their Picking state.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Fri Dec 09, 2016 11:28 pm

@X3M hi, i wanted to ask you, is it possible instead of doing all those cloning stuff, just to add a name input for the newmesh type?

This is more of a request then a suggestion since only makes sense in having it and many i guess wold agree:

like for instance... at the moment, if i want to create multiple newmesh instances, they all have the same name, and the name of them it only can be changed using the clone array, or by placing duplicates in the screen and change it manually, but ... wouldn't be much simpler to just add a expression ... set name? i mean that wold drop the need of cloning... plus cloning a mesh with the array has weird issues, you will have as you shown to run loops every tick in order to move them, which are very cpu intensive if you plan on hording around 200 objects and add some weird effects to them.

hope you understand what im talking about!


P.S the Set name parametter is already there - in the object settings left side ... you only need to place it inside the object.expression so we can call it with conditions, to our needs.
B
75
S
22
G
68
Posts: 1,335
Reputation: 43,267

Post » Fri Dec 09, 2016 11:46 pm

@gamecorpstudio The library does not allow having several meshes with the same name, the names should be different.
Even in C2 you don't get any control over clones sprites for example, so I would be more than happy if there was a simple way to clone instances and at the same time get a reference of them , at least it is doable with the method I've sent you. But does C2 have a better way ?

P.S: If by name you mean the mesh name , there is the expression : Mesh.Name
Waiting for your suggestion
Image
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Sat Dec 10, 2016 12:19 am

X3M wrote:

P.S: If by name you mean the mesh name , there is the expression : Mesh.Name
Waiting for your suggestion
Image


the image you are showing is again... about the Clone objects, im not talking about the Clone name...

i am creating the same New Mesh using the System expression Create... while i do that the new mesh is created multiple times...

but i cant rename their names... their names being the same as the one set in the settings
Image

i was saying the name from properties to be able to be changed... using Actions

this wold cut off the hustle with cloning. you just create new sprites of the same instance basically and just rename them ... same as you wold normally do if we wold drag and drop the same object and rename the properties value.

you get me?

look at the following image i just placed the same object manually in the screen by hand... and renamed each of them by hand... changing their properties name... now what im asking is ... can the properties name be set form the expressions? that wold cut off the cloning process using the mesh.array or other placeholder.

Image
B
75
S
22
G
68
Posts: 1,335
Reputation: 43,267

Post » Sat Dec 10, 2016 12:28 am

@gamecorpstudio How are you going to the change the name of something that is not returned ? System->Create Object does not give any clue about the new instance.
I understand what you're trying to do, that can be easily done with the Mesh->Clone Mesh , you just have to pass the name, like in your example :
var count = 0
Repeat 100 Times
{
/////////////////////////New name, X , Y , Z
Mesh->Clone mesh(count,count*100,0,0) // Put clones at X interval of 100
System->Add to(count,1)
}

You get me ? Your clones are named 0 , 1 , 2 etc...
How is System->Create object is going to give you a reference to the created mesh ? Since you want to change its name

But of course I will add that possiblity in next version
Last edited by X3M on Sat Dec 10, 2016 12:33 am, edited 1 time in total.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Sat Dec 10, 2016 12:32 am

simple duplicating capx

manual duplicating

i understand that... the thing is ... you already have implemented the SetMesh Name... in the properties... is it possible to just add that as a expression?


for example


Code: Select all
this is my 100 loopcount  condition : 
                Action -  Systemexpression   create newmesh at x y
                Action - NewMeshObject - Set: NewMesh.Name to "box"&loopindex


same as you wold do for the clone array... but for the self NewMesh.Name


i think i need to record a video so you can understand properly or show it to you via skype or something. all the expressions i want is there... its a matter of enabling the properties name into a expression input


why im asking this is because

if you clone the mesh... the new named mesh you have to run a loop so you can pick them and make them do something


while if you only change their name directly ..when its duplicated... then its acting like a family object.. and its reacting to everything u tell it to do, without having to run a loopindex to pick them up... which has its own limitations, and eats a lot of resources.
B
75
S
22
G
68
Posts: 1,335
Reputation: 43,267

Post » Sat Dec 10, 2016 12:55 am

Do you mean a Function or an Expression :
- Expression means : Alert(Mesh.Name)
- Function means : Set mesh name to ("Box")

Yes whatever that is I will add it.
Banned User
B
17
S
7
G
23
Posts: 388
Reputation: 13,994

Post » Sat Dec 10, 2016 1:15 am

X3M wrote:Do you mean a Function or an Expression :
- Expression means : Alert(Mesh.Name)
- Function means : Set mesh name to ("Box")

Yes whatever that is I will add it.



Yea i meant Function... if that is the one that alters the Mesh Name.
something like the bellow image... i just cloned a function in the action common.js just its not linked to anything so errors all over the place.

Image

the above image should change the bellow value

Image
B
75
S
22
G
68
Posts: 1,335
Reputation: 43,267

Post » Sat Dec 10, 2016 3:38 am

aw snap! that looks nice!
B
18
S
5
Posts: 35
Reputation: 1,127

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest