- This topic has 11 replies, 4 voices, and was last updated 5 years, 3 months ago by Yuri Kovelenov.
-
AuthorPosts
-
2019-08-09 at 10:10 am #17723D3PixelCustomer
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
2019-08-09 at 11:05 am #17731D3PixelCustomerAlso, 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
2019-08-09 at 12:53 pm #17735scalareCustomerHi 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!
2019-08-09 at 3:41 pm #17740Yuri KovelenovStaff2019-08-09 at 4:45 pm #17742D3PixelCustomerHi 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
2019-08-09 at 5:00 pm #17745scalareCustomerAh, 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!
2019-08-11 at 9:43 am #17765Yuri KovelenovStaff2019-08-12 at 8:46 pm #17792jemCustomerI 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
2019-08-13 at 6:42 am #17795Yuri KovelenovStaff2019-08-13 at 12:16 pm #17805scalareCustomerThank you!
2019-08-29 at 6:28 pm #18272jemCustomerI 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
2019-08-31 at 5:29 am #18301Yuri KovelenovStaff -
AuthorPosts
- You must be logged in to reply to this topic.