Codea Craft 2.5 (84) Beta - Updated 8/9/2017

Hi All,

Anyone running air code and coding in a browser with 2.5/74/75/76 can’t seem to get it running on my pad and mac!!!

@Bri_G That’s a known bug, @John is probably already working on it.

@John @Simeon I realize it may be a bit early to ask this question, but how does Codea import textures when it loads obj files? I’ve successfully gotten a texture to load when the mtl, obj, and image were all in my Dropbox, but it seems like the mtl can only use one image or else it doesn’t work. Could you clarify how this all works? Thanks

@Attila717
Normally the obj loader tries to grab the mtl and images from the same directory as the model but I haven’t tested the obj loader with more than one texture. Can you send me an obj that has this problem (with the mtl and textures as well).

@John This is the file that was giving me problems. It shows up all right, besides being completely black. I did rename both the obj file and the mtl file to be the same. (Besides the .mtl and .obj file extensions) https://www.dropbox.com/s/m8akcffvygs5xw4/Futuristic_Car_2.0_Cgtrader_obj.zip.zip?dl=0

@John Also, can different parts of obj files be treated as separate components of one entity? Or can they be treated as different entities? I guess I’m looking for a way to make characters or other objects move their arms/wheels/etc…

@Attila717
This is something I’ve been considering (allowing each object to be loaded as children of the parent mesh). One of the issues is that the obj format does not support transformations, so each sub-object mesh will have the middle of the object as its center. Later on I will be adding support for collada and fbx which have proper support for transform hierarchies.

@Attila717 I managed to get the model working (there were a few bugs in texture loading). The .mtl file itself had some issues, such as extra slashes in path names. Also the obj loader we are using doesn’t seem to like spaces in names either. I also removed a dummy object that was obscuring the main model.

@John Oh cool! I had kind of given up on that model ever working. Thanks for figuring that out, it looks great.

if i duplicate an example project, to use as the basis of new project, it seems i cannot replace the project icon with a new icon. i think this is a longstanding issue not connected with the new version.

@piinthesky I’ll have a look into this

@piinthesky @John I think this may just be a problem with your device. It works perfectly fine on my Codea.

@Attila717 Can you show the syntax of how you set the project icon.

@dave1707 I’m not entirely sure how or even if you can do it in code, but I’ve always just pressed the camera icon then pressed set icon.

Edit: never mind, this should work

img = image(WIDTH, HEIGHT)
saveImage("Project:Icon", img)

@piinthesky @dave1707 @John Now I’m getting the same problem everyone else is. It only happens with regular demos, not Codea Craft demos though.

i confirm if i copy a demo project i cannot change the icon of the copy via the camera method. it does work for a new project.

@piinthesky @John I tried changing the project icons again. Using a copy of one of the demos, I was able to change the icon using the saveImage command, but not the copy via the camera method. I must have used a normal project when I did the icons earlier when I thought they were demo copies.

@John @Simeon This has nothing to do with Craft, but I think it should be changed. The variable for parameter.text can be updated until the text area is touched. After that, the variable can’t be changed by the program. What I was trying to do was input something in the parameter.text area and after processing what was there, I would then clear the text area for the next input. But it doesn’t clear once it’s used. In the example below, the text area is allowed to be changed until just touching the text area prevents it.

function setup()
    t=0
    parameter.text("txt","")
    fill(255)
end

function draw()
    background(40, 40, 50)
    t=t+1
    txt=string.format("%s%d","value  ",t)
    text(txt,WIDTH/2,HEIGHT/2)
end

@piinthesky thank you for finding this bug, will have it fixed in the next build.

@dave1707 interesting problem, but the behaviour could be tricky to get right.

parameter.text is user editable, so if you are setting it every frame, then go to edit it, do we ignore the setting of it programatically? And then continue to allow it to be set programatically after editing has finished?

I’ll have to think on it. Your use case is a good one, though. I think you could use parameter.clear to clear and re-create the text parameter to get the cleared value.