本文整理汇总了C++中IParamBlock2::GetFloat方法的典型用法代码示例。如果您正苦于以下问题:C++ IParamBlock2::GetFloat方法的具体用法?C++ IParamBlock2::GetFloat怎么用?C++ IParamBlock2::GetFloat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IParamBlock2
的用法示例。
在下文中一共展示了IParamBlock2::GetFloat方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DlgProc
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
//| custom UI update for Duration Test |
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
INT_PTR TestSpawnOnCollisionDlgProc::DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
IParamBlock2* pblock;
case WM_INITDIALOG:
pblock = map->GetParamBlock();
UpdateSpawnTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_spawnType,t),
pblock->GetInt(kSpawnCollision_deleteParent,t) );
UpdateSpeedTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_speedType,t) );
UpdateRandomSeedDlg( hWnd, pblock->GetFloat(kSpawnCollision_spawnAble,t),
pblock->GetFloat(kSpawnCollision_numVariation,t),
pblock->GetFloat(kSpawnCollision_speedVariation,t),
pblock->GetFloat(kSpawnCollision_speedDivergence,t),
pblock->GetFloat(kSpawnCollision_scaleVariation,t) );
break;
case WM_COMMAND:
pblock = map->GetParamBlock();
switch (LOWORD(wParam))
{
case IDC_NEW:
if (pblock) pblock->NotifyDependents(FOREVER, PART_OBJ, kSpawnCollision_RefMsg_NewRand);
return TRUE;
case IDC_COLLISION_PICKNODE:
if (pblock) pblock->NotifyDependents( FOREVER, 0, kSpawnCollision_RefMsg_ResetValidatorAction );
break;
case IDC_BYLIST:
if (pblock) pblock->NotifyDependents( FOREVER, 0, kSpawnCollision_RefMsg_ListSelect );
break;
case kSpawnCollision_message_type:
pblock = map->GetParamBlock();
UpdateSpawnTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_spawnType,t),
pblock->GetInt(kSpawnCollision_deleteParent,t) );
break;
case kSpawnCollision_message_speed:
pblock = map->GetParamBlock();
UpdateSpeedTypeDlg( hWnd, pblock->GetInt(kSpawnCollision_speedType,t) );
break;
case kSpawnCollision_message_random:
pblock = map->GetParamBlock();
UpdateRandomSeedDlg( hWnd, pblock->GetFloat(kSpawnCollision_spawnAble,t),
pblock->GetFloat(kSpawnCollision_numVariation,t),
pblock->GetFloat(kSpawnCollision_speedVariation,t),
pblock->GetFloat(kSpawnCollision_speedDivergence,t),
pblock->GetFloat(kSpawnCollision_scaleVariation,t) );
break;
case kSpawnCollision_message_deflectors:
pblock = map->GetParamBlock();
if (pblock)
UpdateDeflectorsDlg( hWnd, pblock->Count(kSpawnCollision_deflectors) );
break;
}
break;
}
return FALSE;
}
示例2: frameBegin
// Called at the start of each frame
void VRayCamera::frameBegin(VR::VRayRenderer *vray) {
const VR::VRayFrameData &fdata = vray->getFrameData();
TimeValue t = fdata.t;
stereo_camera=pblock->GetInt(pb_camera, t);
// angles in paramblock are automatically converted to radians, so no need to convert here
fov_angle = pblock->GetFloat(pb_fov_angle, t);
parallax_distance = pblock->GetFloat(pb_parallax_distance, t);
separation = pblock->GetFloat(pb_separation, t);
neck_offset = pblock->GetFloat(pb_neck_offset, t);
forward_tilt = pblock->GetFloat(pb_forward_tilt, t);
tilt_compensation = pblock->GetInt(pb_tilt_compensation, t);
separation_map = pblock->GetBitmap(pb_separation_map, t);
if (separation_map != NULL) {
separation_map->Load();
if (separation_map->bm != NULL) {
separation_map->bm->SetFilter(BMM_FILTER_PYRAMID);
}
}
head_turn_map = pblock->GetBitmap(pb_head_turn_map, t);
if (head_turn_map != NULL) {
head_turn_map->Load();
if (head_turn_map->bm != NULL) {
head_turn_map->bm->SetFilter(BMM_FILTER_PYRAMID);
}
}
head_tilt_map = pblock->GetBitmap(pb_head_tilt_map, t);
if (head_tilt_map != NULL) {
head_tilt_map->Load();
if (head_tilt_map->bm != NULL) {
head_tilt_map->bm->SetFilter(BMM_FILTER_PYRAMID);
}
}
vertical_mode = pblock->GetInt(pb_vertical_mode, t);
flip_x = pblock->GetInt(pb_flip_x, t);
flip_y = pblock->GetInt(pb_flip_y, t);
//fov=pblock->GetFloat(pb_fov, fdata.t);
fov = 1.0; // fov_angle/ 2.0f; // [rz] testing only. Need better approximation formula.
targetDist = GetTDist((TimeValue) fdata.t);
aperture = 0.0f;
camera.SetPos(fdata.camToWorld.offs, -fdata.camToWorld.m[2], fdata.camToWorld.m[1], fdata.camToWorld.m[0]);
camera.Init(fdata.imgWidth, fdata.imgHeight, fov, 1.0f, aperture, targetDist);
this->vray = vray;
}
示例3: DlgProc
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
//| custom UI update for Duration Test |
//+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+
INT_PTR TestGoToRotationDlgProc::DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
IParamBlock2* pblock;
case WM_INITDIALOG:
// Send the message to notify the initialization of dialog
map->GetParamBlock()->NotifyDependents( FOREVER, (PartID)map, kGoToRotation_RefMsg_InitDlg );
break;
case WM_COMMAND:
pblock = map->GetParamBlock();
switch (LOWORD(wParam))
{
case IDC_NEW:
if (pblock)
pblock->NotifyDependents(FOREVER, PART_OBJ, kGoToRotation_RefMsg_NewRand);
return TRUE;
case kGoToRotation_message_sync:
if (pblock)
UpdateSyncDlg( hWnd, pblock->GetInt(kGoToRotation_syncBy,t) );
break;
case kGoToRotation_message_variation:
if (pblock)
UpdateVariationDlg( hWnd, pblock->GetTimeValue(kGoToRotation_variation,t),
pblock->GetFloat(kGoToRotation_spinVariation,t) );
break;
case kGoToRotation_message_match:
if (pblock)
UpdateMatchDlg( hWnd, pblock->GetInt(kGoToRotation_matchSpin,t) );
break;
}
break;
}
return FALSE;
}
示例4: frameBegin
// Called at the start of each frame
void VRayCamera::frameBegin(VR::VRayRenderer *vray) {
const VR::VRayFrameData &fdata = vray->getFrameData();
TimeValue t = fdata.t;
stereo_camera=pblock->GetInt(pb_camera, t);
// angles in paramblock are automatically converted to radians, so no need to convert here
fov_vert_angle = pblock->GetFloat(pb_fov_vert_angle, t);
zenith_fov = pblock->GetInt(pb_zenithfov, t);
fov_horiz_angle = pblock->GetFloat(pb_fov_horiz_angle, t);
parallax_distance = pblock->GetFloat(pb_parallax_distance, t);
separation = pblock->GetFloat(pb_separation, t);
neck_offset = pblock->GetFloat(pb_neck_offset, t);
zenith_mode = pblock->GetInt(pb_zenith_mode, t);
separation_map = pblock->GetBitmap(pb_separation_map, t);
if (separation_map != NULL) {
separation_map->Load();
if (separation_map->bm != NULL) {
separation_map->bm->SetFilter(BMM_FILTER_PYRAMID);
}
}
flip_x = pblock->GetInt(pb_flip_x, t);
flip_y = pblock->GetInt(pb_flip_y, t);
horiz_neck = pblock->GetInt(pb_horiz_neck, t);;
poles_corr = pblock->GetInt(pb_poles_corr, t);;
poles_corr_start = pblock->GetFloat(pb_poles_corr_start, t);
poles_corr_end = pblock->GetFloat(pb_poles_corr_end, t);
parallel_cams = pblock->GetInt(pb_parall_cams, t);
// check poles corr angles
if (poles_corr_end < poles_corr_start)
poles_corr_end = poles_corr_start;
//zenith_fov = (fov_vert_angle < 0.0f) ? TRUE : FALSE;
//fov_vert_angle = abs(fov_vert_angle);
//fov=pblock->GetFloat(pb_fov, fdata.t);
fov = 1.0; // fov_vert_angle / 2.0f; // [rz] testing only. Need better approximation formula.
targetDist = GetTDist((TimeValue) fdata.t);
aperture = 0.0f;
camera.SetPos(fdata.camToWorld.offs, -fdata.camToWorld.m[2], fdata.camToWorld.m[1], fdata.camToWorld.m[0]);
camera.Init(fdata.imgWidth, fdata.imgHeight, fov, 1.0f, aperture, targetDist);
this->vray = vray;
}
示例5: DlgProc
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);
int code = HIWORD(wParam);
IParamBlock2 *pb = map->GetParamBlock();
HWND cbox = NULL;
int selection;
switch (msg)
{
case WM_INITDIALOG:
cbox = GetDlgItem(hWnd, IDC_GRASS_WAVE);
SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)"1");
SendMessage(cbox, CB_ADDSTRING, 1, (LPARAM)"2");
SendMessage(cbox, CB_ADDSTRING, 2, (LPARAM)"3");
SendMessage(cbox, CB_ADDSTRING, 3, (LPARAM)"4");
selection = pb->GetInt(plGrassComponent::kWave);
ISetToWave(selection, hWnd, pb, map);
return TRUE;
case WM_COMMAND:
case CC_SPINNER_CHANGE:
int wave = SendMessage(GetDlgItem(hWnd, IDC_GRASS_WAVE), CB_GETCURSEL, 0, 0);
if (id == IDC_GRASS_WAVE)
{
if (wave != pb->GetInt(ParamID(plGrassComponent::kWave)))
ISetToWave(wave, hWnd, pb, map);
}
else if (id == IDC_GRASS_DIST_X || id == IDC_GRASS_DIST_X_SPIN)
pb->SetValue(plGrassComponent::kDistXTab, 0, pb->GetFloat(ParamID(plGrassComponent::kDistX)), wave);
else if (id == IDC_GRASS_DIST_Y || id == IDC_GRASS_DIST_Y_SPIN)
pb->SetValue(plGrassComponent::kDistYTab, 0, pb->GetFloat(ParamID(plGrassComponent::kDistY)), wave);
else if (id == IDC_GRASS_DIST_Z || id == IDC_GRASS_DIST_Z_SPIN)
pb->SetValue(plGrassComponent::kDistZTab, 0, pb->GetFloat(ParamID(plGrassComponent::kDistZ)), wave);
else if (id == IDC_GRASS_DIR_X || id == IDC_GRASS_DIR_X_SPIN)
pb->SetValue(plGrassComponent::kDirXTab, 0, pb->GetFloat(ParamID(plGrassComponent::kDirX)), wave);
else if (id == IDC_GRASS_DIR_Y || id == IDC_GRASS_DIR_Y_SPIN)
pb->SetValue(plGrassComponent::kDirYTab, 0, pb->GetFloat(ParamID(plGrassComponent::kDirY)), wave);
else if (id == IDC_GRASS_SPEED || id == IDC_GRASS_SPEED_SPIN)
pb->SetValue(plGrassComponent::kSpeedTab, 0, pb->GetFloat(ParamID(plGrassComponent::kSpeed)), wave);
return TRUE;
}
return FALSE;
}
示例6: BeginEditParams
void OrientConstRotation::BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev )
{
if(GetLocked()==false)
{
this->ip = ip;
editCont = this;
if (flags & BEGIN_EDIT_HIERARCHY) {
InterpCtrlUI *ui;
ui = new InterpCtrlUI(NULL,ip,this);
DWORD f=0;
SetProperty(PROPID_INTERPUI,ui);
}
else {
orientCD.BeginEditParams(ip, this, flags, prev);
}
ip->RegisterTimeChangeCallback(&orientConstTimeChangeCallback);
orientConstTimeChangeCallback.orient_controller = this;
IParamMap2* pmap = pblock->GetMap();
if (pmap) hWnd = pmap->GetHWnd();
if (last_selection < 0){
RedrawListbox(GetCOREInterface()->GetTime());
}
else {
RedrawListbox(GetCOREInterface()->GetTime(), last_selection);
ISpinnerControl* spin = GetISpinner(GetDlgItem(hWnd, IDC_ORIENT_CONS_WEIGHT_SPINNER));
if (spin != NULL){
float value = pblock->GetFloat(orientation_target_weight, GetCOREInterface()->GetTime(), last_selection);
spin->SetValue(value, FALSE);
}
ReleaseISpinner(spin);
}
}
}
示例7: EvalColor
AColor CrackVisualizer::EvalColor(ShadeContext& sc)
{
if (gbufID) sc.SetGBufferID(gbufID);
float dist = pblock->GetFloat( pb_spin, sc.CurTime() )*0.1f;
float distSquared = dist*dist;
float minDist = 9999999999999999999.0f;
// we must be sure that minDist is a value greater than dist
// ...
//AColor edgeColor = AColor (1.0f,0.0f,0.0f,1.0f);
AColor edgeColor = pblock->GetAColor( pb_color, sc.CurTime() );
edgeColor.a = 1.0f;
int nodeID = sc.NodeID();
if( !sc.globContext )
return AColor (0.0f,0.0f,0.0f,0.0f);
RenderInstance* inst = sc.globContext->GetRenderInstance(nodeID);
if( (inst==NULL) || (inst->mesh==NULL) || NULL == inst->mesh->faces || inst->mesh->getNumFaces() <= sc.FaceNumber() )
{
return AColor (0.0f,0.0f,0.0f,0.0f);
}
// if an entry for the current nodeID doesnt exist
if( adjBoundaryEdges.find( nodeID ) == adjBoundaryEdges.end() )
// build the table
findAdjBoundaryEdges( nodeID, inst );
int faceIndex = sc.FaceNumber();
Face& f = inst->mesh->faces[faceIndex];
// compute Position of p
Point3 bary = sc.BarycentricCoords();
Point3 p = bary[0]*inst->mesh->getVert(f.getVert(0)) + bary[1]*inst->mesh->getVert(f.getVert(1)) + bary[2]*inst->mesh->getVert(f.getVert(2));
// p is not close to any boundary edge
// check if p close to any vertex which neighbours a boundaryedge from another triangle
for( int i=0; i<3; ++i )
{
// if wireframe
if(0)
{
DWORD edgeIdx = f.GetEdgeIndex( f.getVert(i), f.getVert((i+1)%3) );
// get vertex positions
Point3 v0 = inst->mesh->getVert(f.getVert(i));
Point3 v1 = inst->mesh->getVert(f.getVert(i+1)%3);
// compute distance p <-> edge v0, v1
//float edgeDistance = distancePointLine( p, v0, v1 );
float edgeDistance = Dist3DPtToLine( &p, &v0, &v1 );
edgeDistance = edgeDistance*edgeDistance;
// if distance of p is closer then 1/10 of the distance of v2 to that edge
if( edgeDistance < minDist )
minDist = edgeDistance;
}
// if there is any incident boundary edge to the current vertex, than we know that it is a
// boundary vertex
if( !adjBoundaryEdges[nodeID][f.getVert(i)].empty() )
{
// current vertex is a boundary vertex
// comute distance of p to that vertex
float vertexDistance = (inst->mesh->getVert( f.getVert(i) ) - p).LengthSquared();
if( vertexDistance < minDist )
minDist = vertexDistance;
// check all boundary edges which are adjacent to the vertex and may
// come from other faces
for( int j = 0; j<adjBoundaryEdges[nodeID][f.getVert(i)].size(); ++j )
{
// compute distance to that edge
Point3 v0 = inst->mesh->getVert( adjBoundaryEdges[nodeID][f.getVert(i)][j].first );
Point3 v1 = inst->mesh->getVert( adjBoundaryEdges[nodeID][f.getVert(i)][j].second );
// compute dotproduct
Point3 vec = p - v0;
Point3 direction = Normalize( v1 - v0 );
float maxLength = Length( v1 - v0 );
float dp = DotProd( vec, direction );
if( (dp<0.0f)||(dp>maxLength) )
continue;
float edgeDistance = LengthSquared( vec - dp*direction );
if( edgeDistance < minDist )
minDist = edgeDistance;
}
}
}
//.........这里部分代码省略.........
示例8: GetDiffuseLevel
float GetDiffuseLevel(TimeValue t){ return pblock->GetFloat(onb_diffuse_level,t); }
示例9: GetLowThresh
float Noise::GetLowThresh()
{
if (pblock != NULL)
return pblock->GetFloat(noise_lowthresh, GetCOREInterface()->GetTime());
else return 0;
}
示例10: ExportUserAttributes
void MaxAWDExporter::ExportUserAttributes(Animatable *obj, AWDAttrElement *elem)
{
if (!opts->ExportAttributes())
return;
ICustAttribContainer *attributes = obj->GetCustAttribContainer();
if (attributes) {
int a=0;
int numAttribs=0;
numAttribs = attributes->GetNumCustAttribs();
for (a=0; a<numAttribs; a++) {
int k=0;
CustAttrib *attr = attributes->GetCustAttrib(a);
for (k=0; k<attr->NumParamBlocks(); k++) {
int p=0;
IParamBlock2 *block = attr->GetParamBlock(k);
if (block!=NULL){
char * blockName_ptr=W2A(block->GetLocalName());
if (ATTREQ(blockName_ptr,"AWDObjectSettingsParams") ){ }
// the next three should not occur yet, as we do not read Custom-properties on materials yet
else if (ATTREQ(blockName_ptr,"AWD_MaterialSettingsparams") ){ }
else if (ATTREQ(blockName_ptr,"AWD_EffectMethodsparams") ){ }
else if (ATTREQ(blockName_ptr,"AWDShadingParams") ){ }
else{
for (p=0; p<block->NumParams(); p++) {
ParamID pid = block->IndextoID(p);
Color col;
AColor acol;
Interval valid = FOREVER;
awd_uint16 len = 0;
AWD_field_type type = AWD_FIELD_FLOAT32;
AWD_field_ptr ptr;
ptr.v = NULL;
switch (block->GetParameterType(pid)) {
case TYPE_ANGLE:
case TYPE_PCNT_FRAC:
case TYPE_WORLD:
case TYPE_FLOAT:
type = AWD_FIELD_FLOAT64;
len = sizeof(awd_float64);
ptr.v = malloc(len);
*ptr.f64 = block->GetFloat(pid);
break;
case TYPE_TIMEVALUE:
case TYPE_INT:
type = AWD_FIELD_INT32;
len = sizeof(awd_int32);
ptr.v = malloc(len);
*ptr.i32 = block->GetInt(pid);
break;
case TYPE_BOOL:
type = AWD_FIELD_BOOL;
len = sizeof(awd_bool);
ptr.v = malloc(len);
*ptr.b = (0 != block->GetInt(pid));
break;
case TYPE_FILENAME:
case TYPE_STRING:
type = AWD_FIELD_STRING;
ptr.str = (char*)block->GetStr(pid);
len = strlen(ptr.str);
break;
case TYPE_RGBA:
type = AWD_FIELD_COLOR;
len = sizeof(awd_color);
col = block->GetColor(pid);
ptr.v = malloc(len);
*ptr.col = awdutil_float_color(col.r, col.g, col.b, 1.0);
break;
case TYPE_FRGBA:
type = AWD_FIELD_COLOR;
len = sizeof(awd_color);
acol = block->GetAColor(pid);
ptr.v = malloc(len);
*ptr.col = awdutil_float_color(acol.r, acol.g, acol.b, acol.a);
break;
}
if (ptr.v != NULL) {
ParamDef def = block->GetParamDef(pid);
if (ns == NULL) {
// Namespace has not yet been created; ns is a class
// variable that will be created only once and then
// reused for all user attributes.
char * ns_ptr=opts->AttributeNamespace();//dont free, as this will get freed in the opts delete
ns = new AWDNamespace(ns_ptr, strlen(ns_ptr));
awd->add_namespace(ns);
}
char * thisName=W2A(def.int_name);
elem->set_attr(ns, thisName, strlen(thisName)+1, ptr, len, type);
free(thisName);
//.........这里部分代码省略.........
示例11: GetSoftenLevel
float GetSoftenLevel(TimeValue t){ return pblock->GetFloat(onb_soften,t); }
示例12: GetSelfIllum
float GetSelfIllum(TimeValue t){ return pblock->GetFloat(onb_self_illum_amnt,t); }
示例13: RedrawListbox
void OrientConstRotation::RedrawListbox(TimeValue t, int sel)
{
if (hWnd == NULL) return;
if (!ip || editCont != this) return;
int isWorldinListboxFlag = 0;
if(!orientCD.NumParamMaps()) return;
int selection = SendDlgItemMessage(hWnd, IDC_ORIENT_TARG_LIST, LB_GETCURSEL, 0, 0);
// IParamBlock2* pb = orientCD.GetParamMap(0)->GetParamBlock();
SendDlgItemMessage(hWnd, IDC_ORIENT_TARG_LIST, LB_RESETCONTENT, 0, 0);
int ts = 64; // appears smaller than necessary since for a large no of targets the vertical scroll bar needs space
SendDlgItemMessage(hWnd, IDC_ORIENT_TARG_LIST, LB_SETTABSTOPS, 1, (LPARAM)&ts);
int ct = pblock->Count(orientation_target_list);
int ctf = pblock->Count(orientation_target_weight);
if (ct != ctf) return; // CAL-09/10/02: In the middle of changing table size.
for (int i = 0; i < ct; i++){
TSTR str;
INode *testNode;
testNode = pblock->GetINode(orientation_target_list, t, i);
if (testNode == NULL){
str.printf( _T("%-s\t%-d"), // NOTE: for tab "\t" to use, check "use tabstops" in the resource listbox properties
_T("World"), (int)pblock->GetFloat(orientation_target_weight, t, i));
isWorldinListboxFlag = 1;
ICustButton *iPickOb;
iPickOb = GetICustButton(GetDlgItem(hWnd, IDC_ORIENT_PICK_WORLD));
if (iPickOb != NULL){
iPickOb->Enable(FALSE);
ReleaseICustButton(iPickOb);
}
}
else{
float wwt = pblock->GetFloat(orientation_target_weight, t, i);
const TCHAR * nname = testNode->GetName();
str.printf(_T("%-s\t%-d"),
testNode->GetName(),
(int)pblock->GetFloat(orientation_target_weight, t, i));
}
SendDlgItemMessage(hWnd, IDC_ORIENT_TARG_LIST, LB_ADDSTRING, 0, (LPARAM)(LPCTSTR) str.data());
}
if(!isWorldinListboxFlag){
ICustButton *iPickOb;
iPickOb = GetICustButton(GetDlgItem(hWnd, IDC_ORIENT_PICK_WORLD));
if (iPickOb != NULL){
iPickOb->Enable(TRUE);
ReleaseICustButton(iPickOb);
}
}
if (ct > 0){
if (sel >= 0){
SendDlgItemMessage(hWnd, IDC_ORIENT_TARG_LIST, LB_SETCURSEL, sel, 0);
}
else{
// int selection = SendDlgItemMessage(hWnd, IDC_POS_TARG_LIST, LB_GETCURSEL, 0, 0);
if (selection >= 0){
SendDlgItemMessage(hWnd, IDC_ORIENT_TARG_LIST, LB_SETCURSEL, selection, 0);
last_selection = selection;
}
else if (ct == 1){
SendDlgItemMessage(hWnd, IDC_ORIENT_TARG_LIST, LB_SETCURSEL, 0, 0);
last_selection = 0;
}
}
ISpinnerControl* spin = GetISpinner(GetDlgItem(hWnd, IDC_ORIENT_CONS_WEIGHT_SPINNER));
if (last_selection >= 0 && spin != NULL){
float value = pblock->GetFloat(orientation_target_weight, GetCOREInterface()->GetTime(), last_selection);
spin->SetValue(value, FALSE);
}
ReleaseISpinner(spin);
}
HWND hListBox = GetDlgItem(hWnd, IDC_ORIENT_TARG_LIST);
int extent = computeHorizontalExtent(hListBox, TRUE, 1, &ts);
SendMessage(hListBox, LB_SETHORIZONTALEXTENT, extent, 0);
UpdateWindow(hWnd);
}
示例14: GetSpecularLevel
float GetSpecularLevel(TimeValue t){ return pblock->GetFloat(onb_specular_level,t); }
示例15: if
plLayerInterface *plLayerConverter::IConvertLayerTex( plPlasmaMAXLayer *layer,
plMaxNode *maxNode, uint32_t blendFlags,
bool preserveUVOffset, bool upperLayer )
{
hsGuardBegin( "plLayerConverter::IConvertLayerTex" );
IParamBlock2 *bitmapPB;
plLocation loc;
loc = maxNode->GetLocation();
bitmapPB = layer->GetParamBlockByID( plLayerTex::kBlkBitmap );
if( !bitmapPB )
{
fErrorMsg->Set( !bitmapPB, "Plasma Layer Error", "Bitmap paramblock for Plasma Layer not found" ).Show();
fErrorMsg->Set();
return nil;
}
// Get a new layer to play with
plLayer *plasmaLayer = ICreateLayer( plString::FromUtf8( layer->GetName() ), upperLayer, loc );
// We're using a texture, try and get its info
PBBitmap *pbbm = nil;
BitmapInfo *bi = nil;
if( bitmapPB->GetInt( kBmpUseBitmap ) )
{
if( bitmapPB )
pbbm = bitmapPB->GetBitmap( kBmpBitmap );
if( pbbm )
bi = &pbbm->bi;
}
// If the texture had bad info, assert and return the empty layer
if( !bi || !bi->Name() || !strcmp(bi->Name(), "") )
{
if( upperLayer )
{
if( fErrorMsg->Set( !( fWarned & kWarnedNoUpperTexture ), "Plasma Export Error", sWarnNoUpperTexture, maxNode->GetName() ).CheckAskOrCancel() )
fWarned |= kWarnedNoUpperTexture;
fErrorMsg->Set( false );
delete plasmaLayer;
return nil;
}
else
{
return (plLayerInterface *)plasmaLayer;
}
}
// Setup the texture creation parameters
plBitmapData bd;
bd.fileName = bi->Name();
// Create texture and add it to list if unique
int32_t texFlags = 0;//hsGTexture::kMipMap;
// Texture Alpha/Color
if( bitmapPB->GetInt( kBmpInvertColor ) )
plasmaLayer->SetBlendFlags( plasmaLayer->GetBlendFlags() | hsGMatState::kBlendInvertColor );
if( bitmapPB->GetInt( kBmpDiscardColor ) )
plasmaLayer->SetBlendFlags( plasmaLayer->GetBlendFlags() | hsGMatState::kBlendNoTexColor );
if( bitmapPB->GetInt( kBmpDiscardAlpha ) )
plasmaLayer->SetBlendFlags( plasmaLayer->GetBlendFlags() | hsGMatState::kBlendNoTexAlpha );
if( bitmapPB->GetInt( kBmpInvertAlpha ) )
bd.invertAlpha = true;
// Texture quality
if( bitmapPB->GetInt( kBmpNonCompressed ) )
texFlags |= plBitmap::kForceNonCompressed;
if( bitmapPB->GetInt( kBmpNoDiscard ) )
texFlags |= plBitmap::kDontThrowAwayImage;
switch( bitmapPB->GetInt( kBmpScaling ) )
{
case kScalingHalf: texFlags |= plBitmap::kHalfSize; break;
case kScalingNone: texFlags |= plBitmap::kNoMaxSize; break;
}
// Mip map filtering.
if( bitmapPB->GetInt( kBmpNoFilter ) )
texFlags |= plBitmap::kForceOneMipLevel;
if( bitmapPB->GetInt( kBmpMipBias ) )
{
plasmaLayer->SetZFlags( plasmaLayer->GetZFlags() | hsGMatState::kZLODBias );
plasmaLayer->SetLODBias( bitmapPB->GetFloat( kBmpMipBiasAmt, fConverterUtils.GetTime( fInterface ) ) );
}
float sig = bitmapPB->GetFloat( kBmpMipBlur );
bd.texFlags = texFlags;
bd.sig = sig;
// Get detail parameters
if( bitmapPB->GetInt( kBmpUseDetail ) )
{ // TODO: be smarter
if( blendFlags & hsGMatState::kBlendAdd )
//.........这里部分代码省略.........