GetAndCheckHierarchyClone Bug?



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

    On 30/07/2004 at 12:53, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.503 
    Platform:   Windows  ; Mac  ;  Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    If I use this object ( OBJECT_GENERATOR|OBJECT_INPUT) in a scene with OBJECTINPUT as the parent, internal C4D Array object as child, and a polygon object as the source for the Array which is animated dirty never returns true while the Array is being animated. If I set the flag to HCLONE_ASPOLY then it returns dirty as it plays. If I set the flag to HCLONE_ASSPLINE it only returns dirty if the Array input is a spline ( understandably ). The issue is that I am covering splines and polygon objects with the one GetAndCheckHierarchyClone call which DOES NOT CORRECTLT evaluate the dirty state. This seems like a bug.

    BaseObject * OBJECTINPUT :: GetVirtualObjects ( PluginObject *op, HierarchyHelp *hh )
    {
    Bool dirty = FALSE;
    if ( !op->GetDown() ) return NULL;
    BaseObject *hierarchy_Clone = op->GetAndCheckHierarchyClone( hh, op->GetDown(), HCLONE_ASIS, &dirty;, NULL, TRUE );
    if ( !hierarchy_Clone ) return NULL;
    if ( dirty )
    { GePrint( "Dirty" ); blDelete( hierarchy_Clone ); } else GePrint( "Clean" );
    BaseObject *object = BaseObject::Alloc( Onull );
    op->Message( MSG_UPDATE );
    return object;
    }

    Regards,
    darf



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

    On 31/07/2004 at 04:12, xxxxxxxx wrote:

    Hmm, I can't seem to reproduce that. The post is perfectly clear (kudos for that!), but are you sure there's nothing else to it?
    What I did was to swap your code in for AtomObject::GetVirtualObjects() and then make a hierarchy Atom->Array->Polygon. The dirty flag output seems to make totally sense. In particular, if I animate Position.X in the array for frame 0-30 and press play, then the console will output "Dirty" during the first 30 frames and then "Clean".
    Can you think of anything that's different in your code to the atom object?



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

    On 31/07/2004 at 08:12, xxxxxxxx wrote:

    Ok this is the issue as I can explain it.

    I wrote an object that duplicated geometry on a spline. The goal is to work on particleTRACER splines. It works fine on anything that is keyframed, standard splines, spline primitives etc... It will not work with particleTRACER. So I tried particleTRACER with the built in ARRAY object in C4D and it worked prefectly. Arghh, has to be in the above code somewhere. Hope that still makes sense.

    Best Regards,
    darf - coreaudiovisual



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

    On 31/07/2004 at 16:35, xxxxxxxx wrote:

    Sorry, I still don't get it. I'll have a look at your message later and see if I can figure it out, but since I won't be able to connect to the net again until sometime tomorrow, please feel free to provide more information until then.
    I would be the most interested in seeing if you could "fix" the code+example you gave above, so that it *doesn't* work. That would give me something concrete to work with.



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

    On 01/08/2004 at 09:59, xxxxxxxx wrote:

    I will build all of the plugins and source files so you can see exactly how it is not working and post them today.

    darf



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

    On 01/08/2004 at 14:19, xxxxxxxx wrote:

    Actually the problem still exists with the C4D Array tool. An Array that is animated by amplitude and frequency does not correctly show dirty from the ObjectInput example. If it does for you pl;ease share the code and I wille examine it.

    Regards,
    darf

    > Quote: Originally posted by Mikael Sterner on 31 July 2004
    >
    > * * *
    >
    > Hmm, I can't seem to reproduce that. The post is perfectly clear (kudos for that!), but are you sure there's nothing else to it?
    >
    > What I did was to swap your code in for AtomObject::GetVirtualObjects() and then make a hierarchy Atom->Array->Polygon. The dirty flag output seems to make totally sense. In particular, if I animate Position.X in the array for frame 0-30 and press play, then the console will output "Dirty" during the first 30 frames and then "Clean".
    >
    > Can you think of anything that's different in your code to the atom object?
    >
    >
    >
    >
    >
    > * * *



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

    On 02/08/2004 at 21:03, xxxxxxxx wrote:

    Ok, now I see what you mean. I thought you animated *the* amplitude and frequency, not setting those two parameters and letting the array animate itself. (That also means that my comment about emitters being the only time-dependent generator isn't accurate.)



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

    On 02/08/2004 at 21:45, xxxxxxxx wrote:

    Thinking a bit more about the example, it does sort of make sense what we are seeing. When you clone ASPOLY then C4D says that the object is dirty, because the actual polygons have changed. But when you clone ASIS, nothing about the object has changed. It's still the same as before, just that if you send it along it will polygonize itself differently based on the time.
    Would a workaround for you be to use a custom function like this instead? (It uses HCLONE_ASSPLINE for splines and HCLONE_ASPOLY for polygons, at least when you give it HCLONE_ASSPLINE|HCLONE_ASPOLY as flags.)

        
        
        LONG GetMultiFlags(BaseObject* obj, LONG flags)  
        {  
          if (obj->GetRealSpline())  
          {  
            if (flags & HCLONE_ASSPLINE)  
            {  
              return HCLONE_ASSPLINE;  
            }  
            else if (flags & HCLONE_ASLINE)  
            {  
              return HCLONE_ASLINE;  
            }  
          }  
          else if (flags & HCLONE_ASPOLY)  
          {  
            return HCLONE_ASPOLY;  
          }  
          return HCLONE_ASIS;  
        }
        
        
        
        
        BaseObject* GetAndCheckHierarchyCloneMulti(PluginObject* self, HierarchyHelp *hh, BaseObject *op, LONG flags, Bool *dirty, AliasTrans *trans, Bool allchilds)  
        {  
          BaseObject *res=NULL,*tp=NULL,*dp=NULL;
        
        
        
        
          *dirty = *dirty || self->CheckCache(hh) || self->IsDirty(DIRTY_DATA);  
          if (!(*dirty))  
          {  
            self->NewDependenceList();
        
        
        
        
            if (!allchilds)  
              self->GetHierarchyClone(hh,op,GetMultiFlags(op,flags),dirty,trans);  
            else  
            {  
              for (tp=op;tp;tp=tp->GetNext())  
                self->GetHierarchyClone(hh,tp,GetMultiFlags(tp,flags),dirty,trans);  
            }  
          }  
          *dirty = *dirty || !self->CompareDependenceList();
        
        
        
        
          if (!(*dirty))  
          {  
            self->TouchDependenceList();  
            return self->GetCache(hh);  
          }
        
        
        
        
          self->NewDependenceList();  
          if (!allchilds)  
            res = self->GetHierarchyClone(hh,op,GetMultiFlags(op,flags),NULL,trans);  
          else  
          {  
            res = BaseObject::Alloc(Onull); if (!res) return NULL;  
            res->SetName(op->GetName());  
            for (tp=op;tp;tp=tp->GetNext())  
            {  
              dp = self->GetHierarchyClone(hh,tp,GetMultiFlags(tp,flags),NULL,trans);  
              if (dp) dp->InsertUnderLast(res);  
            }  
          }  
          return res;  
        }
    


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

    On 03/08/2004 at 10:05, xxxxxxxx wrote:

    I had tried something very similair ( went back in the forums and found it suggested ). Tried to place this code diretcly into the example I provided ( Object Input ) and it did not seem to work. Did it work for you?

    Reards,
    darf



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

    On 03/08/2004 at 13:13, xxxxxxxx wrote:

    It only works if the hierarchies are splines or polys. Not both. We can suffer for awhile working with either or but a solid solution is needed.

    Thanks for the work!

    Best Regards,
    darf


Log in to reply