Navigation

    • Register
    • Login
        No matches found
    • Search
    1. Home
    2. d_schmidt
    D

    d_schmidt

    @d_schmidt

    1
    Reputation
    96
    Posts
    128
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    • Profile
    • More
      • Following
      • Followers
      • Topics
      • Posts
      • Best
      • Groups
    d_schmidt Follow

    Best posts made by d_schmidt

    RE: GetRealSpline() not returning a result

    Hi, Maxime, I'm trying to be able to browse through every point, the tangents of those points, and the segments they belong to. It seems like a LineObject wouldn't help me get the tangents or the spline point locations so I think I would need the actual SplineObject.

    I want to output a SplineObject, taking in the input splines points, tangents, and segments to be able modify it and return something different.

    I hope that clears it up,
    Dan

    posted in Cinema 4D SDK •

    Latest posts made by d_schmidt

    RE: Best way to store "Bake" Information

    Hi Manuel,

    I didn't think about CopyTo being called on undo. That might be all I need then, thanks. I did a couple tweaks and as of now everything is perfect.

    Dan

    posted in Cinema 4D SDK •
    Best way to store "Bake" Information

    Hello! I had a more general question about the proper way to do something within Cinema.

    I want to have a 'Bake' button on my plugin that will do some of the heavy lifting as a single step, so that these calculations don't need to be done on a per update basis. I could create the needed data structures once and use those instead of constantly rebuilding them.

    My question is what is the best way to implement this. My initial thought was to use a BaseArray of a custom Class to store the needed data. Something along the lines of one entry per child object to keep track of relationships and choices. Is this a valid way to go about it?

    I was running into some problems with Read and Write, converting the Class to be read and written could be done though. One thing I was stumped on is that if I Free my BaseArray when the object is deleted then how would I bring it back if Undo was used?

    Thanks for any help,
    Dan

    posted in Cinema 4D SDK •
    RE: R20 and R24 Description Differences

    @m_adam Hi!

    Thanks for looking into it!

    posted in Cinema 4D SDK •
    RE: R20 and R24 Description Differences

    Hi @ferdinand,

    No worry on any delay. I did some addition checking with the description resource and I even completely removed the resource folder but I'm having the same thing happen, so that doesn't seem to be playing a part as far as I can tell.

    Dan

    posted in Cinema 4D SDK •
    RE: R20 and R24 Description Differences

    Hello, I don't want to be pushy or bothersome. Just checking in to see if there is anything else I can provide or that I should look into. I know I initially responded late so I wouldn't blame anyone for this post being forgotten about.

    Dan

    posted in Cinema 4D SDK •
    RE: R20 and R24 Description Differences

    @m_adam Hi Maxime, super sorry about the slow reply.

    you can also upload GIF up to 4mb directly in the forum (just drag and drop it).

    I'll keep this in mind in the future!

    Do you override the Message method?

    I was when I posted the test, but I removed it and nothing changed.

    I saw that you use the flag DESCFLAGS_DESC::RECURSIONLOCK is there any reason for that? This prevent further evaluation and may cause the issue.

    I shouldn't have been including this, but the issue still exists when I remedied the situation.

    would it be possible to share you resource file?

    My resource file is actually not doing anything in this case. I think there actually isn't one.

    That all being said, it still works in R20 and doesn't in R24. Is there anything else I can test to help out?

    Dan

    posted in Cinema 4D SDK •
    R20 and R24 Description Differences

    Hello! I have a plugin that I compiled for R20 and R24 and I'm noticing a difference between the two of them.

    Here is my plugin in R20:
    alt text

    And here is in R24:
    alt text

    In R20 the description is redrawn as the cube is dragged over. In R24 it isn't redrawn despite GetDDescription being called.

    Here is my code, which is the same for each version, but they're behaving differently.

    Bool ShortTest::GetDDescription(GeListNode *node,  Description *description,  DESCFLAGS_DESC &flags)
    {
      
        if (!description->LoadDescription(node->GetType()))
        {
           
        }
        BaseObject* op = static_cast<BaseObject*>(node);
        if (op == nullptr)
        {
            return FALSE;
        }
    
        const DescID *singleid = description->GetSingleDescID();
        
        
        DescID cid;
        BaseContainer* datainstance = op->GetDataInstance();
        
      
        DescID DescGroup = DescLevel(2000,  DTYPE_GROUP,  0);
        
        Int32 idShowNothing = 1;
        Int32 idShowEverything = 2;
        Int32 idMode = 10001;
        if (!singleid || DescGroup.IsPartOf(*singleid,  NULL))
        {
            BaseContainer bc;
            bc = GetCustomDataTypeDefault(DTYPE_GROUP);
            bc.SetString(DESC_NAME,  "Object"_s);
            
            
            bc.SetInt32(DESC_COLUMNS,  1);
            bc.SetFloat(DESC_DEFAULT,  1);
            bc.SetBool(DESC_SCALEH,  TRUE);
            bc.SetBool(DESC_DEFAULT,  TRUE);
            
            if (!description->SetParameter(DescGroup,  bc,  DescLevel(1057950)))
            {
                return TRUE;
            }
        }
        
        cid = DescLevel(idMode, DTYPE_LONG, 0);
        if (!singleid || cid.IsPartOf(*singleid, NULL))
        {
            
            
            BaseContainer bc;
            bc = GetCustomDataTypeDefault(DTYPE_LONG);
            bc.SetBool(DESC_FORBID_SCALING, TRUE);
            bc.SetBool(DESC_FORBID_INLINE_FOLDING, FALSE);
            bc.SetBool(DESC_GUIOPEN, TRUE);
            bc.SetString(DESC_NAME, "Test                                   "_s);
            BaseContainer MeasureDivisionNames;
            //  if (ModifiersNames == emptyBC) return TRUE;
            
            MeasureDivisionNames.SetString(idShowNothing, "Show Nothing"_s);
            MeasureDivisionNames.SetString(idShowEverything, "Show Parameters"_s);
            
            bc.SetInt32(DESC_CUSTOMGUI, ID_QUICKTABSRADIO_GADGET);
            bc.SetContainer(DESC_CYCLE, MeasureDivisionNames);
            if (!description->SetParameter(cid, bc, DescGroup))
                return TRUE;
        }
        
        if(datainstance->GetInt32(idMode) == idShowEverything)
        {
            
            cid = DescLevel(2002,  DTYPE_REAL,  0);
            if (!singleid || cid.IsPartOf(*singleid,  NULL))
            {
                BaseContainer bc;
                bc = GetCustomDataTypeDefault(DTYPE_REAL);
                bc.SetInt32(DESC_UNIT,FORMAT_DEGREE);
                bc.SetBool(DESC_FORBID_SCALING,  TRUE);
                bc.SetBool(DESC_FORBID_INLINE_FOLDING,  FALSE);
                bc.SetString(DESC_NAME,  "Test 1"_s);
                BaseContainer MeasureDivisionNames;
                
                
                if (!description->SetParameter(cid,  bc,  DescGroup))
                    return TRUE;
            }
            cid = DescLevel(2003,  DTYPE_VECTOR,  0);
            if (!singleid || cid.IsPartOf(*singleid,  NULL))
            {
                BaseContainer bc;
                bc = GetCustomDataTypeDefault(DTYPE_VECTOR);
                bc.SetBool(DESC_FORBID_SCALING,  TRUE);
                bc.SetBool(DESC_FORBID_INLINE_FOLDING,  FALSE);
                bc.SetString(DESC_NAME,  "Test 2"_s);
                BaseContainer MeasureDivisionNames;
                
                
                if (!description->SetParameter(cid,  bc,  DescGroup))
                    return TRUE;
            }
            cid = DescLevel(2004,  DTYPE_BOOL,  0);
            if (!singleid || cid.IsPartOf(*singleid,  NULL))
            {
                BaseContainer bc;
                bc = GetCustomDataTypeDefault(DTYPE_BOOL);
                bc.SetBool(DESC_FORBID_SCALING,  TRUE);
                bc.SetBool(DESC_FORBID_INLINE_FOLDING,  FALSE);
                bc.SetString(DESC_NAME,  "Test 3"_s);
                BaseContainer MeasureDivisionNames;
                
                
                if (!description->SetParameter(cid,  bc,  DescGroup))
                    return TRUE;
            }
            
            cid = DescLevel(2005,  DTYPE_BOOL,  0);
            if (!singleid || cid.IsPartOf(*singleid,  NULL))
            {
                BaseContainer bc;
                bc = GetCustomDataTypeDefault(DTYPE_BOOL);
                bc.SetBool(DESC_FORBID_SCALING,  TRUE);
                bc.SetBool(DESC_FORBID_INLINE_FOLDING,  FALSE);
                bc.SetString(DESC_NAME,  "Test 4"_s);
                BaseContainer MeasureDivisionNames;
                
                
                if (!description->SetParameter(cid,  bc,  DescGroup))
                    return TRUE;
            }
            cid = DescLevel(2006,  DTYPE_BOOL,  0);
            if (!singleid || cid.IsPartOf(*singleid,  NULL))
            {
                BaseContainer bc;
                bc = GetCustomDataTypeDefault(DTYPE_BOOL);
                bc.SetBool(DESC_FORBID_SCALING,  TRUE);
                bc.SetBool(DESC_FORBID_INLINE_FOLDING,  FALSE);
                bc.SetString(DESC_NAME,  "Test 5"_s);
                BaseContainer MeasureDivisionNames;
                
                
                if (!description->SetParameter(cid,  bc,  DescGroup))
                    return TRUE;
            }
            
        
        }
        flags |= DESCFLAGS_DESC::LOADED| DESCFLAGS_DESC::RECURSIONLOCK;
        
        return SUPER::GetDDescription(node,  description,  flags);
    }
    

    Any idea why there is the difference between versions of Cinema?

    Thanks, Dan

    posted in Cinema 4D SDK •
    RE: Checking if Cache/Deform Cache Is Dirty?

    Thanks, that was exactly what I needed!

    posted in Cinema 4D SDK •
    RE: Checking if Cache/Deform Cache Is Dirty?

    Here's the code I wrote. From what I can tell it gets the job done but it seems to get slow fast when the caches get big. Is there a better way to do this?

    CompleteDirtyCheck(BaseObject* checkobject, DIRTYFLAGS flags, maxon::BaseArray<Int32>* dirtyvalues)
    {
        if (checkobject == nullptr)
        {
            return ;
        }
        
        Int32 dvalue = checkobject->GetDirty(flags);
        dirtyvalues->Append(dvalue);
        BaseObject* cache = checkobject->GetCache();
        if (cache == nullptr)
        {
            return;
        }
        maxon::BaseArray<BaseObject*> caches;
        GetChildren(cache, &caches);
        Int32 childcount = caches.GetCount();
        for (Int32 x = 0; x<childcount; x++)
        {
            BaseObject* subcache = caches[x]->GetCache();
            
            CompleteDirtyCheck(subcache,flags,dirtyvalues);
            
            Int32 dirtyvalue = caches[x]->GetDirty(flags);
            dirtyvalues->Append(dirtyvalue);
            BaseObject* deformcache = caches[x]->GetDeformCache();
            if (deformcache!=nullptr)
            {
                
                Int32 dirtyvalue2 = deformcache->GetDirty(flags);
                dirtyvalues->Append(dirtyvalue2);
            }
        }
        
    
    posted in Cinema 4D SDK •
    Checking if Cache/Deform Cache Is Dirty?

    Hello! I'm having an issue with detecting whether and input object is dirty or not. For reference here is my scene file: Voronoi Fracture.c4d

    My understanding is that the Random Effector is making changes to making changes to the Voronoi Fracture's Cache.

    I don't understand why checking GetDirty(DIRTYFLAGS::CACHE) isn't returning dirty in this case. Is there something beyond that should be done?

    The other test I was doing was browsing through the cache via GetCache(), GetDown and GetNext and checking each individual part of the Cache for it being dirty. This does correctly return whether it is dirty or not, but this really slow to me, especially for something that would be running so often.

    What is the best way to reliably get if the Voronoi Fracture is dirty?

    Dan

    posted in Cinema 4D SDK •