DoctorBuzz Posted March 23, 2006 Share Posted March 23, 2006 Hi guys, I would to insert a ramp parameter like that in the Color POP, or in alternative like that in the Ramp COP (I'm also interested in how to add multiple parameter with the "more" button like in the Shader SOP). Any suggestion? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted March 23, 2006 Share Posted March 23, 2006 There's is an example of using multiparms in the HDK samples directory. AFAIR Quote Link to comment Share on other sites More sharing options...
Jason Posted March 23, 2006 Share Posted March 23, 2006 AFAIR 25903[/snapback] There might be another way to write this, IIRC. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted March 23, 2006 Share Posted March 23, 2006 YMBR Quote Link to comment Share on other sites More sharing options...
TheUsualAlex Posted March 23, 2006 Share Posted March 23, 2006 WAYTA...? Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted March 23, 2006 Author Share Posted March 23, 2006 Thanks sibarrick, i found it... Any suggestion for the Ramp parameter? Quote Link to comment Share on other sites More sharing options...
sibarrick Posted March 23, 2006 Share Posted March 23, 2006 (edited) Haven't seen anything like that in my Hdk travels so far. PRM_Type.h does contain a PRM_FLT_RAMPEDIT type but I've never tried using it. Edited March 23, 2006 by sibarrick Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted March 23, 2006 Author Share Posted March 23, 2006 Yes, i saw it, but it only show the rgb and alpha slider. I would to find the way to have a ramp parameter like that in the ramp tab of the Color POP. Anyway thanks for your help. Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted March 26, 2006 Author Share Posted March 26, 2006 Anyone knows how to add a ramp editor? I saw the PRM_FLT_RAMPEDIT and found the UT_Ramp class, but i;m not able to understand how to use them. Any other suggestion? Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted April 5, 2006 Author Share Posted April 5, 2006 Hi guys, sorry for the same question again, but really anybody knows how to add a Ramp editor parameter in a SOP? I can't figure it out.... Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted April 11, 2006 Author Share Posted April 11, 2006 Any of the HDK guru can help me on the Ramp editor parameter? George? edward? Quote Link to comment Share on other sites More sharing options...
edward Posted April 12, 2006 Share Posted April 12, 2006 I've never used a ramp parameter either. From a cursory glance, it looks like you need to do something like this: 1. Create a UT_Ramp member variable to you class. eg. UT_Ramp myRamp; 2. Override OP_Node::getRamp() in your own class to return this data. eg. virtual UT_Ramp* getRamp (void) { return &myRamp; } 3. Add the ramp parameter to your template, along with a FLT_J parameter to do the lookup. eg. PRM_Template SOP_MySop::myTemplateList[] = { ... PRM_Template(PRM_FLT_RAMPEDIT, 4, &MyRampName), PRM_Template(PRM_FLT_J, 1, &MyRampUName), ... }; 4. To evaluate your ramp, obtain the u value and then use that to index into myRamp. eg. float vals[4]; float u = evalFloat(MyRampUName.getToken(), 0, t); myRamp.getColor(u, vals); I have no idea whether any of this will work of course ... If you figure out, make sure to add it to odwiki. Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted April 12, 2006 Author Share Posted April 12, 2006 Thanks edward I'll try your suggestions and i'll post my results if i'll be able to make it working. Thanks again. Quote Link to comment Share on other sites More sharing options...
DoctorBuzz Posted April 16, 2006 Author Share Posted April 16, 2006 Hi edward just to say that your suggestions are perfect...works like a charm. The secret is to override the getramp() and put into it some functions...i only had to populate the ramp with two colornodes UT_Ramp* SOP_MySOP::getRamp(void) { if(myramp.getNodeCount() < 2) { myramp.addNode(0,UT_FRGBA(0,0,0,1)); myramp.addNode(1,UT_FRGBA(1,1,1,1)); } return &myramp; } The only bad thing is that seems that we can only use one ramp per SOP (the color POP works in the same way, you cannot use one ramp for the color and another for the alpha of particles)... You know some way to include two distinct ramp parameter in the same SOP that do not shares color nodes? This could be very usefull...you can modulate a lot of things with color ramps... Anyway thank you very much for your help Quote Link to comment Share on other sites More sharing options...
edward Posted April 17, 2006 Share Posted April 17, 2006 Yeah, there's no way to use more than one color ramp parameter per operator right now. I agree it would be nice if it could. 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.