How to copy bodies from one json file to another file

General discussion about the R.U.B.E editor
Post Reply
garfi43
Posts: 6
Joined: Mon Jan 21, 2013 11:00 am

How to copy bodies from one json file to another file

Post by garfi43 »

Hello,

I wanted to know how to copy body information from one json file to another file.
Can it be done inside RUBE? Or do you have to manually edit json files?
What would be the best approach?

Thanks.

(migrating from PhysicsEditor to RUBE. It is great.)
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: How to copy bodies from one json file to another file

Post by iforce2d »

If you want to copy the entire body with fixtures and all, you can just copy and paste it into another scene. You can also do this with multiple bodies and any joints between them will be copied too.

But somehow I feel this is not what you're asking... if you mean to get existing bodies from PE into RUBE, I think the easiest way might be to load them from PE into your program and then use b2dJson to save them to JSON that RUBE can use.
garfi43
Posts: 6
Joined: Mon Jan 21, 2013 11:00 am

Re: How to copy bodies from one json file to another file

Post by garfi43 »

Thank you Chris.
I have just realized that it can be easily done (my fault).

Also thanks for that PE to RUBE tip. I'm going to test it to see how it goes.
Post Reply