www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: SuperCreeper on December 09, 2013, 11:23:06 am

Title: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: SuperCreeper on December 09, 2013, 11:23:06 am
Hello! I've created the world using jBrush v0.3 and exported all files to the /assets/ folder in HelloWorld project.
I'm tried to load my world with this code:

            AssetManager am = getAssets();
            objects = Scene.loadLevelAE("testscene.txt", objects, world, am);

I placed that code in onSurfaceChanged method below the world.addObject(cube).
Here's my LogCat and piece of code: (http://imgur.com/AdF6qih.png)
My /assets/ folder contains now:
floor.3ds
mcgrass.png
table_lowpoly.3ds
planks02.jpg
testscene.txt

How I can fix it?
P.S. Excuse for my English, please.
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: Wolf17 on December 09, 2013, 11:55:51 am
Hello! Welcome!
Maybe you forgot to include the texture which is applied to the floor model!? :-\
Make sure to include all the assets that you can visually see in your jbrush editor. :)
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: SuperCreeper on December 09, 2013, 12:03:54 pm
Make sure to include all the assets that you can visually see in your jbrush editor. :)
I included all the assets.
If you need, here's what testscene.txt contains:
fp-floor.3ds on-floor tp-mcgrass.png rx-0.0 ry-0.0 rz-0.0 tx-0.0 ty-10.0 tz-0.0 oc-0 cx-0 cz-0.0 cc-true sl-false ot--1 bm-null pa-null os-1.0 st-0 sh-1
fp-table_lowpoly.3ds on-table_lowpoly tp-planks02.jpg rx-0.05 ry--0.7500001 rz-0.0 tx-0.0 ty-0.0 tz--10.0 oc-0 cx-0 cz-0.0 cc-true sl-false ot--1 bm-null pa-null os-5.5 st-0 sh-1
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: SuperCreeper on December 09, 2013, 12:06:59 pm
And that's my HelloWorld project
http://www.datafilehost.com/d/13495410
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: Wolf17 on December 09, 2013, 12:19:51 pm
Oh ! sorry!  yes you did that!
Have you tried to recreate and reload the scene?
....Once I reach home ,I'll make an apk out of your source to see what is wrong !
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: SuperCreeper on December 09, 2013, 12:28:01 pm
Yes, I've tried to re-create and re-load my scene. But I still having these errors.
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: Wolf17 on December 09, 2013, 01:03:26 pm
If Possible, may you please attach your zip here through attachment options ! It is getting corrupted when I download from the link you provided!(Strange!)
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: SuperCreeper on December 09, 2013, 01:10:11 pm
I can't attach file to the post, because file size > 64kb. So, try to download from other file hosting: https://www.dropbox.com/s/g11eyo1caqvh13e/HelloWorld-AE.zip
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: Wolf17 on December 09, 2013, 01:26:42 pm
Yes I got it!  ;D
The mcgrass.png  texture you are using is of dimension 420*420 and it is not supported . Try to convert it to either 512x512 or 256x256 . You have to use power of two texture image i.e 2,4,8,32,64,128,256.512,1024.....so on.
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: SuperCreeper on December 09, 2013, 01:35:47 pm
I've resized the texture. Now it's 256x256. But I still having this problem :(
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: Wolf17 on December 09, 2013, 02:16:29 pm
Maybe you should try recreating the scene in jbrush and reloading the scene..... but this time without the floor model and the texture i.e try only that table thing ! Check if that loads fine on your device!
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: SuperCreeper on December 09, 2013, 02:40:05 pm
Aw, yeah! I solved the problem! I've read some docs about AIDE, so each time I changing the files in /assets/, I must tap the "Refresh Build" button instead of "Run".
Anyway: Wolf17, thank you very much for your help!
Title: Re: Getting "Can't add 'null' to the World" in jPCT-AE
Post by: Wolf17 on December 09, 2013, 02:59:49 pm
 ;D I am happy you solved it!  ;D