Resizing Poly Object questions...



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

    On 20/11/2008 at 08:25, xxxxxxxx wrote:

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

    ---------
    I need to resize some PolygonObjects.  I can either:
    op->ResizeObject(newPntCnt)
    ...or...

        
        
          
        VariableChanged vc;  
        vc.old_cnt = oldPntCnt;  
        vc.new_cnt = newPntCnt;  
        op->Message(MSG_POINTS_CHANGED,&vc);  
        
    

    ...So, my questions are:
    1. Is there any functional difference between those two methods?
    2. If the object has one or more VariableTags on it (for example vertex map or maybe a Normal tag), do those automatically resize themselves too? Or do I need to handle each of those manually?
    3. How about the UVWTag (also based on a VariableTag)?



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

    On 20/11/2008 at 10:50, xxxxxxxx wrote:

    ...ok, at least with the VariableChanged method and at least with 'Tvertexmap'  VariableTags, the tag does resize itself.  I'm assuming that this holds true for other VariableTag types as well, but I'll check each type when I get a chance.
    I'm still curious if there's any functional difference between the VariableChanged method and just calling op->ResizeObject() ?



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

    On 20/11/2008 at 11:02, xxxxxxxx wrote:

    No idea on differences between ResizeObject() and VariableChanged but:

    1. Yes, Selection and Variable tags will resize accordingly from my experience. As it shows in the VariableChanged Example section of the docs:

    // Now all tags and structures have reacted and resized their
    // memory part...

    2. UVW tags should resize as well (Variable tag) - but be aware that you may damage the UVW mapping. I think that my experience here was simply adding/deleting points or polygons on an already mapped Polygon object and losing the mapping. You may need to test this.

    Exactly why are you changing point/polygon counts? ;)



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

    On 20/11/2008 at 11:10, xxxxxxxx wrote:

    Do'h!  The one link I didn't click on (VariableChanged) had the answer - thanks :).
    As for UVW tags, assuming they resize themselves, that would just 'make room' for the additional vertices (assuming you increased the vert count), but yu'd still need to 'fill in' the data to fix it back up (same deal with weight maps or Normal tags).
    As for why... this is part of a different plugin, where I need to generate new (split) vertices for any (previously) shared vertices (ie. used by more than one polygon) that don't have the same Material, Normal and/or UVW values for that vertex.


Log in to reply