Beispiel #1
0
//From ReferenceMaker 
RefResult RendSpline::NotifyRefChanged(
		const Interval& changeInt, RefTargetHandle hTarget,
		PartID& partID, RefMessage message, BOOL propagate) 
{
	if(hTarget == pblock && message == REFMSG_CHANGE)
	{
		ParamID changing_param = pblock->LastNotifyParamID();
		IParamMap2 *map = pblock->GetMap();
		if(!map)
			return REF_SUCCEED;

		switch(changing_param)
		{
			case rnd_v2_width:
				OnSetWidthLength(map->GetHWnd(), rnd_v2_length, rnd_v2_width, GetCOREInterface()->GetTime(), TRUE);
				break;
			case rnd_v2_vpt_width:
				OnSetWidthLength(map->GetHWnd(), rnd_v2_vpt_length, rnd_v2_vpt_width, GetCOREInterface()->GetTime(), TRUE);
				break;
			case rnd_v2_length:
				OnSetWidthLength(map->GetHWnd(), rnd_v2_length, rnd_v2_width, GetCOREInterface()->GetTime(), FALSE);
				break;
			case rnd_v2_vpt_length:
				OnSetWidthLength(map->GetHWnd(), rnd_v2_vpt_length, rnd_v2_vpt_width, GetCOREInterface()->GetTime(), FALSE);
				break;
		}
	}

	return REF_SUCCEED;
}
  void Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t)
  {
    VRayCamera *cam = (VRayCamera*)owner;
    IParamMap2* pmap = cam->pblock->GetMap();
    TSTR p, f, e, name;

    switch (id) {
      case pb_separation_map: {
        if (pmap) {
          TSTR sepname(v.bm->bi.Name());
          SplitFilename(sepname, &p, &f, &e);
          name = f + e;
          pmap->SetText(pb_separation_map, name.data());
        } break;
      }
      case pb_head_turn_map: {
        if (pmap) {
          TSTR sepname(v.bm->bi.Name());
          SplitFilename(sepname, &p, &f, &e);
          name = f + e;
          pmap->SetText(pb_head_turn_map, name.data());
        } break;
      }
      case pb_head_tilt_map: {
        if (pmap) {
          TSTR sepname(v.bm->bi.Name());
          SplitFilename(sepname, &p, &f, &e);
          name = f + e;
          pmap->SetText(pb_head_tilt_map, name.data());
        } break;
      }
      default: break;
    }
  }
