We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Help with the Append Puzzle please!

Home Forums Puzzles Help with the Append Puzzle please!

Viewing 15 posts - 16 through 30 (of 30 total)
  • Author
    Posts
  • #56031
    kdv
    Participant

    Well, it’s hardly possible to detect the problem without app files )))

    Try to replace v3d.js in the app folder by the attached file. It will show the error with more details…

    Attachments:
    You must be logged in to view attached files.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56033
    David Yanez
    Customer

    Thank you kdv77kdv,

    I replaced the v3d.js and still with no luck. Screenshot attached.

    I’m sending you the app files in the following link but with access request in order to not leave the files open if thats ok.
    https://tinyurl.com/my-v3d-ap

    Many thanks for all your help!

    Attachments:
    You must be logged in to view attached files.
    #56035
    kdv
    Participant

    I replaced the v3d.js

    No, you didn’t. The attached v3d.js is non-obfuscated and the error won’t be in the line 1. You should unpack it and replace v3d.js in the app folder by this file. And remove all batch geometry puzzles…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56036
    David Yanez
    Customer

    Sorry about that.

    Ok. So I replaced the v3d.js with the new one, but if I just refresh the app browser window I get the following error in the browser console:

    Uncaught SyntaxError: Unexpected token ‘export’ (at visual_logic.js:4571:1)

    Then after refreshing the App Manager browser window I saw that I had to update the application, which I did.

    After that I deleted all the batched geometry inside of puzzles including the one I had in the append scene / when loaded do puzzle.

    Still, after testing it out I get the following browser console error with endless count loading:

    v3d.js:1 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘morphAttributes’)

    Still in a pickle… :wacko:

    Attachments:
    You must be logged in to view attached files.
    #56040
    kdv
    Participant

    Uncaught SyntaxError: Unexpected token ‘export’ (at visual_logic.js:4571:1)

    Well, that was nearly expected ))) No ideas any more. Requested an access to the files from kdv.info…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56041
    David Yanez
    Customer

    Ok.Giving you access. Thank you

    #56043
    kdv
    Participant

    First conclusion: the problem is in your logic, not in geometry…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56044
    kdv
    Participant

    Here is your problem: you assign a material to all objects in a group, but this group contains not only meshes, it also contains empty objects that are not supposed to have a material.

    And you can add this script somewhere in the begining

    It will remove this effect

    And you’d better not use geometry batching at all. It increases tris count significantly. A dubious optimization…
    before

    after

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56063
    David Yanez
    Customer

    Awesome! I would have taken even more time to solve this if it wasn’t for your help. Thank you so much kdv77kdv!

    Indeed I had 2 meshes that were not sharing the same shader in the group I had assigned for the material replacement in puzzles.

    One last question though… Do you know which puzzle I could use in order to update the material of certain objects in the appended gltf scene, so they can appear after loading with the latest color selection in the master scene configuration?

    I was thinking maybe to add some puzzle in the “when loaded do” of the append scene puzzle that would indicate the following logic:

    –when loaded, assign material from mesh (any object of the master scene that has the required color or pattern).–

    But I’m not sure how to configure this with the materials puzzles, maybe a script?.. Or a variable setup (which I still dont understand how to use them)…any ideas?

    Thanks again! You rock!

    #56065
    kdv
    Participant

    Indeed I had 2 meshes that were not sharing the same shader in the group

    The problem was not in meshes and their shaiders, the problem was in empty objects in this group. Assign materials to meshes only, the function assignMat() doesn’t check if an object has a material or not )))

    I was thinking maybe to add some puzzle in the “when loaded do” of the append scene

    You were thinking in the right direction. Place the assign material puzzle there. To see all names of objects in the appended scene just append it in the viewport of the puzzles editor.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #56074
    David Yanez
    Customer

    Thank you so much Denis,
    Yo definitely rock!

    I managed to set the color update with variables and procedures, where I first made a list of procedures with a variables for each color that stated if was on or off. I also created an initial state of variables for this.

    Then I added these status procedures to the prior color configuration procedures I already had which were linked to the on event of click puzzles.

    Finally I created a procedure with conditional that referenced the state of the active color status. I then used this last procedure which I named “addons color update” in the “when loaded do” section of the append puzzle.

    And voila! PROBLEM SOLVED! … All working smoothly now.

    Again thanks for the amazing support. It’s great being able to continue learning awesome people as yourself. Hopefully I can be able to share some wisdom some time soon as well.

    Cheers!

    Attachments:
    You must be logged in to view attached files.
    #76458
    David Duperron
    Customer

    Hi @david-yanez!
    It seems that I have a very similar issue today after updating to 4.7.1 version. I’m getting axactly the same error messagen and my imports fail.
    Did you manage to find a solution to the above problem??

    #76462
    kdv
    Participant

    Like in case from this topic the problem most likely is somewhere in logic (puzzles). Try to disable all action within the “append scene” puzzle and then enable them one by one.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #76463
    David Duperron
    Customer

    Hi Kdv, thanks for the advice.
    In fact I spent some more time yesyterday on this, and finally discovered that this had to do with a material assignment in earlier steps of my scene loading (steps where I imported some objects and assigning them an already existing material – and these objetcs were importing and displayed correctly!).
    However as soon as I invoked the append scene puzzle after that, the imports failed… I had to rework the material assignment part, and make sure the objects had some properties defined with the following script (like the computeTangents(), or a correct UVMap name):

    var mat = v3d.SceneUtils.getMaterialByName(appInstance, "NI_paint_vertex_color");
    var object = PzLib.getObjectByName(addedPennantName);
    object.geometry.attributes.uv.name="UVMap";
    object.castShadow = false;
    object.receiveShadow = false;
    object.geometry.computeTangents();
    object.material = mat;
    #76464
    kdv
    Participant

    and finally discovered that this had to do with a material assignment

    Exactly the case of this topic ))) Make sure that you are trying to assign materials to meshes only…

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

Viewing 15 posts - 16 through 30 (of 30 total)
  • You must be logged in to reply to this topic.