Deformed Objects



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/07/2010 at 05:01, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R11.5 
    Platform:   Windows  ; Mac  ;  
    Language(s) :     C++  ;

    ---------
    Hi, how can I find out if an object is being affected by a deformer or not.



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/07/2010 at 08:27, xxxxxxxx wrote:

    Check this out:

    BaseObject* BaseObject::GetDeformCache();
    

    I'd say if it's not NULL, there has been some deformation going on ;-)

    Cheers,
    Jack



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/07/2010 at 08:49, xxxxxxxx wrote:

    While that is correct, GetDeformCache() may return NULL for other reasons (and the object in question still be affected by a deformer) such as cache not yet built.

    A better approach might be to see if the object's children are deformers as an additional test:

    Bool deformed = (obj->GetDeformCache() != NULL);  
    if (!deformed)  
    {  
      LONG info;  
      for (BaseObject* child = obj->GetDown(); child; child = child->GetNext())  
      {  
          info = child->GetInfo();  
          if (child->GetDeformMode() && ((info == OBJECT_MODIFIER) || (info == OBJECT_HIERARCHYMODIFIER)))  
          {  
              deformed = TRUE;  
              break;  
          }  
      }  
    }  
    


  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 28/07/2010 at 09:30, xxxxxxxx wrote:

    Thanks all. The only problem with checking for deformers as children is that a deformer can affect it's parent object and the hierarchy below that parent, which means I will have to traverse the whole hierarchy from the top level parent, which I was trying to avoid.

    Cheers,
           JDP


Log in to reply