Esempio n. 1
0
RefResult FormationBhvr::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate) 
{

	switch (message) 
	{		
	
		case REFMSG_CHANGE:
			//something changed perhaps a name?.. reset the text.
			SetFollowerNodeText();
			SetLeaderNodeText();
			formation_pblk.InvalidateUI();	
		break;

		case REFMSG_CONTAINER_ELEMENT_NULLED:
			 if (hTarget == pblock)
			 {
				 //was is something in the formation?
				 if (pblock->LastNotifyParamID() == follower)
				 {
					 ///okay somebody in the formation was deleted..
	                 INode *n;
                 	 int i;
                 	 int start = 0;
                 	 while (TRUE)
                 	 {
         	             for(i=start; i<pblock->Count(follower); i++)
                 	     {
                 	    	 pblock->GetValue(follower, 0, n, FOREVER, i);
         	            	 if(!n) 
							 { 
								 //This one was NULLed so remove from Tabs.
								 pblock->Delete(follower,i,1); 
								 pblock->Delete(follower_matrix1,i,1); 
								 pblock->Delete(follower_matrix2,i,1); 
								 pblock->Delete(follower_matrix3,i,1); 
								 pblock->Delete(follower_matrix4,i,1); 
								 
								 start = i; 
								 break;
							 }

         		         }
                 		 if (i >= pblock->Count(follower)) break;
                 	 }
				 }
				
			}		

			 //set up the button text due to possible changes.
			 SetFollowerNodeText();
			 SetLeaderNodeText();
			 formation_pblk.InvalidateUI();	
		 break;

	
	}
	return REF_SUCCEED;
}
Esempio n. 2
0
void BerconGradient::SetSubTexmap(int i, Texmap *m) {	
	if (i >= SUBMAPCOUNT+gradient->numKeys()) return;
	ReplaceReference(i+REF_OFFSET, m);		
	if (i == MAPTEX_NUM)
		gradientmap_param_blk.InvalidateUI(pb_maptex);
	else if (i == KEYTEX_NUM)
		gradientmap_param_blk.InvalidateUI(pb_keyTex);
	else if (i == DISTEX_NUM)
		gradientmap_param_blk.InvalidateUI(pb_distex);
	ivalid.SetEmpty();
}
Esempio n. 3
0
void Noise::SwapInputs() {
	Color t = col[0]; col[0] = col[1]; col[1] = t;
	Texmap *x = subTex[0];  subTex[0] = subTex[1];  subTex[1] = x;
	pblock->SwapControllers(noise_color1,0,noise_color2,0);
	noise_param_blk.InvalidateUI(noise_color1);
	noise_param_blk.InvalidateUI(noise_color2);
	noise_param_blk.InvalidateUI(noise_map1);
	noise_param_blk.InvalidateUI(noise_map2);
	macroRecorder->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("color1"), mr_reftarg, this, mr_prop, _T("color2"), mr_reftarg, this);
	macroRecorder->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("map1"), mr_reftarg, this, mr_prop, _T("map2"), mr_reftarg, this);
	}
Esempio n. 4
0
void Speckle::SwapInputs() {
	Color t = col[0]; col[0] = col[1]; col[1] = t;
	Texmap *x = subTex[0];  subTex[0] = subTex[1];  subTex[1] = x;
//	pblock->SwapControllers(PB_COL1, PB_COL2);
	pblock->SwapControllers(speckle_color1,0, speckle_color2,0);
	speckle_param_blk.InvalidateUI(speckle_color1);
	speckle_param_blk.InvalidateUI(speckle_color2);
	speckle_param_blk.InvalidateUI(speckle_map1);
	speckle_param_blk.InvalidateUI(speckle_map2);
	macroRec->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("color1"), mr_reftarg, this, mr_prop, _T("color2"), mr_reftarg, this);
	macroRec->FunctionCall(_T("swap"), 2, 0, mr_prop, _T("map1"), mr_reftarg, this, mr_prop, _T("map2"), mr_reftarg, this);
}
Esempio n. 5
0
void Mask::SetSubTexmap(int i, Texmap *m) {
	ReplaceReference(i,m);
	if (i==0)
		{
		mask_param_blk.InvalidateUI(mask_map1);
		mapValid.SetEmpty();
		}	
	else if (i==1)
		{
		mask_param_blk.InvalidateUI(mask_map2);
		mapValid.SetEmpty();
		}	

	}
