Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. Andrew
    A
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Andrew

    @Andrew

    0
    Reputation
    3
    Posts
    3
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Andrew Follow

    Posts made by Andrew

    • RE: Custom FieldList is not reevaluated on field change

      @m_magalhaes
      Hi Manuel,

      sorry for the late reply, the way you sample fields is indeed working but i can't get it working if fields come from my own FIELDLIST gui element. Right now i rely upon the fact that field is always under effector and so if there are no race conditions and cyclic stuff this is acceptable.

      thanks,
      Andrew

      posted in Cinema 4D Development
      A
      Andrew
    • RE: Custom FieldList is not reevaluated on field change

      Hi @m_magalhaes ,
      Thanks for that tip, it helped me perfectly with my custom Field (fieldData) object where the same problem with FieldList GUI element appear, but in my custom effector (EffectorData) that CheckDirty function never get called at all. For now i use a different workaround, in the InitPoints i do :

      BaseObject* child = op->GetDown();
      while (child != nullptr)
      {
      	this->AddEffectorDependence  (child);
      	child = child->GetNext();
       }
      

      Not sure how safe it is in terms of cyclic dependencies/multiple registrations, but works stable so far. Let me know if that is dangerous.
      Much thanks,
      Andrew

      posted in Cinema 4D Development
      A
      Andrew
    • Custom FieldList is not reevaluated on field change

      Hello,
      I am trying to write my effector plugin with a custom fieldlist input. I follow the docs on how to sample this list:

      GeData ge;
      		if (bc->GetParameter(GUI_ID_FIELDLIST, ge) == false)
      			return  ;
      		CustomDataType* const customData = ge.GetCustomDataType(CUSTOMDATATYPE_FIELDLIST);
      		FieldList* const      p = static_cast<FieldList*>(customData);
       	
      		if (p)
      		{
      			p->SetFlags(FIELDLIST_FLAGS::DISABLEVALUEBYDEFAULT, true);
      		
      			Int sampleCnt = md->GetCount();
      
      			maxon::BaseArray<maxon::Vector> positions;
      			auto _n = positions.Resize(sampleCnt);
      
      			maxon::BaseArray<maxon::Vector> uvws;
      			_n = uvws.Resize(sampleCnt);
      
      			maxon::BaseArray<maxon::Vector> directions;
      			_n = directions.Resize(sampleCnt);
      
      			// set positions
      			Float64 xOffset = 0.0;
      			for (maxon::Vector& pos : positions)
      			{
      				pos.x = xOffset;
      				xOffset += 1.f;
      			}
      
      			// define points to sample
      			FieldInput points(positions.GetFirst(),
      				directions.GetFirst(),
      				uvws.GetFirst(),
      				sampleCnt,
      				Matrix());
      
      			FieldOutput out = p->SampleListSimple(*op, points).GetValue();
      			if (out.IsValid())
      			{
      				for (Int it = 0; it < sampleCnt; ++it)
      					print() << out._value[it];
      			}
      		}
      		
      

      The problem is that effector is not reevaluated if i change any of the field parameters (like seed etc), the rest of params (on the effector) works just as expected.
      Is there anything more need to be done to get it working say linking or a dependency generation?
      Thanks in advance,
      Andrew

      posted in Cinema 4D Development
      A
      Andrew