https://openbrush.app/ logo
Join Discord
Powered by
# icosa-gallery-development
  • a

    andybak

    04/23/2025, 3:04 PM
    Each API client could do it, itself - but that's pushing the problem on every consumer of the API
  • a

    andybak

    04/23/2025, 3:06 PM
    I guess we have to download the models, fix them and then cache or reupload the new version. But that's costly in time, bandwidth and storage. I could do it "just in time" for each model. And maybe only if explicitly requested by the client.
  • a

    andybak

    04/23/2025, 3:06 PM
    @yank - thoughts?
  • a

    andybak

    04/23/2025, 3:07 PM
    (another issue is that i don't actually have the code to do it yet. It's easy to write a dumb version of this code but doing it in a performant way is harder. Wouldn't matter for small models but shit gets quadratic real fast with this kind of processing)
  • y

    yank

    04/23/2025, 6:04 PM
    How would you code something like this? Headless blender?
  • y

    yank

    04/23/2025, 6:05 PM
    It's not like you can change a bit of text in the gltf here
  • y

    yank

    04/23/2025, 6:05 PM
    So I'm curious how you would do that
  • y

    yank

    04/23/2025, 6:10 PM
    I could write a bpy script that does the fix, exports, and is headless. you can then write a shell script with a for loop over all the models. Maybe have a validation step as well
  • y

    yank

    04/23/2025, 6:11 PM
    That's the only way I know how, and it's easy because it's in python
  • a

    andybak

    04/23/2025, 6:16 PM
    If this was code to run on the same server that the gallery runs on then I could use any language (or combination of languages). Headless Blender would be powerful but I suspect the RAM overhead might be a bit much. Maybe a combo of python (trimesh or similar) with https://gltf-transform.dev/ (which we already have installed on the server but aren't currently using)
  • a

    andybak

    04/24/2025, 9:48 AM
    @yank - nearly got uploads working. Can talk you through what's needed if you want to tackle that.
  • a

    andybak

    04/24/2025, 9:49 AM
    (login would have to come first actually - that opens up access to "my models" and "my liked models" which is pretty useful)
  • y

    yank

    04/24/2025, 10:20 AM
    For sure! Login and upload sounds great
  • a

    andybak

    04/24/2025, 10:22 AM
    login is easy. you just launch the user's default browser so they can get a short code. Then you post this short code to get an access token for future api requests
  • a

    andybak

    04/24/2025, 10:23 AM
    this commit lays out a lot of the stuff you need: https://github.com/icosa-foundation/icosa-blender-plugin/commit/169aef54694e1191cf3a86aa11e085485ab42c03
  • a

    andybak

    04/24/2025, 10:23 AM
    oh - the device login stuff isn't in that commit actually
  • a

    andybak

    04/24/2025, 10:24 AM
    but this is the page to get the device code: https://icosa.gallery/device
  • a

    andybak

    04/24/2025, 10:25 AM
    then you get the access token from this api endpoint: https://api.icosa.gallery/v1/docs#/Login/icosa_api_login_device_login
  • y

    yank

    04/24/2025, 10:26 AM
    Cool! I can do all of that no problem. The only question I have is will I be storing a secure key on user end?
  • y

    yank

    04/24/2025, 10:26 AM
    So far the API is keyless, just download without a login
  • y

    yank

    04/24/2025, 10:27 AM
    Is that going to change? Do you want a user logged in to download?
  • y

    yank

    04/24/2025, 10:28 AM
    I'm going away soon - from 29th until about 10th or maybe before. I won't be able to work on anything until I'm back home. But I'll be around near 24/7 on my cell so I can plan some things for when I'm home
  • y

    yank

    04/24/2025, 10:30 AM
    I still need to write some short docs / how to use gallery add on
  • y

    yank

    04/24/2025, 10:31 AM
    Also. You mean the godot addon? Or you need help with blender now?
  • a

    andybak

    04/24/2025, 10:31 AM
    i've done most of blender. i was showing you that as a guide for godot
  • y

    yank

    04/24/2025, 10:33 AM
    Ah yes OK, yeah its no problem in godot to do this as well
  • a

    andybak

    04/28/2025, 12:04 PM
    @mikesky In TiltShaderLoader.js every brush has a section like this.
    Copy code
    js
        "CoarseBristles" : {
            uniforms: {
                u_SceneLight_0_matrix: { value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] },
                u_SceneLight_1_matrix: { value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] },
                u_ambient_light_color: { value: new Vector4(0.3922, 0.3922, 0.3922, 1) },
                u_SceneLight_0_color: { value: new Vector4(0.7780, 0.8157, 0.9914, 1) },
                u_SceneLight_1_color: { value: new Vector4(0.4282, 0.4212, 0.3459, 1) },
                u_MainTex: { value: "CoarseBristles-1161af82-50cf-47db-9706-0c3576d43c43/CoarseBristles-1161af82-50cf-47db-9706-0c3576d43c43-v10.0-MainTex.png" },
                u_Cutoff: { value: 0.25 },
                u_fogColor: { value: new Vector3(0.0196, 0.0196, 0.0196) },
                u_fogDensity: { value: 0 },
            },
            vertexShader: "CoarseBristles-1161af82-50cf-47db-9706-0c3576d43c43/CoarseBristles-1161af82-50cf-47db-9706-0c3576d43c43-v10.0-vertex.glsl",
            fragmentShader: "CoarseBristles-1161af82-50cf-47db-9706-0c3576d43c43/CoarseBristles-1161af82-50cf-47db-9706-0c3576d43c43-v10.0-fragment.glsl",
            side: 2,
            transparent: false,
            depthFunc: 2,
            depthWrite: true,
            depthTest: true,
            blending: 0
        },
    Looks like that might be autogenerated but I can't see anything that does it in Open Brush (it's different to exportManifest.json) It was in your initial commit. Any idea where it came from?
  • m

    mikesky

    04/28/2025, 12:09 PM
    I think there’s some threejs stuff in the support folder, but otherwise the scene light matrices were probably hand added by me in bulk, and the rest copied from the c# shader default
  • a

    andybak

    04/28/2025, 12:10 PM
    ok. so mostly a manual job
  • m

    mikesky

    04/28/2025, 12:12 PM
    Back when that was something I had time for… 😆