Esempio n. 6
0
void Wood::SetSubTexmap(int i, Texmap *m) 
{
	ReplaceReference(i+2,m);
	if (i==0)
		{
		wood_param_blk.InvalidateUI(wood_map1);
		ivalid.SetEmpty();
		}
	else if (i==1)
		{
		wood_param_blk.InvalidateUI(wood_map2);
		ivalid.SetEmpty();
		}

}
Esempio n. 7
0
// This method is responsible for responding to the change notification
// messages sent by the texmap dependants.
RefResult Water::NotifyRefChanged(Interval changeInt, 
	RefTargetHandle hTarget, PartID& partID, RefMessage message ) {
	switch (message) {
		case REFMSG_CHANGE:
			texValidity.SetEmpty();
			if (hTarget == pblock)
				{
				ParamID changing_param = pblock->LastNotifyParamID();
				water_param_blk.InvalidateUI(changing_param);
#ifdef SHOW_3DMAPS_WITH_2D
				if (changing_param != -1)
					DiscardTexHandle();
#endif
				}
#ifdef SHOW_3DMAPS_WITH_2D
			else if (hTarget == xyzGen) 
				{
				DiscardTexHandle();
				}
#endif

			// One of the texmap dependants have changed.  We set our
			// validity interval to empty and invalidate the dialog
			// so it gets redrawn.
//			texValidity.SetEmpty();
//			if (hTarget != xyzGen) {
//				if (paramDlg) 
//					paramDlg->pmap->Invalidate();
//				}
			break;
/*
		case REFMSG_GET_PARAM_DIM: {
			// This returns the 'dimension' of the parameter.  This is 
			// the type and order of magnitude of the parameter.
			GetParamDim *gpd = (GetParamDim *)partID;
			switch (gpd->index) {
				case PB_LEN_MIN:
				case PB_LEN_MAX:
				case PB_SIZE: gpd->dim =  stdWorldDim; 	break;
				case PB_AMP:
				case PB_NUM:
				case PB_PHASE:
					gpd->dim = defaultDim; break;
				case PB_COL1: 
				case PB_COL2: gpd->dim = stdColor255Dim; break;
			}
			return REF_STOP; 
		}

		case REFMSG_GET_PARAM_NAME: {
			// This returns the name that will appear in track view
			// of the parameter.
			GetParamName *gpn = (GetParamName *)partID;
			gpn->name = GetString(nameIDs[gpn->index]);
			return REF_STOP; 
		}
*/
	}
	return(REF_SUCCEED);
}
RefResult AlembicFloatController::NotifyRefChanged(Interval iv,
                                                   RefTargetHandle hTarg,
                                                   PartID& partID,
                                                   RefMessage msg)
#endif
{
  switch (msg) {
    case REFMSG_CHANGE:
      if (hTarg == pblock) {
        ParamID changing_param = pblock->LastNotifyParamID();
        switch (changing_param) {
          case ID_PATH: {
            delRefArchive(m_CachedAbcFile);
            const MCHAR* strPath = NULL;
            TimeValue t = GetCOREInterface()->GetTime();
            Interval v;
            pblock->GetValue(AlembicFloatController::ID_PATH, t, strPath, v);
            m_CachedAbcFile = EC_MCHAR_to_UTF8(strPath);
            addRefArchive(m_CachedAbcFile);
          } break;
          default:
            break;
        }

        AlembicFloatControllerParams.InvalidateUI(changing_param);
      }
      break;

    case REFMSG_OBJECT_CACHE_DUMPED:
      return REF_STOP;
      break;
  }

  return REF_SUCCEED;
}
Esempio n. 9
0
// Stores the 'i-th' sub-texmap managed by the material or texture.
void Speckle::SetSubTexmap(int i, Texmap *m) {
	ReplaceReference(i+2, m);
	if (i==0)
		{
		speckle_param_blk.InvalidateUI(speckle_map1);
		texValidity.SetEmpty();
		}
	else if (i==1)
		{
		speckle_param_blk.InvalidateUI(speckle_map2);
		texValidity.SetEmpty();
		}

//	if (paramDlg)
//		paramDlg->UpdateSubTexNames();
}
Esempio n. 10
0
RefResult Noise::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, 
   PartID& partID, RefMessage message ) {
	switch (message) {
		case REFMSG_CHANGE:
			ivalid.SetEmpty();
			cacheValid.SetEmpty();
			if (hTarget == pblock)
				{
			// see if this message came from a changing parameter in the pblock,
			// if so, limit rollout update to the changing item and update any active viewport texture
				ParamID changing_param = pblock->LastNotifyParamID();
//				if (hTarget != xyzGen && hTarget != texout ) 
				noise_param_blk.InvalidateUI(changing_param);
				// notify our dependents that we've changed
				// NotifyChanged();  //DS this is redundant
#ifdef SHOW_3DMAPS_WITH_2D
				if (changing_param != -1)
					DiscardTexHandle();
#endif
				}
#ifdef SHOW_3DMAPS_WITH_2D
			else if (hTarget == xyzGen) 
				{
				DiscardTexHandle();
				}
#endif

			break;
		}
	return(REF_SUCCEED);
	}