Beispiel #3
0
void RendSpline::CheckAspectLock(TimeValue t)
{
	ParamID lengthID;
	ParamID widthID;
	ParamID aspectlockID;
	float length, width, aspect = 1.0f;
	BOOL aspectlocked = FALSE;

	if(UseViewOrRenderParams(t) == rbViewport)
	{
		widthID = rnd_v2_vpt_width;
		lengthID = rnd_v2_vpt_length;
		aspectlockID = rnd_v2_vpt_aspect_lock;
	}
	else
	{
		widthID = rnd_v2_width;
		lengthID = rnd_v2_length;
		aspectlockID = rnd_v2_aspect_lock;
	}
	pblock->GetValue(lengthID,t,length,FOREVER);
	pblock->GetValue(widthID,t,width,FOREVER);
	pblock->GetValue(aspectlockID,t,aspectlocked,FOREVER);	

	IParamMap2 *map = pblock->GetMap(0);

	if(map)
	{
		ISpinnerControl *iSpin = GetISpinner(GetDlgItem(map->GetHWnd(), IDC_ASPECTSPIN));
		aspect = iSpin->GetFVal();
	}

	pblock->GetMap()->Enable(aspectlockID,((length != 0.0f && width != 0.0f && aspect != 0.0f) || aspectlocked));
}
Beispiel #4
0
RefResult SmoothMod::NotifyRefChanged (const Interval& changeInt, RefTargetHandle hTarget,
                              PartID& partID, RefMessage message, BOOL propagate) {
   switch (message) {
   case REFMSG_CHANGE:
      if (hTarget == pblock) {
         ParamID idToUpdate = pblock->LastNotifyParamID();
         smooth_param_desc.InvalidateUI (idToUpdate);
         switch (idToUpdate) {
         case -1:
         case sm_smoothbits:
         case sm_autosmooth:
            if (smoothDesc.NumParamMaps() > 0) {
               IParamMap2 *pmap = smoothDesc.GetParamMap(0);
               if (pmap) {
                  HWND hWnd = pmap->GetHWnd();
                  if (hWnd) theSmoothDlgProc.Invalidate (hWnd);
               }
            }
            break;
         }
      }
      break;
   }
   return REF_SUCCEED;
}
Beispiel #5
0
RefResult SymmetryMod::NotifyRefChanged( const Interval& changeInt,RefTargetHandle hTarget, 
						   PartID& partID, RefMessage message, BOOL propagate) {
	ParamID pid;
	int weld;
	IParamMap2 *pPMap;
	HWND hDialog, hThreshLabel;

	switch (message) {
	case REFMSG_CHANGE:
		if (hTarget != mp_pblock)
			break;
		pid = mp_pblock->LastNotifyParamID ();
		if (pid != kSymWeld) 
			break;

		pPMap = mp_pblock->GetMap(kSymmetryParams);
		if (!pPMap)
			break;
		hDialog = pPMap->GetHWnd();
		if (!hDialog)
			break;

		mp_pblock->GetValue (kSymWeld, TimeValue(0), weld, FOREVER);
		hThreshLabel = GetDlgItem (hDialog, IDC_SYM_THRESH_LABEL);
		if (hThreshLabel) 
			EnableWindow (hThreshLabel, weld);
		break;
	}
	return REF_SUCCEED;
}
Beispiel #6
0
static INT_PTR CALLBACK plStealthMouseOverrideProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
    IParamMap2 *map = (IParamMap2 *)GetWindowLongPtr( hWnd, GWLP_USERDATA );

    switch( msg )
    {
        case WM_LBUTTONDOWN:
        case WM_LBUTTONUP:
        case WM_MOUSEMOVE:
            {
                // We don't want the COREInterface to process our mouse messages with RollupMouseMessage;
                // rather, we want IMtlParams to do it just like it would if we could actually call
                // CreateChildMParamMap2
                IParamBlock2 *pb = map->GetParamBlock();
                if( pb != nil )
                {
                    plAnimStealthNode *stealth = (plAnimStealthNode *)pb->GetOwner();
                    if( stealth != nil )
                    {
                        plPassMtlBase *mtl = (plPassMtlBase *)stealth->GetParentMtl();
                        mtl->fIMtlParams->RollupMouseMessage( hWnd, msg, wParam, lParam );
                    }
                }
            return 0;
            }
    }

    if( sOldStealthDlgProc != nil )
        return CallWindowProc( sOldStealthDlgProc, hWnd, msg, wParam, lParam );
    else
        return 0;
}
Beispiel #7
0
void Matte::EnableStuff() {
   if (pblock) {
      IParamMap2 *map = pblock->GetMap();
      if (map) {
         map->Enable(matte_reflection_amount, reflmap?TRUE:FALSE);
         map->Enable(matte_affect_alpha, opaque?FALSE:TRUE);
         }
      }
   }
Beispiel #8
0
	void Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t)
	{
		if (id == kConeAngleUseSquare)
		{
			IParamMap2* pmap = ((IParamBlock2*)((ConeAngleManipulator*)owner)->GetReference(PBLOCK_REF_NO))->GetMap();
			if (pmap) pmap->Enable(kConeAngleAspect, v.i);
		}
			
	}
