Forum Replies Created
-
AuthorPosts
-
2025-03-28 at 7:47 am in reply to: Loading / Cloning same Object with Children into Scene multiple times #80952
Thomas Fabini
CustomerYep, it truly is. Thanks for this demo, it’s quite interesting how this works.
I can only guess right now, but I assume there are some differences.
For example, the Farmer rig shows as type ‘SkinnedMesh’ while in my scene the armature is of type ‘Bone’. Maybe that’s a possible reason?I have to admit, I actually don’t know the real difference, beside reading about some solutions regarding a dynamic rig and an IK solver which seem to be present in the verge3d api.
So I have to assume a blender exported rig is static and limited to its exported animation clips while SkinnedMesh can be dynamically changed or animated through the api.2025-03-27 at 4:30 pm in reply to: Loading / Cloning same Object with Children into Scene multiple times #80942Thomas Fabini
CustomerScene
is an empty object.Well might be the case, one with particular properties.
But the answer is no. it doesn’t work with a rig parented to an empty.Only the one specific empty is cloned, since it does not work with “groups, lists or all object puzzle”. Even when cloning recursively all parent-child relations seem to be dropped.
2025-03-27 at 1:02 pm in reply to: Loading / Cloning same Object with Children into Scene multiple times #80936Thomas Fabini
CustomerDoes this mean it would work, too if the rig is parented to an empty which you clone?
2025-03-27 at 12:53 pm in reply to: Loading / Cloning same Object with Children into Scene multiple times #80934Thomas Fabini
Customerwhy not? easy.
Thank you, then at least there’s hope it will work with cloning instead of loading, too.
But in that specific example you are cloning the whole scene… doesn’t this dramatically change when cloning a particular rig?Btw., I found your thread regarding cloning animations, it helped me rename the animation clips on the cloned, and renamed, rigs – without, there wasn’t any animation available for the new rigs which could be played – thanks for those examples, too.
2025-03-27 at 7:45 am in reply to: Loading / Cloning same Object with Children into Scene multiple times #80930Thomas Fabini
CustomerHi kdv,
one more question if I may:
Before you said loading _and_ cloning. When loading, the parent-child structure or the rig remains intact, all I have to do is to rename all objects within the loaded scene.But when cloning I am only able to clone a single object (without its children). If I’m not mistaken here.
Even if I would iterate through all objects when cloning (and renaming), would the parent-child relations of the clones be correct?
From other posts I understood that clones always reference back to their original children.Do you think it is possible to clone a complex parent-child structure or a rig with parent-child dependencies intact?
2025-03-26 at 3:26 pm in reply to: Loading / Cloning same Object with Children into Scene multiple times #80916Thomas Fabini
CustomerThanks very much for explaining this and for the solution kdv
so it means when appending a scene several times all object id’s are unique, but the names still remain the same, thus getObjectByName() would return always only the first instance it finds when traversing the scene children. So they can’t be manipulated by the classical puzzle selector.
When renaming all children in an appended scene it seems to work, the parenting and structure remains intact and individual elements can be manipulated through puzzles then.
2025-03-26 at 1:59 pm in reply to: Loading / Cloning same Object with Children into Scene multiple times #80912Thomas Fabini
CustomerThat explains why I haven’t found it yet… I was going for something like (profoundly un-tested) …and profoundly wrong, too. here’s the update:
/// Built-in variables: app, v3d, puzzles, VARS, PROC const objects = VARS.scene_objects; const index = VARS.scene_index; const scene_objs_renamed = []; for ( const object of objects ) { obj = app.scene.getObjectByName(object); obj.name = obj.name+"_"+index; scene_objs_renamed.push(obj.name); } VARS.scene_objs_renamed = scene_objs_renamed;
-
This reply was modified 2 days, 17 hours ago by
Thomas Fabini.
2025-03-26 at 1:14 pm in reply to: Loading / Cloning same Object with Children into Scene multiple times #80908Thomas Fabini
Customeryeap. append/clone -> rename.
Is there a ‘rename’ puzzle I don’t know about?
I maybe could feed “all objects” from the loaded scene to a method, parse through for each and add an index to (the name property of) each element and return the references back in an object, dictionary. This is the only thing that comes to mind right now. (Don’t know it that works).-
This reply was modified 2 days, 18 hours ago by
Thomas Fabini.
2025-03-26 at 1:04 pm in reply to: Loading / Cloning same Object with Children into Scene multiple times #80906Thomas Fabini
Customeryou should rename all objects in appended scenes
Hi kdv, thanks for your reply.
Do you mean renaming objects in the original files which are loaded (which would defeat the purpose of dynamically loading and reusing a scene) – or – do you mean dynamically renaming objects when loading a scene?Thomas Fabini
CustomerHi Yuri,
thanks for this amazing update…
Shared and individual materials / textures slots is a huge step forward.
It’s something I wouldn’t even have dared to address – in previous projects I stuck with a workaround cloning materials through the API when generating multiple objects dynamically.I was also able to get closestPointToPoint to work with 4.9 – thanks Alexander for the snippet – but in terms of “overcoming obstacles”, until it works in the whole setup there’s more work to be done. But nevertheless – it’s very promising.
And if I’m not mistaken you have added search in puzzles! Just when I was getting ready to post a request to add a search plugin to blockly. Now at least there’s a chance to find certain methods or variables in huge node setups – which usually is definitely easier when dealing with code.
I don’t even got to test all the other optimizations and features – but for me this release is already a highlight. Thank you and the team for the hard work you put into this release.
Thomas Fabini
Customerwith some small modifications it will work in 4.8.0 too.
Awesome, thanks kdv! I’m getting output from closestPointToPoint() with your modifications.
I only did a quick test running it, hope I’ll be able to get into the details soon.Thomas Fabini
Customerthis code (as is) will work correctly only with 4.9.0pre1. and yes, it’s working.
Hi kdv,
thanks for confirming.
Hope I’ll be able to test it soon…Thomas Fabini
Customerso that code snippet might not work as expected in 4.8
Hi Alexander,
thank you very much for pointing that out – I suspected this might be the case.
I was able to access all the methods but didn’t get past “Infinity” as a result or an shapecast error in the console, depending on the parameters for the closest point calculations. From your snippet I assumed that expected parameters are both Vector3, first with the current position, second one empty for the result.I’d love to test 4.9 pre1, but some other projects are still in production under 4.8.0 – might be risky to switch now. I I’ll try to test 4.9 as soon as possible.
Thomas Fabini
CustomerHere is how we do it. You can use this snippet as a basis for your own puzzle or with “exec script”
Hi Alexander,
Thank you so much for the snippet!
After reading through it, as far as I understand, bounding trees is where the magic happens, and then performing closestPointToPoint to find the closest point on the edge of the collision mesh relative to the current position. That’s awesome, being able to query against the outer bounds of the mesh…Are bounding trees completely supported already in 4.8.0?
I was afraid they would not be available in 4.8.0 (which we’re currently using as a stable production version) but after testing I was able to see the data on my collision mesh and even performing closestPointToPoint() on it. I guess I still have to figure out the correct parameters and the details, but if this works it would really mean a huge improvement for non-physics collisions.I might try to just exec a short part of code with the collision mesh and current position as parameters and feeding the returned vector to the navigation loop.
Thanks for pointing this out and good luck with 4.9!
Thomas Fabini
CustomerHi Yuri,
☞ Auto sliding around an obstacle in first person mode
That specific line gives me that tingly warm and fuzzy feeling
Since we can’t use the first person mode in VR and much more customization is usually required – would you care to elaborate (if possible) on the mechanics you used for the drift along obstacles? If that’s something which could be roughly build with puzzles, the type of navigation used in the VR Demo would greatly benefit from this.
Do you calculate the drift from that simple, flat floor mesh or does it require raycasting toward vertical walls to get the normals and calculate the drift angle?
-
This reply was modified 2 days, 17 hours ago by
-
AuthorPosts