Esempio n. 11
0
// Stores the 'i-th' sub-texmap managed by the material or texture.
void Smoke::SetSubTexmap(int i, Texmap *m) {
	ReplaceReference(i+2, m);
	if (i==0)
		{
		smoke_param_blk.InvalidateUI(smoke_map1);
		mapValid.SetEmpty();
		}
	else if (i==1)
		{
		smoke_param_blk.InvalidateUI(smoke_map2);
		mapValid.SetEmpty();
		}

//	if (paramDlg)
//		paramDlg->UpdateSubTexNames();
}
Esempio n. 12
0
RefResult Gradient::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, 
   PartID& partID, RefMessage message ) 
{
	switch (message) 
	{
		case REFMSG_CHANGE:
		{
			ivalid.SetEmpty();
			if (hTarget == pblock) {
				// see if this message came from a changing parameter in the pblock,
				// if so, limit rollout update to the changing item and update any active viewport texture
				ParamID changing_param = pblock->LastNotifyParamID();
				if (hTarget != uvGen && hTarget != texout) 
					grad_param_blk.InvalidateUI(changing_param);
				if (changing_param != -1)
					DiscardTexHandle();
				}
			// notify our dependents that we've changed
			// NotifyChanged();  //DS this is redundant
			break;
		}

		case REFMSG_UV_SYM_CHANGE:
			DiscardTexHandle();  
			break;
	}
	return(REF_SUCCEED);
}
Esempio n. 13
0
void MatCustAttrib::SetSubTexmap(int i, Texmap *m)
{
	if (i==0)
	{
		ReplaceReference(MAP_REF,m);
		param_blk.InvalidateUI(ca_color);
}	}
Esempio n. 14
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;
}
Esempio n. 15
0
int TessendorfOceanCreateCallBack::proc(ViewExp *vpt,int msg, int point, int /*flags*/, IPoint2 m, Matrix3& mat )
{
    //TODO: Implement the mouse creation code here
    if ( ! vpt || ! vpt->IsAlive() )
    {
        // why are we here
        DbgAssert(!_T("Invalid viewport!"));
        return FALSE;
    }

    if (msg == MOUSE_POINT || msg == MOUSE_MOVE) {
        switch(point) {
            case 0: // only happens with MOUSE_POINT msg
                ob->suspendSnap = TRUE;
                sp0 = m;
                p0 = vpt->SnapPoint(m,m,NULL,SNAP_IN_PLANE);
                mat.SetTrans(p0);

                //Set a default overall size in the parameter block
                ob->pblock2->SetValue(pb_width, ob->ip->GetTime(), 0.0f);
                ob->pblock2->SetValue(pb_length, ob->ip->GetTime(), 0.0f);
                break;
            case 1:
            {
                ob->suspendSnap = TRUE; 
                p1 = vpt->SnapPoint(m,m,NULL,SNAP_IN_PLANE);
                Point3 diff = p1 - p0;
                mat.SetTrans(p0 + diff / 2.0f);
                
                //Set the overall size in parameter block
                ob->pblock2->SetValue(pb_width, ob->ip->GetTime(), abs(diff.x));
                ob->pblock2->SetValue(pb_length, ob->ip->GetTime(), abs(diff.y));

                //Invalidate and display the mesh in the viewport
                tessendorfocean_param_blk.InvalidateUI();
                break;
            }
            case 2: // happens when user releases mouse
            {
                ob->suspendSnap = TRUE; 
                p1 = vpt->SnapPoint(m,m,NULL,SNAP_IN_PLANE);
                Point3 diff = p1 - p0;
                
                if (abs(diff.x) < MIN_WIDTH || abs(diff.y) < MIN_LENGTH)
                {
                    return CREATE_ABORT; // abort if the size is too small
                }
                else
                {
                    return CREATE_STOP;
                }
            }
        }
    } else {
        if (msg == MOUSE_ABORT) return CREATE_ABORT;
    }

    return TRUE;
}
RefResult VRayCamera::NotifyRefChanged(NOTIFY_REF_CHANGED_ARGS) {
  if (hTarget==pblock) 
  {
    camera_param_blk.InvalidateUI();
    NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE);
  }
  return REF_SUCCEED;
}
Esempio n. 17
0
void Noise::SetLowThresh(float v)
{
if (pblock != NULL)
	{
	pblock->SetValue(noise_lowthresh,GetCOREInterface()->GetTime(),v);
	noise_param_blk.InvalidateUI(noise_lowthresh);
}
}
// Vray 3.0 for Max 2014 Change[ACH]
RefResult VRayCamera::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message) {
  if (hTarget==pblock) 
  {
    camera_param_blk.InvalidateUI();
    NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE);
  }
  return REF_SUCCEED;
}
Esempio n. 19
0
int WindObjCreateCallback::proc(
		ViewExp *vpt,int msg, int point, int flags, IPoint2 m, Matrix3& mat)
{
	if ( ! vpt || ! vpt->IsAlive() )
	{
		// why are we here
		DbgAssert(!_T("Invalid viewport!"));
		return FALSE;
	}

	if (msg==MOUSE_POINT||msg==MOUSE_MOVE) 
	{
#ifdef _3D_CREATE
		DWORD snapdim = SNAP_IN_3D;
#else
		DWORD snapdim = SNAP_IN_PLANE;
#endif
		switch(point) 
		{
			case 0:								
				sp0 = m;
				p0  = vpt->SnapPoint(m,m,NULL,snapdim);
				mat.SetTrans(p0);
				break;
			case 1:
				if (ob->ClassID()==Class_ID(GRAVITYOBJECT_CLASS_ID,0)) 
				{
					mat.IdentityMatrix();
					mat.RotateX(PI);
					mat.SetTrans(p0);
				}
				p1  = vpt->GetPointOnCP(m);
				ob->pblock2->SetValue(PB_DISPLENGTH,0,Length(p1-p0)/2.0f);
//				ob->pmapParam->Invalidate();
				wind_param_blk.InvalidateUI();
				if (msg==MOUSE_POINT) 
				{
					if (Length(m-sp0)<3) return CREATE_ABORT;
					else return CREATE_STOP;
				}
				break;
			}
	} 
	else 
	{
		if (msg == MOUSE_ABORT)	
		{
			return CREATE_ABORT;
		}
		else
		if (msg == MOUSE_FREEMOVE) 
		{
			vpt->SnapPreview(m,m);
		}
	}
	
	return TRUE;
}
Esempio n. 20
0
void Output::SetSubTexmap(int i, Texmap *m) {
	ReplaceReference(i,m);
	if (i==0)
		{
		output_param_blk.InvalidateUI(output_map1);
		ivalid.SetEmpty();
		}	

	}
