Scene Editor: Very interesting new feature in Codea 4

I found this in the Codea 4, very interesting and useful

display = viewer
display.mode= FULLSCREEN


function setup()
    display.drawOnRequest = true
    
    inspector = editor.inspector()
    assetList = editor.assetList()
    assetList.onAssetSelected = function(ass)
        inspector.target = ass
        if is(ass, scene) then            
            if scn and scn.key.path == ass.key.path then return end
            scn = ass
            scnEditor = scn.editor
            scnEditor.onSelectionChanged = function()
                inspector.target = scnEditor.selection[1]
            end
        end        
    end
end

function draw()
    background(0,0,0,255)
    if scnEditor then scnEditor:draw() end
end

function gui()
    if inspector then inspector:gui() end
    if assetList then assetList:gui() end
    if scnEditor then scnEditor:gui() end
end

function touched(touch)
    if scnEditor then
        if scnEditor then scnEditor:touched(touch) end
    end
end

https://youtu.be/VqMEip5CQTA

1 Like

Adding obj models

https://youtu.be/YJEplggqlCk

@binaryblues :blush:

Yeah it’s in there but very unstable/buggy still!

@binaryblues @John - that’s really impressive, must have a play with that.
Have you tried saving and loading a screen with it?

@John Looking forward to the full version, with this scene editor, you can more intuitive design of the scene, it is easy to adjust the lighting effects and camera position. However, The development team do not have to feel too much pressure, according to your normal development schedule, step by step on it.

@Bri_G At present, its save, load function is not perfect, many details also need more code support, but the framework is very good, you can run their own experience

@binaryblues - ran the scene editor, set up a scene and loaded a model obj which was too big for the editor.Zooming in and out and rotating eventually crashed Codea.

Few suggestions -

  1. Where the options are Editor/Documents/Assets - keep them on the screen to the left and add an arrow pointing to a listing of options/files to the right of it fading the unselected other options relative to selected one.
  2. Not sure what the settings/gear options are but they overlap the selection text.
  3. Read any assets loaded to get the dimensions and load so they are visible and display a scaling factor in the control bar at the top - the user can then move/rotate/scale as needed then.

It’s probably best on a large screen iPad. My (just less than 10” screen) struggles with this a little.

Don’t know who programmed this but it’s neat and very promising - hope this will be pushed further. Some docs might help.

@binaryblues nice detective work! This is something we are working on native support for in the editor. That is, having .scene files represented along with your code. Selecting one should bring up the editor interface. This is some ways off, however

@Simeon @John - probably missed it from the docs but, what is the V4 approach to translate ?

@Bri_G Good suggestions. I I’ve been running it on a 12-inch iPad, and I’ve just tried it on my 10-inch iPad, and I’m feeling a bit congested with the current UI, so hopefully there will be options for UI font adjustments in the future. I think settings and gears should be UI placeholders, there is no corresponding function code. Overall, it’s a very promising start.

@Simeon The team had worked very hard on the future features of Codea, and it was clear that they were looking forward to everyone taking their time to make the best of it.

All the ImGui editor stuff is just mainly debugging tools for me to develop the scene editor features. It definitely won’t be like that in the more polished / finished versions