Beispiel #9
0
void Gradient::EnableStuff() {
	if (pblock) {
		IParamMap2 *map = pblock->GetMap();
		pblock->GetValue( grad_noise_type, 0, noiseType, FOREVER );
		if (map) {
			map->Enable(grad_levels, noiseType==NOISE_REGULAR?FALSE:TRUE);
			}
		}
	}
void PFTestGoToRotation::UpdatePViewUI(ParamID updateID) const
{
	for(int i=0; i<NumPViewParamMaps(); i++) {
		IParamMap2* map = GetPViewParamMap(i);
		map->Invalidate(updateID);
		Interval currentTimeInterval;
		currentTimeInterval.SetInstant(GetCOREInterface()->GetTime());
		map->Validity() = currentTimeInterval;
	}
}
//+--------------------------------------------------------------------------+
//|							From ReferenceMaker								 |
//+--------------------------------------------------------------------------+
void PFOperatorForceSpaceWarp::UpdatePViewUI(IParamBlock2* pblock, ParamID updateID)
{
	for(int i=0; i<NumPViewParamMaps(); i++) {
		IParamMap2* map = GetPViewParamMap(i);
		if (pblock != map->GetParamBlock()) continue;
		map->Invalidate(updateID);
		Interval currentTimeInterval;
		currentTimeInterval.SetInstant(GetCOREInterface()->GetTime());
		map->Validity() = currentTimeInterval;
	}
}
Beispiel #12
0
void    plAnimStealthNode::SwitchDlg( plAnimStealthNode *toSwitchTo )
{
    IParamMap2 *map = fParamBlock->GetMap();

    fParamBlock->SetMap( nil );
    toSwitchTo->fParamBlock->SetMap( map );

    map->SetParamBlock( toSwitchTo->fParamBlock );
    map->SetThing( (ReferenceTarget *)toSwitchTo );
    map->Invalidate();
    map->UpdateUI( 0 );
}
Beispiel #13
0
void FormationBhvr::SetLeaderNodeText()
{

	if (!editing) return;
    IParamMap2 *pmap = pblock->GetMap();
	if (!pmap) return;
	INode *node;
    node = pblock->GetINode(leader,0,0);
	if(node)
		pmap->SetText(leader,node->GetName());
	else
		pmap->SetText(leader,GetString(IDS_NONE));
}
Beispiel #14
0
void FormationBhvr::SetFollowerNodeText()
{
	if (!editing) return;
    IParamMap2 *pmap = pblock->GetMap();
	if (!pmap) return;
	if (pblock->Count(follower) == 0)
         pmap->SetText(follower_single,GetString(IDS_NONE));
	else if (pblock->Count(follower) == 1)
	     {
	          INode *node;
              node = pblock->GetINode(follower,0,0);
    	      if (node) pmap->SetText(follower_single,node->GetName());
         }
	     else pmap->SetText(follower_single,GetString(IDS_MULTIPLE));
}
Beispiel #15
0
void RendSpline::ParamAccessor::Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t)
{
	if (owner != NULL && RendSpline::paramDlgProc != NULL)
	{
		RendSpline* mod = static_cast<RendSpline*>(owner);
		IParamBlock2* pb = owner->GetParamBlock(0);
		if (pb != NULL)
		{
			IParamMap2* pm = pb->GetMap(0);
			
			if (pm != NULL)
				RendSpline::paramDlgProc->Update(pm->GetHWnd(), t, id);
		}
	}
}
void bhkBoxObject::BeginEditParams(IObjParam *ip,ULONG flags,Animatable *prev)
{
   SimpleObject::BeginEditParams(ip,flags,prev);

   //if (pmapParam == NULL) {
   //   pmapParam = CreateCPParamMap2(
   //      0,
   //      pblock2,
   //      GetCOREInterface(),
   //      hInstance,
   //      MAKEINTRESOURCE(IDD_BOXPARAM1),
   //      GetString(IDS_PARAMS),
   //      0);
   //}
   boxDesc.BeginEditParams(ip,this,flags,prev);
   param_blk.SetUserDlgProc(new BoxParamDlgProc(this));
   pmapParam = pblock2->GetMap(box_params);

	pmapParam->GetIRollup()->Hide(1);


   this->ip = ip;

   //if(pmapParam) {
   //   // A callback for the type in.
   //   pmapParam->SetUserDlgProc(new BoxParamDlgProc(this));
   //}

}
Beispiel #17
0
void CubeMap::UpdateButtonText()
{
	IAutoMParamDlg *dlg = pblock->GetMParamDlg();
	IParamMap2 *map = dlg->GetMap();
	if(map)
	{
		TSTR p,f,e,name;
		
		ParamDef &mapdef = pblock->GetParamDef(pb_cubemapfile);	//Added to force a filename to be present	
		mapdef.init_file = cubeMapFile;					//Added to force a filename to be present
		SplitFilename(cubeMapFile, &p, &f, &e);
		name = f+e;
		map->SetText(pb_cubemapfile, name.data());

	}
}
void bhkListObject::UpdateUI()
{
   if (ip == NULL)
      return;
   ListParamDlgProc* dlg = static_cast<ListParamDlgProc*>(pmapParam->GetUserDlgProc());
   dlg->Update(ip->GetTime());
}
Beispiel #19
0
   void Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t)    // set from v
   {
      Matte* p = (Matte*)owner;
      if (p!=NULL) {
         IParamMap2 *map = p->pblock->GetMap();
         if (map) {
            switch (id) {
               case matte_opaque_alpha:
                  map->Enable(matte_affect_alpha, v.i? FALSE: TRUE);
                  break;
               case matte_reflection_map:
                     map->Enable(matte_reflection_amount, v.r?TRUE: FALSE);
                  break;
               }
            }
         }

   }