Esempio n. 21
0
void StressTexmap::SetSubTexmap(int i, Texmap *m) 
{
	ReplaceReference(i,m);
	switch(i) {
		case 0:
			stex_param_blk.InvalidateUI(tex_str_map);
			ivalid.SetEmpty();
			break;
		case 1:
			stex_param_blk.InvalidateUI(tex_rlx_map);
			ivalid.SetEmpty();
			break;
		case 2:
			stex_param_blk.InvalidateUI(tex_cmp_map);
			ivalid.SetEmpty();
			break;
		}
}
Esempio n. 22
0
void VDM::SetSubTexmap(int i, Texmap *m) 
{
	ReplaceReference(i+1,m);
	if(i==0)
	{
		vdm_param_blk.InvalidateUI(vdm_map_vector);
		ivalid.SetEmpty();
	}
}
Esempio n. 23
0
RefResult ModifierPtex::NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID,  RefMessage message) 
{
	switch (message)
	{
		case REFMSG_CHANGE:
			skpurem_param_blk.InvalidateUI();
		break;
	}
	return REF_SUCCEED;
}
Esempio n. 24
0
void Noise::SetSubTexmap(int i, Texmap *m) {
	ReplaceReference(i+2,m);

	if (i==0)
		{
		noise_param_blk.InvalidateUI(noise_map1);
		ivalid.SetEmpty();
		cacheValid.SetEmpty();
		}	
	else if (i==1)
		{
		noise_param_blk.InvalidateUI(noise_map2);
		ivalid.SetEmpty();
		cacheValid.SetEmpty();
		}	

//	if (paramDlg)
//		paramDlg->UpdateSubTexNames();
	}
Esempio n. 25
0
void Gradient::SetSubTexmap(int i, Texmap *m) {
	ReplaceReference(i+2,m);
	if (i==0)
		{
		grad_param_blk.InvalidateUI(grad_map1);
		ivalid.SetEmpty();
		}
	else if (i==1)
		{
		grad_param_blk.InvalidateUI(grad_map2);
		ivalid.SetEmpty();
		}	
	else if (i==2)
		{
		grad_param_blk.InvalidateUI(grad_map3);
		ivalid.SetEmpty();
		}	

	}
