MackeyK24

Cloning Changes In Beta 3.1

Recommended Posts

Has anyone been changing the BabylonJS Codebase that has to do with cloning or physics engine and may maybe abstract meshes... Something.

I had a Space Shooter Demo Game (Some Have Seen It) all the Ships and Enemies were all being instantiated at runtime (Basically I clone a whole Mesh Hierarchy).

If I just switch to the latest and greatest beta... Now none of ships or laser bolts or anything are visible... They show up in the mesh list (also the physics collision not working, problem because of something in the cloning... Dunno)

Can you please tell me WHAT changed so I can try and redo the runtime instantiation. Its alot of work being there and now, something changed... I can fix it if I know what :)

 

Update... Solved... I think... Will have to hammer at it once some of the 3.1 beta performance and cannon.js issues are fixed

Share this post


Link to post
Share on other sites

Its something to do the clones and isEnabled.

If the the source of the clone (and all its children) has isEnabled = false;

after I make cloned (with all children) I loop thru and set child.setEnabled(true)...

but the clones (including children) all still stay isEnabled = false;

Has Somebody been nothing with cloning and the isEnabled ???

Share this post


Link to post
Share on other sites

No I cant really reproduce the whole toolkit instantiatePrefab on the playground.

But I will try to come with something to show... SOMEBODY changed SOMETHING to do with setEnabled and cloning... Maybe not directly changed the cloning, but some consequence of those changes just killed my cloning.

What I found out so far... 

if I set mesh.setEnabled(false) on a serialized mesh from scene (I am going to use the DISABLED mesh from scene the source for cloning).

then clone that mesh and set clone.setEnabled(true) ... THE MESH IS STILL DISBALED, even though I called setEnabled(true)... If I look in Debugging... the clone is there and the little 'Blue Eye' is greyed out... I can click that and it will show.

its weird ... Now if I DONT force the mesh disabled with mesh.setEnabled(false)... it seems to be working...

Dunno for sure I Gott do more debugging...  But sure as shit, something changed in setting the mesh enabled and disabled and cause it has on cloning the newly set disabled mesh...

 

I will keep checking thru it

 

EDIT... maybe is my code now getting called twice to disable the mesh for some reason. I will check the whole PROCESS again.

Share this post


Link to post
Share on other sites

When something like this happens to me, I go to the github commits and look at the commit at the bottom of the page and press the <> button to look at the repo at that time.  I go to the dist folder and download it.  If that dist doesn't work I move onto the next page and so on until I find a dist that works.  Then on the page where I found the dist that worked, I look at the commit half way up the page.  If that worked I go half way up again, If that doesn't work I go half way down.  This can be time consuming but waiting for an answer on the forum can be time consuming, too.

Share this post


Link to post
Share on other sites
1 minute ago, adam said:

When something like this happens to me, I go to the github commits and look at the commit at the bottom of the page and press the <> button to look at the repo at that time.  I go to the dist folder and download it.  If that dist doesn't work I move onto the next page and so on until I find a dist that works.  Then on the page where I found the dist that worked, I look at the commit half way up the page.  If that worked I go half way up the again, If that doesn't work I go half way down.  This can be time consuming but waiting for an answer on the forum can be time consuming, too.

I am manually looking thru the source now... is a little tedious ...

I just THANK GOD it was NOT a change in the setEnabled ... That scared the CRAP out of me... My whole LOD Group support relies heavily on setEnable true and false... I feel much better about that... Just gotta find the metadata change.

Yo @Deltakosh  What do think about adding ANOTHER field to NODE and SCENE like I asked you to do for metadata:any, but call it something like unity:any or toolkit:any ... Just basically a DEDICATED metadata field I can use for the toolkit ???

That field is very important to the toolkit, I wrote the entire toolkit feature set based on 'Unity Meta Data'. I am just thinking MAYBE the toolkit could have its own metadata field.

Share this post


Link to post
Share on other sites

But someone went ahead and added FULL serialization to my metadata field.

That just killed all my metadata cloning I need for script component instances and a bunch of other stuff that the scene manager is based on.

I needed that field to use as the heart and sole for the toolkit. 

Can we ADD ANY OTHER field with ANY OTHER NAME that is just a simple 'any' field.

How about 'node aux:any' and 'scene aux:any' and just the Parsing code I had originally for metadata.

Thats kinda messed up, I was using that field first. But I will go ahead and change all instances xxx.metadata to xxx.aux or anything you want me to call it.

EDIT:

Yo @Deltakosh Nevermind the new field... I think I can re-code scene manager to work around this little mishap :)

 

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.