Beispiel #20
0
void CubeMap::UpdateButtonText()
{
	IAutoMParamDlg *dlg = pblock->GetMParamDlg();
	IParamMap2 *map = dlg->GetMap();
	if(map)
	{
		TSTR p,f,e,name;
		
		ParamDef &mapdef = pblock->GetParamDef(pb_cubemapfile);	//Added to force a filename to be present	
		static TCHAR cubemapFile[MAX_PATH];
		_tcscpy(cubemapFile,cubeMapFileAsset.GetFileName());
		mapdef.init_file = cubemapFile;					//Added to force a filename to be present
		SplitFilename(TSTR(cubemapFile), &p, &f, &e);
		name = f+e;
		map->SetText(pb_cubemapfile, name);

	}
}
Beispiel #21
0
	void Set(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t)    // set from v
	{
		UVWFrameObject* fo = (UVWFrameObject*)owner;
		switch (id)
		{
			case pb_uvwmesh:
			{
				IParamMap2* pmap = fo->pblock2->GetMap();
				if (pmap)
					if (v.r == NULL)
						SetWindowText(GetDlgItem(pmap->GetHWnd(), IDC_UVWF_PICKOBJ), 
										GetString(IDS_UVWFRAME_NONE)); 
					else
						SetWindowText(GetDlgItem(pmap->GetHWnd(), IDC_UVWF_PICKOBJ), 
										((INode*)(v.r))->GetName()); 
				break;
			}
		}
	}
