- This topic has 29 replies, 3 voices, and was last updated 3 months, 1 week ago by kdv.
-
AuthorPosts
-
2022-09-23 at 4:41 am #56031kdvParticipant
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.
2022-09-23 at 5:45 am #56033David YanezCustomerThank 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-apMany thanks for all your help!
Attachments:
You must be logged in to view attached files.2022-09-23 at 5:56 am #56035kdvParticipantI 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 replacev3d.js
in the app folder by this file. And remove allbatch 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.
2022-09-23 at 6:16 am #56036David YanezCustomerSorry 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…
Attachments:
You must be logged in to view attached files.2022-09-23 at 6:23 am #56040kdvParticipantUncaught 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.
2022-09-23 at 6:26 am #56041David YanezCustomerOk.Giving you access. Thank you
2022-09-23 at 7:24 am #56043kdvParticipantFirst 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.
2022-09-23 at 8:22 am #56044kdvParticipantHere 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.
2022-09-23 at 1:24 pm #56063David YanezCustomerAwesome! 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!
2022-09-23 at 2:11 pm #56065kdvParticipantIndeed 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.
2022-09-23 at 5:15 pm #56074David YanezCustomerThank 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.2024-08-07 at 2:23 pm #76458David DuperronCustomerHi @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??2024-08-08 at 2:38 am #76462kdvParticipantLike 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.
2024-08-08 at 7:14 am #76463David DuperronCustomerHi 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;
2024-08-08 at 7:19 am #76464kdvParticipantand 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.
-
AuthorPosts
- You must be logged in to reply to this topic.