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

This topic contains 11 replies, has 4 voices, and was last updated by Yuri Kovelenov Yuri Kovelenov 3 months, 2 weeks ago.

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

    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.

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

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

    #17731
    D3Pixel
    D3Pixel
    Licensee

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

    • This reply was modified 4 months, 1 week ago by D3Pixel D3Pixel.

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

    #17735
    Avatar
    scalare
    Licensee

    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
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

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

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #17742
    D3Pixel
    D3Pixel
    Licensee

    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.

    • This reply was modified 4 months, 1 week ago by D3Pixel D3Pixel.
    • This reply was modified 4 months, 1 week ago by D3Pixel D3Pixel.

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

    #17745
    Avatar
    scalare
    Licensee

    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
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    :good:

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #17792
    Avatar
    jem
    Licensee

    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!

    #17795
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Made it a high priority task! :good:

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #17805
    Avatar
    scalare
    Licensee

    Thank you! :yahoo:

    #18272
    Avatar
    jem
    Licensee

    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.

    #18301
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    our pleasure! :bye:

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.