RefResult HLSLShaderMaterial::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, 
   PartID& partID, RefMessage message, BOOL propagate ) 
{
	switch (message) {
		case REFMSG_CHANGE:
			m_iValid.SetEmpty();
			if (hTarget == m_pblock)
			{
				ParamID changing_param = m_pblock->LastNotifyParamID();
				hlslshadermaterial_param_blk.InvalidateUI(changing_param);
				IParamMap2* pMap = m_pblock->GetMap();
				if(pMap != NULL)
					pMap->Invalidate();
			}
			break;

		}
	return REF_SUCCEED;
}
void OrientConstRotation::EndEditParams( IObjParam *ip, ULONG flags,Animatable *next )
{
	if(editCont!=NULL)
	{
		editCont = NULL;
		IParamMap2* pmap = pblock->GetMap();
		if (pmap != NULL)
		{
			if (next && next->ClassID() == ClassID() && ((OrientConstRotation*)next)->pblock&&((OrientConstRotation*)next)->GetLocked()==false)
			{
				pmap->SetParamBlock(((OrientConstRotation*)next)->pblock);
				ip->ClearPickMode();
			}
			else
				orientCD.EndEditParams(ip, this, flags | END_EDIT_REMOVEUI, next);
		}
		else
		{
			int index = aprops.FindProperty(PROPID_INTERPUI);
			if (index>=0) {
				InterpCtrlUI *ui = (InterpCtrlUI*)aprops[index];
				if (ui->hParams) {
					ip->UnRegisterDlgWnd(ui->hParams);
					ip->DeleteRollupPage(ui->hParams);			
					}
				index = aprops.FindProperty(PROPID_INTERPUI);
				if (index>=0) {
					delete aprops[index];
					aprops.Delete(index,1);
					}
				}	
		}
			ip->UnRegisterTimeChangeCallback(&orientConstTimeChangeCallback);
			ip->ClearPickMode(); // need this, otherwise will crash on undo, while pickmode is active.
			this->ip = NULL;
			hWnd = NULL;
	}
}
Beispiel #24
0
BOOL PickForceMode::Pick(IObjParam* /*ip*/,ViewExp* vpt)
{
	if ( ! vpt || ! vpt->IsAlive())
	{	
		// why are we here?
		DbgAssert(!_T("Doing Pick() on invalid viewport!"));
		return FALSE;
	}

	INode* node = vpt->GetClosestHit();
	if (node)
	{
		dlg->cont->force_pb->Append(jig_force_node, 1, &node);		
		dlg->UpdateForceList();

		IParamMap2* pmap;
		pmap = dlg->cont->force_pb->GetMap();
		if (pmap) pmap->Invalidate(jig_force_node);

		dlg->ip->RedrawViews(dlg->ip->GetTime());
	}
	return FALSE;
}
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);

		}
	}
}
Beispiel #26
0
void BerconWood::EnableStuff() {
	if (pblock) {
		IParamMap2 *map = pblock->GetMap();
		if (map) {
			// Update values we need to know
			pblock->GetValue( use_distortion, 0, useDistortion, FOREVER);
			pblock->GetValue( lock_grain, 0, lockGrain, FOREVER);		

			// Update parameters			
			map->Enable(noise_color3, lockGrain?FALSE:TRUE);
			map->Enable(noise_map3, lockGrain?FALSE:TRUE);
			map->Enable(noise_map3_on, lockGrain?FALSE:TRUE);

			map->Enable(distortion_str, useDistortion);
			map->Enable(distortion_map, useDistortion);
			map->Enable(distortion_map2, useDistortion);
		}
	}
}
void bhkListObject::InvalidateUI() 
{
   param_blk.InvalidateUI(pblock2->LastNotifyParamID());
   if (pmapParam) pmapParam->Invalidate();
}
RefResult PFOperatorMaterialStatic::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget,
													 PartID& partID, RefMessage message)
{
	IParamMap2* map;
	TSTR dynamicNameSuffix;

	if ( hTarget == pblock() ) {
		int lastUpdateID;
		switch (message)
		{
		case REFMSG_CHANGE:
			lastUpdateID = pblock()->LastNotifyParamID();
			if (lastUpdateID == kMaterialStatic_material) {
				if (updateFromMXSMtl()) {
					NotifyDependents(FOREVER, PART_MTL, kPFMSG_UpdateMaterial, NOTIFY_ALL, TRUE);
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
				}
				UpdatePViewUI(lastUpdateID);
				return REF_STOP;
			}
			if (!(theHold.Holding() || theHold.RestoreOrRedoing())) return REF_STOP;
			switch ( lastUpdateID )
			{
			case kMaterialStatic_assignMaterial:
				RefreshUI(kMaterialStatic_message_assignMaterial);
				NotifyDependents(FOREVER, PART_MTL, kPFMSG_UpdateMaterial, NOTIFY_ALL, TRUE);
				NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
				break;
			case kMaterialStatic_assignID:
				RefreshUI(kMaterialStatic_message_assignID);
				break;
			case kMaterialStatic_type:
				RefreshUI(kMaterialStatic_message_type);
				break;
			case kMaterialStatic_rateType:
				RefreshUI(kMaterialStatic_message_rateType);
				break;
			}
			UpdatePViewUI(lastUpdateID);
			break;
		case REFMSG_NODE_WSCACHE_UPDATED:
			updateFromRealMtl();
			break;
		// Initialization of Dialog
		case kMaterialStatic_RefMsg_InitDlg:
			// Set ICustButton properties for MaterialStatic DAD button
			map = (IParamMap2*)partID;
			if (map != NULL) {
				HWND hWnd = map->GetHWnd();
				if (hWnd) {
					ICustButton *iBut = GetICustButton(GetDlgItem(hWnd, IDC_MATERIAL));
					iBut->SetDADMgr(_dadMgr());
					ReleaseICustButton(iBut);
				}
			}
			// Refresh UI
			RefreshUI(kMaterialStatic_message_assignMaterial);
			RefreshUI(kMaterialStatic_message_assignID);
			return REF_STOP;
		// New Random Seed
		case kMaterialStatic_RefMsg_NewRand:
			theHold.Begin();
			NewRand();
			theHold.Accept(GetString(IDS_NEWRANDOMSEED));
			return REF_STOP;
		}
	}
	if ( hTarget == const_cast <Mtl*> (material()) ) {
		switch (message)
		{
		case REFMSG_CHANGE:
			return REF_STOP;
//			if (ignoreRefMsgNotify()) return REF_STOP;
//			if (!(theHold.Holding() || theHold.RestoreOrRedoing())) return REF_STOP;
			break;
		case REFMSG_NODE_NAMECHANGE:
			if (HasDynamicName(dynamicNameSuffix)) {
				if (lastDynamicName() != dynamicNameSuffix) {
					_lastDynamicName() = dynamicNameSuffix;
					NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
					UpdatePViewUI(kMaterialStatic_material);
				}
			}
			return REF_STOP;
		case REFMSG_TARGET_DELETED:
			_material() = NULL;
			if (pblock() != NULL)
				pblock()->SetValue(kMaterialStatic_material, 0, NULL);
			if (theHold.Holding()) {
				if (HasDynamicName(dynamicNameSuffix)) {
					if (lastDynamicName() != dynamicNameSuffix) {
						_lastDynamicName() = dynamicNameSuffix;
						NotifyDependents(FOREVER, 0, kPFMSG_DynamicNameChange, NOTIFY_ALL, TRUE);
						UpdatePViewUI(kMaterialStatic_material);
					}
				}
			}
			break;
		}
	}

	return REF_SUCCEED;
}
Beispiel #29
0
void BerconTile::EnableStuff(TimeValue t) {
	if (pblock) {
		IParamMap2 *map = pblock->GetMap();
		if (map) {
			// Update values we need to know
			
			//pblock->GetValue( tile_style, 0, tilingType, FOREVER);
			pblock->GetValue( use_distortion, 0, useDistortion, FOREVER);

			// Update parameters			
			map->Enable(soften_rad, tileParam.tileBlur!=0?TRUE:FALSE);
			map->Enable(round_rad, tileParam.tileRound);

			map->Enable(tile_height, tileParam.tilingType != 1);
			map->Enable(tile_width2, tileParam.tilingType != 1);
			map->Enable(tile_height2, tileParam.tilingType != 1);

			map->Enable(pb_uv_channel, tileParam.mapUV);
			map->Enable(pb_auto, tileParam.mapUV);
			map->Enable(pb_rotUV, tileParam.mapUV);
			map->Enable(pb_uv_channel, tileParam.mapUV);
			map->Enable(pb_randX, tileParam.mapUV);
			map->Enable(pb_randY, tileParam.mapUV);
			map->Enable(pb_randSX, tileParam.mapUV);			
			map->Enable(pb_randSY, tileParam.mapUV && (!tileParam.lock));			
			map->Enable(pb_lock, tileParam.mapUV);
			map->Enable(pb_flipX, tileParam.mapUV);
			map->Enable(pb_flipY, tileParam.mapUV);
			map->Enable(pb_randRot, tileParam.mapUV && (tileParam.rotUV==3));	
			map->Enable(pb_center_channel, tileParam.center);

			map->Enable(noise_color3, lockEdge?FALSE:TRUE);
			map->Enable(noise_map3, lockEdge?FALSE:TRUE);
			map->Enable(noise_map3_on, lockEdge?FALSE:TRUE);

			map->Enable(distortion_str, useDistortion);
			map->Enable(distortion_map, useDistortion);
			map->Enable(distortion_map2, useDistortion);

			int type = berconXYZ.isRealworld();

			setSpinnerType(map, t, tile_width,  IDC_TILEWIDTH_EDIT,  IDC_TILEWIDTH_SPIN,  type);	
			setSpinnerType(map, t, tile_height, IDC_TILEHEIGHT_EDIT, IDC_TILEHEIGHT_SPIN, type);
			setSpinnerType(map, t, edge_width,  IDC_EDGEWIDTH_EDIT,  IDC_EDGEWIDTH_SPIN,  type);
			setSpinnerType(map, t, edge_height, IDC_EDGEHEIGHT_EDIT, IDC_EDGEHEIGHT_SPIN, type);

			setSpinnerType(map, t, soften_rad, IDC_SOFTENRAD_EDIT, IDC_SOFTENRAD_SPIN, type);
			setSpinnerType(map, t, round_rad,  IDC_CORNER_EDIT,    IDC_CORNER_SPIN,    type);
		}
	}
}
Beispiel #30
0
void BerconNoise::EnableStuff() {	
	if (pblock) {
		IParamMap2 *map = pblock->GetMap();		
		if (map) {
			// Update values we need to know
			pblock->GetValue( use_distortion, 0, useDistortion, FOREVER);
			pblock->GetValue( noise_function_type, 0, noiseFunction, FOREVER);
			pblock->GetValue( fractal_type, 0, fractalFunction, FOREVER);

			// Update parameters			
			map->Enable(noise_phase, noiseFunction==2||noiseFunction==5?TRUE:FALSE);
			
			map->Enable(worley_F1, noiseFunction==6?TRUE:FALSE);
			map->Enable(worley_F2, noiseFunction==6?TRUE:FALSE);
			map->Enable(worley_F3, noiseFunction==6?TRUE:FALSE);
			map->Enable(worley_F4, noiseFunction==6?TRUE:FALSE);
			map->Enable(worley_distance, noiseFunction==6?TRUE:FALSE);
			map->Enable(worley_spread, noiseFunction==6?TRUE:FALSE);			

			map->Enable(fractal_levels, fractalFunction!=0?TRUE:FALSE);			
			map->Enable(fractal_lacunarity, fractalFunction>2?TRUE:FALSE);			
			map->Enable(fractal_h, fractalFunction>2?TRUE:FALSE);			
			map->Enable(fractal_offset, fractalFunction>4?TRUE:FALSE);			
			map->Enable(fractal_gain, fractalFunction>5?TRUE:FALSE);

			map->Enable(distortion_str, useDistortion);
			map->Enable(distortion_map, useDistortion);
			map->Enable(distortion_map2, useDistortion);
		}
	}
}