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.

Set Value does not work when the material is passed into a Procedure

Home Forums Puzzles Set Value does not work when the material is passed into a Procedure

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #17723
    D3Pixel
    Customer

    I am trying to create a procedure that accepts a material as a parameter but the “Set Value” puzzle within the procedure is not picking up the passed in material.

    I also tried Material: Get Material <selector> without success.

    See Screen shot and the “Transparency” value parameter is not found when passing in a material as a parameter but lower down in the procedure, accessing the material directly is ok.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #17731
    D3Pixel
    Customer

    Also, is there a Get Value “some value” from material? I can’t seem to find it.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #17735
    scalare
    Customer

    Hi d3pixel!

    Unfortunately, I had the same issue with the replace_texture puzzle. You can actually set the material as a variable, but if you do, you cannot refer to a texture name present in that material. Here is my thread: https://www.soft8soft.com/topic/replace-texture-puzzle-with-dynamic-texture-name-not-texture-file-name/

    Temporarily, we’re modifying the corresponding visual_logic.js function (after generating it when saving in the app manager), to accept a parameter for the texture name. Maybe you can do the same with the value name? Our function goes like this, and it works:

    function change_texture(param0, param1, param2) {
    replaceTexture(param0, param1, param2, function() {});
    }
    appInstance.ExternalInterface[“change_texture”] = change_texture;

    Yuri, will this functionality change be implemented anytime soon? I guess it has to be on both replace_texture and set_value now :)

    Thank you!

    #17740

    Yes, this is already in our nearest plans to make more flexible versions of those puzzles!

    Chief 3D Verger | LinkedIn | Twitter

    #17742
    D3Pixel
    Customer

    Hi Guys, ok thanks.

    I also found a workaround. Copy/Paste the puzzle that has the “value” you want in it, replace the actual material with the passed in material parameter (the “value” will turn red) but it still works!

    Maybe this will not work for dynamic textures but if you know the material value beforehand then it will work.

    Thanks anyway and look forwards to a fix.

    3D Animation and Web3D services - www.d3pixel.co.uk

    #17745
    scalare
    Customer

    Ah, yes. You can set the first parameter using a material that is not variable, and then change the material name with a variable. The first parameter will turn red, but it will work for textures too. But since we needed everything to be completely variable, it would not work for us.

    Thanks for sharing!

    #17765

    :good:

    Chief 3D Verger | LinkedIn | Twitter

    #17792
    jem
    Customer

    I encountered the same issue recently. It happens for me when I load new objects into the scene with puzzles. In my scenario, the materials are not present in the base scene so the puzzles do not work. I have been using the technique that @3dpixel described. It would be nice to have the option to use variables or strings in these puzzle slots. Thanks!

    Jeremy Wernick

    #17795

    Made it a high priority task! :good:

    Chief 3D Verger | LinkedIn | Twitter

    #17805
    scalare
    Customer

    Thank you! :yahoo:

    #18272
    jem
    Customer

    I just wanted to close the loop here and thank the Verge3D team. I revisited my older Verge3D project that was having issues with the replace texture puzzle. As is noted in this thread, the replace texture puzzle was too rigid. I needed the puzzle to accept variables and strings for texture names (see our reasoning above). I updated this project to 2.14.0 and, now, this puzzle will take strings and variables! You need to click on the gear icon of this puzzle piece to enable “flexible texture input”. In about two minutes, I had all of the problems resolved and this project was running as I intended. Thanks again.

    Jeremy Wernick

    #18301

    our pleasure! :bye:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.