Hi guys,
anyone with an example of how to use the new Ramp (i'm interested in the float ones). I was able to use the old ramp, but while i was ale to put in the interface of my sop the new ramp (using the PRM_MULTITYPE_RAMP_FLOAT), i'm not able to access the values from the ramp spline. Also can we use now more than one ramp parameter in the same sop?
Thanks in advance.
HDK : How to use the new Ramp?
10139 17 2- DoctorBuzz
- Member
- 12 posts
- Joined:
- Offline
- mark
- スタッフ
- 2642 posts
- Joined: 7月 2005
- Offline
DoctorBuzz
Hi guys,
anyone with an example of how to use the new Ramp (i'm interested in the float ones). I was able to use the old ramp, but while i was ale to put in the interface of my sop the new ramp (using the PRM_MULTITYPE_RAMP_FLOAT), i'm not able to access the values from the ramp spline. Also can we use now more than one ramp parameter in the same sop?
Thanks in advance.
Try OP_Parameters::updateRampFromMultiParm(). You can then look up values from the ramp using the UT_Ramp. I believe you still have to pass in the 4 floats to getColor(). For a scalar ramp, I think you just pull out the first float.
There should be no problem using more than one ramp per SOP.
- DoctorBuzz
- Member
- 12 posts
- Joined:
- Offline
- sdugaro
- Member
- 380 posts
- Joined: 7月 2005
- Offline
- edward
- Member
- 7903 posts
- Joined: 7月 2005
- Offline
- sdugaro
- Member
- 380 posts
- Joined: 7月 2005
- Offline
- JOEMI
- Member
- 128 posts
- Joined: 7月 2005
- Offline
- DoctorBuzz
- Member
- 12 posts
- Joined:
- Offline
Hi guys,
this worked for me:
static PRM_Name Ramp (“ramp”, “Ramp Values”);
static PRM_Template RampTemplates = {
PRM_Template (PRM_FLT_J, 1, &SpOffset, PRMzeroDefaults),
PRM_Template (PRM_FLT_J, 1, &SpValue, PRMzeroDefaults),
PRM_Template (PRM_INT, 1, &SpInterp, PRMtwoDefaults),
PRM_Template (),
};
PRM_Template
SOP_YourSOP::myTemplateList = {
PRM_Template (PRM_MULTITYPE_RAMP_FLT, theTwistTemplates, 1, &Ramp, PRMtwoDefaults),
PRM_Template (),
};
UT_Ramp myramp;
UT_Ramp*
SOP_YourSOP::getRamp (void)
{
PRM_Template *rampTemplate = PRMgetRampTemplate (“ramp”, PRM_MULTITYPE_RAMP_FLT, NULL);
if (myramp.getNodeCount () < 2)
{
myramp.addNode (0, UT_FRGBA (0, 0, 0, 1));
myramp.addNode (1, UT_FRGBA (1, 1, 1, 1));
}
return &myramp;
}
Then add the other node to the ramp and with the rampLookup method read their values.
Hope this can help you.
this worked for me:
static PRM_Name Ramp (“ramp”, “Ramp Values”);
static PRM_Template RampTemplates = {
PRM_Template (PRM_FLT_J, 1, &SpOffset, PRMzeroDefaults),
PRM_Template (PRM_FLT_J, 1, &SpValue, PRMzeroDefaults),
PRM_Template (PRM_INT, 1, &SpInterp, PRMtwoDefaults),
PRM_Template (),
};
PRM_Template
SOP_YourSOP::myTemplateList = {
PRM_Template (PRM_MULTITYPE_RAMP_FLT, theTwistTemplates, 1, &Ramp, PRMtwoDefaults),
PRM_Template (),
};
UT_Ramp myramp;
UT_Ramp*
SOP_YourSOP::getRamp (void)
{
PRM_Template *rampTemplate = PRMgetRampTemplate (“ramp”, PRM_MULTITYPE_RAMP_FLT, NULL);
if (myramp.getNodeCount () < 2)
{
myramp.addNode (0, UT_FRGBA (0, 0, 0, 1));
myramp.addNode (1, UT_FRGBA (1, 1, 1, 1));
}
return &myramp;
}
Then add the other node to the ramp and with the rampLookup method read their values.
Hope this can help you.
- JOEMI
- Member
- 128 posts
- Joined: 7月 2005
- Offline
- edward
- Member
- 7903 posts
- Joined: 7月 2005
- Offline
- JOEMI
- Member
- 128 posts
- Joined: 7月 2005
- Offline
- DoctorBuzz
- Member
- 12 posts
- Joined:
- Offline
- JOEMI
- Member
- 128 posts
- Joined: 7月 2005
- Offline
- JOEMI
- Member
- 128 posts
- Joined: 7月 2005
- Offline
- JOEMI
- Member
- 128 posts
- Joined: 7月 2005
- Offline
- JOEMI
- Member
- 128 posts
- Joined: 7月 2005
- Offline
- rpickler
- Member
- 7 posts
- Joined: 7月 2005
- Offline
Hate resurrecting a very old thread like this, but I'm struggling with this. I have something similar to the code above, and have tried other variations of it, but I keep getting a crash within updateRampFromMultiParm().
updateRampFromMultiParm( 0.0, getParm( “ramp” ), *r, NULL );
#1 0x00007f0422491e99 in PRM_Parm::getMultiType ()
from /packages/vendor/sidefx/linux_64/hfs10.0/dsolib/libHoudiniPRM.so
(gdb)
#2 0x00007f04225c1429 in OP_Parameters::updateRampFromMultiParm ()
from /packages/vendor/sidefx/linux_64/hfs10.0/dsolib/libHoudiniPRM.so
Just cannot figure out what's killing me here.
updateRampFromMultiParm( 0.0, getParm( “ramp” ), *r, NULL );
#1 0x00007f0422491e99 in PRM_Parm::getMultiType ()
from /packages/vendor/sidefx/linux_64/hfs10.0/dsolib/libHoudiniPRM.so
(gdb)
#2 0x00007f04225c1429 in OP_Parameters::updateRampFromMultiParm ()
from /packages/vendor/sidefx/linux_64/hfs10.0/dsolib/libHoudiniPRM.so
Just cannot figure out what's killing me here.
- edward
- Member
- 7903 posts
- Joined: 7月 2005
- Offline
-
- Quick Links