Esempio n. 26
0
RefResult Matte::NotifyRefChanged(
      const Interval& changeInt, 
      RefTargetHandle hTarget, 
      PartID& partID, 
	  RefMessage message, 
	  BOOL propagate)
   {
   switch (message) {
      case REFMSG_CHANGE:
         if (hTarget == pblock)
            {
            ivalid.SetEmpty();
         // see if this message came from a changing parameter in the pblock,
         // if so, limit rollout update to the changing item and update any active viewport texture
            ParamID changing_param = pblock->LastNotifyParamID();
            matte_param_blk.InvalidateUI(changing_param);
            if( (changing_param == matte_receive_shadows)
               ||(changing_param == matte_shadow_brightness)
               ||(changing_param == matte_color)
               ||(changing_param == matte_reflection_amount)
               ||(changing_param == matte_use_reflection_map))
            {
               mReshadeRQ = RR_NeedReshade;
            } else if (changing_param == -1) 
               mReshadeRQ = RR_NeedPreshade;
             else 
               mReshadeRQ = RR_None;
         }

         if (hTarget != NULL) {

            switch (hTarget->SuperClassID()) {
               case TEXMAP_CLASS_ID: {
                     mReshadeRQ = RR_NeedPreshade;
               } break;
//             default:
//                mReshadeRQ =RR_NeedReshade;
//             break;
            }

         }
         break;

      case REFMSG_SUBANIM_STRUCTURE_CHANGED:
//       if (partID == 0) 
//          mReshadeRQ = RR_None;
//       else {
//          mReshadeRQ = RR_NeedPreshade;
//          NotifyChanged();
//       }
         break;
      
   }
   return REF_SUCCEED;
}
Esempio n. 27
0
RefResult CVDModifier::NotifyRefChanged(
		const Interval& changeInt, RefTargetHandle hTarget,
		PartID& partID, RefMessage message, BOOL propagate) 
	{
	switch (message) {
		case REFMSG_CHANGE:
			cvd_param_blk.InvalidateUI();
			break;
		}
	return REF_SUCCEED;
	}
RefResult bhkRigidBodyModifier::NotifyRefChanged(const Interval& changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message, BOOL propagate)
#endif
{
   switch (message) 
   {
   case REFMSG_CHANGE:
      ParamID changing_param = pblock->LastNotifyParamID();
      havok_param_blk.InvalidateUI(changing_param);
      break;
   }
   return REF_SUCCEED;
}
Esempio n. 29
0
RefResult BerconNoise::NotifyRefChanged(NOTIFY_REF_CHANGED_ARGS) {
	switch (message) {
		case REFMSG_CHANGE:
			ivalid.SetEmpty();			
			if (hTarget == pblock) {
				ParamID changing_param = pblock->LastNotifyParamID();
				berconnoise_param_blk.InvalidateUI(changing_param);
				if (changing_param != -1) DiscardTexHandle();
			}  else if (hTarget == pbCurve) {
				ParamID changing_param = pbCurve->LastNotifyParamID();
				BerconCurve_param_blk.InvalidateUI(changing_param);
				if (changing_param != -1) DiscardTexHandle();
			}  else if (hTarget == pbXYZ) {
				ParamID changing_param = pbXYZ->LastNotifyParamID();
				xyz_blk.InvalidateUI(changing_param);
				if (changing_param != -1) DiscardTexHandle();
			}
			break;
		}
	return(REF_SUCCEED);
}
Esempio n. 30
0
void BerconNoise::SetSubTexmap(int i, Texmap *m)  {
	ReplaceReference(i+2,m);
	if (i==0) {
		berconnoise_param_blk.InvalidateUI(noise_map1);
		ivalid.SetEmpty();		
	} else if (i==1) {
		berconnoise_param_blk.InvalidateUI(noise_map2);
		ivalid.SetEmpty();		
	} else if (i==2) {
		berconnoise_param_blk.InvalidateUI(distortion_map);
		ivalid.SetEmpty();
	}  else if (i==3) {
		berconnoise_param_blk.InvalidateUI(distortion_map2);
		ivalid.SetEmpty();
	}

	if (BMAP1_NUM <= i && i <= BMAP14_NUM) {
		BerconMap_param_blk.InvalidateUI(i-BMAP1_NUM);
		ivalid.SetEmpty();
	}
}