konstantin magnus Posted October 9, 2018 Share Posted October 9, 2018 I am currently creating a little HDRI studio inside COP land. The user should be enabled to freely add "light sources" (aka spots and rectangles on the image canvas). How can I integrate a plus button in my parameter field? How can I duplicate parameters with it? Here is a mockup: Instead of adding more and more nodes, I would like to fill up arrays holding all spot positions, light intensities etc. Quote Link to comment Share on other sites More sharing options...
StepbyStepVFX Posted October 9, 2018 Share Posted October 9, 2018 Hi, I think I would probably do it in Python, using PyQt, to have all the "dynamic" funcionnalities you want (adding fields etc.), and then create a script that takes all this info and creates the VOP COP node with all the proper children nodes and parameters within it Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 9, 2018 Author Share Posted October 9, 2018 (edited) Radical approach! ; ) I was rather expecting hints at parameter menu scripts, but rewriting the whole thing is of course another option. Edited October 9, 2018 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
anim Posted October 10, 2018 Share Posted October 10, 2018 you can do it comfortably in vex since you can get parameter values using ch*("path/to/parm") however COP VEX context is older and I don't see a way to define Evaluation node path like in Attrib VOP so you'll probably have to use absolute paths and for that you can use opfullpath('.') the code will look something like this (careful, I added print just to test, don't use print on large images): string op = opfullpath("."); int lights = chi(op + "/lights"); for(int i=0; i<lights; i++){ string si = itoa(i); vector spot_pos = chv(op + "/spot_pos" + si); float spot_size = chf(op + "/spot_size" + si); float spot_int = chf(op + "/spot_int" + si); vector spot_color = chv(op + "/spot_color" + si); printf("\nLight%d: pos: %g | size: %f | int: %f | color: %g ", i, spot_pos, spot_size, spot_int, spot_color); } ts_multiparm_cop_vex.hip 1 Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted October 15, 2018 Author Share Posted October 15, 2018 On 10.10.2018 at 5:27 AM, anim said: you can do it comfortably in vex Excellent! Thank you. Quote Link to comment Share on other sites More sharing options...
konstantin magnus Posted February 15, 2021 Author Share Posted February 15, 2021 (edited) A way to dynamically set the number of multiparm blocks based on the number of unique primitive classes: nuniquevals('../classes', D_PRIMITIVE, 'class') Edited February 15, 2021 by konstantin magnus Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.