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.

David Duperron

Forum Replies Created

Viewing 15 posts - 76 through 90 (of 151 total)
  • Author
    Posts
  • in reply to: Make Unique and independent copies of Objects #68152
    David Duperron
    Customer

    Here is a simple demo showing the behaviour I do not understand:
    Clone demo
    Several keyborad inputs will trigger the following steps:

      “M” will append a simple cube, add its custom properties (defined in blender) as a new entry in the addedObjectsDictionnary and give it a named material, and a color according to the imported property
      “N” will duplicate and rename the first appended cube, move it and COPY the first cube’s key in the addedObjectsDictionnary, as a new key, named after the second cube: duplicate_cube1.
      “O” will again duplicate the first cube, rename it duplicate_cube2, move it, and this time, re-import the custom properties to define the new key in addedObjectsDictionnary.
      “P” will lastly change the color for duplicate_cube1, and store the new color in the dictionnary for that key.

    But you will see that in the dictionnary, the color has changed for both appended_cube AND duplicate_cube1! How is that possible??
    A click on the object prints the Object3D javascript object in the console.

    in reply to: Make Unique and independent copies of Objects #68149
    David Duperron
    Customer

    The objects DO HAVE independant and unique names, as well as their materials. I was able to change the colors, positions, scale, etc… independently, but as soon as I wanted to WRITE these data in my dictionnary, these parameters are “synchronized” if I do not create a new set of customProps… I’ll try to make a simple demo of this particular behaviour, it should me much simplier…

    in reply to: Make Unique and independent copies of Objects #68142
    David Duperron
    Customer

    @kdv77kdv
    I found something quite odd but interesting, that is apparently not in line with what you mentionned here:

    They don’t work at all. You can read them, you can change them, but that’s all.

    The “Userdata/CustomProps” dictionnary which is part of the Object3D javascript object IS changed when I manipulate my Object with puzzles, even if I do not explicitely tell my application to write the data in the object’s dictionnary.
    In other words, in my Application, I create from scratch a custom dictionnary (addedObjectsDictionnary) where I import a blender created CustomProps dictionnary, name it with a new unique ID. This dictionnary is updated when I make modifications on my object (color, position, rotation, etc…), but for some reason, the “Userdata/CustomProps” dictionnary inside the 3D object is also changed!
    And the reason why my objects where linked previously (I guess!) was that I did not make the “import customprops” step and simply duplicated my puzzle created dictionnary and asigned a new UID. But inside the 3D object they were still linked.
    Here are two screenshots of the console log for one of my objects before and after a modification (obtained with getObjectByName, no other manipulation). And as I said, I never explicitely tell my application to write something in the Object3D object…
    Before:

    After modification:

    Hoping this is clear…?

    in reply to: Make Unique and independent copies of Objects #68096
    David Duperron
    Customer

    Yes I know… I started again from scratch, using the same method I use for appending objects in the first place, to create a clone based on the same gltf file, and now it’s working! I guess this had to do with the way I was defining the custom parameters for my “cloned” objects…
    for the record, the two puzzles:
    the one which is working fine:

    and the one which is not:

    in reply to: Make Unique and independent copies of Objects #68094
    David Duperron
    Customer

    I found something: it seems that this has to do with custom properties recovered from the original appended gltf file.
    For “properly” appended objects, where the custom properties (that I store in a dictionnary) are pulled from the gltf file, everything works fine.
    But for “cloned” objects, where I do not write the new objects properties from the original custom properties, but rather copy them from the cloned object, these properties seem to be linked!
    Do you know how exactly these custom properties work and how are they linked/updated (if so?) from within the puzzles??

    in reply to: Make Unique and independent copies of Objects #68089
    David Duperron
    Customer

    I don’t know if I can build something “simple” to reproduce this behaviour… there are a lot of procedures and puzzles involved as well as UI.
    However I’ve tried to inspect the various objects to get a clue.
    Attached are the console logs of three “Object3D”
    The cube1 is the first one to be appended to the scene, from an original file called GENERIC_cube.gltf.
    The cube2 is a second object appended from the exact same gltf, with the same parameters.
    The cube3 is a duplicated object that I create by copying the parameters of the cube1 (in an internal dictionnary: gltf_file path, dimensions, rotations, etc… basically all the parameters that are originally imported with the object as customprops), using the same processus as for a new object appending (like for cube2): I get the gltf file path, append the scene, rename the objects, etc…
    And for a completely unknown reason the cube2 and cube3 are linke din some way, and when I try to change some parameters on one it changes on both.
    Cube1 remains untouched.
    I don’t know if these json files can give us a direction to look??
    Cube1
    Cube2
    Cube3
    David

    in reply to: Make Unique and independent copies of Objects #68082
    David Duperron
    Customer

    Ok… I will need to investigate deeper. Appending the same object several times works perfectly fine, but cloning causes all sorts of troubles… strange… :wacko:

    in reply to: Make Unique and independent copies of Objects #68079
    David Duperron
    Customer

    Yes I already used the console to have a closer look to the 3Dobjects
    Everything looks separate (materials, objects) except the “geometries” which is identical for both objects (same UUID, same everything…).
    Can this be causing these kind of trouble?

    in reply to: Make Unique and independent copies of Objects #68077
    David Duperron
    Customer

    Hi kdv,
    I’m already using your “clone object” puzzle, and yes the objects in question originally come from an appended scene, but I the objects renaming and parenting to the new scene was already done, or at least i thought so…
    How can I check what exactly I cloned and if the meshes and/or materials are linked in any way?
    Thanks for your help again!

    David

    in reply to: Copy/Paste imporvements #67930
    David Duperron
    Customer

    Whole tabs can be easily copied/pasted within a couple of minutes

    Thanks! great tip

    in reply to: Object scale relative to viewport size? #67846
    David Duperron
    Customer

    Good hints, as usual… ;)
    I quickly identified that this “function within a function” – local function – was not directly accessible, and as suggested copied it in a custom procedure in my puzzles.
    Just had to identify that I needed to properly set the “mesh” using the getObjectByName function and that’s it! :yahoo:
    Thanks again!

    in reply to: Object scale relative to viewport size? #67843
    David Duperron
    Customer

    Ok… and could you give me a hint or two about what I need to change or add to adapt this function to my needs??
    Thanks!

    in reply to: Object scale relative to viewport size? #67838
    David Duperron
    Customer

    @kdv77kdv I think I might already have the exact function for that, right?
    function setObjectScale(mesh, factor) {
    right?
    Can I call this function from any other location in my puzzles using the javascript puzzle?

    in reply to: Camera zoom increments #67539
    David Duperron
    Customer

    :). Simple.

    in reply to: Camera zoom increments #67537
    David Duperron
    Customer

    Thanks for the info!
    These parameters have an effect indeed, but that’s not really what I was looking for.
    My issue is that it looks like there is a constant number of zoom steps, whatever the distance between MinZoom and MaxZoom is, meaning that for small distance, controlling the zoom level is easier than for big distances where one mouse wheel step equals to a much greater distance. My question was: is there a way to increase the number of zoom steps depending on the MinZoom/MaxZoom distance??
    Thanks for the help!

    David

Viewing 15 posts - 76 through 90 (of 151 total)