Create a PolygonSelection tag?



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

    On 18/02/2003 at 09:35, xxxxxxxx wrote:

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

    ---------
    Hi,
    I'm back... :)
    How do you create a PolygonSelection tag for an object that includes all of its polygon (like SelectAll)?  I know that this may seem strange, but this is preparation for calling "Connect" on all of the objects - want to retain the original '.obj' groups.
    While I'm asking, why is it that when "Connect" is called on a multi-selection of objects, only two of the Texture tags are added to the new composite object?  I've tried this when only three materials (and three Texture tags) were available and when there were many more, all properly referenced.
    Thanks again,
    Robert



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

    On 18/02/2003 at 11:31, xxxxxxxx wrote:

    Okay, I've received an answer to my second question concerning "Connect" and lack of Texture tags.
    Still not sure about creating a PolygonSelection tag.
    Robert



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

    On 18/02/2003 at 13:20, xxxxxxxx wrote:

    Took alittle consideration and examination of references, but this works:

        
        
          
            // Add a group-level PolygonSelection tag (for texture and to retain .obj groups when connected)  
             ModelingCommandData cd;  
             cd.doc = baseDoc;  
             cd.op = object;  
             cd.mode = MODIFY_POLYGONSELECTION;  
             if (!SendModelingCommand(MCOMMAND_SELECTALL, cd))  
             {  
              GePrint(String("Select All Failed"));  
              throw ErrorException(ERROR_RETURNFALSE, NULL);  
             }  
             if (!SendModelingCommand(MCOMMAND_GENERATESELECTION, cd))  
             {  
              GePrint(String("Set Selection Failed"));  
              throw ErrorException(ERROR_RETURNFALSE, NULL);  
             }  
        
    

    Robert



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

    On 18/02/2003 at 15:40, xxxxxxxx wrote:

    oh that´s hard :)
    you can allocate them like any other BaseList2D member too. i.e.:
    SelectionTag* stag = SelectionTag::Alloc(Tpolygonselection);
    you can then use GetBaseSelect() that will return a BaseSelection that you can fill.



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

    On 17/03/2003 at 15:03, xxxxxxxx wrote:

    Okay, smarty pants, here's a question concerning the BaseSelect. ;0P
    If I want to simulate want I did in the code above (SelectALL on an object), how do I do it?  I realize that BaseSelect has a SelectAll() method, but it requires a min and max element number.  min is obvious (0), but what shall I use for max?  And, does this encompass everything selected must points, edges, or polygons be specified somewhere?
    The reason I ask is that now (it's been awhile but have had to return to this) a pointer to the SelectionTag is necessary and the SendModelingCommand() approach doesn't return one, of course.
    Thanks,
    Robert.



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

    On 17/03/2003 at 15:42, xxxxxxxx wrote:

    hi,
    SelectAll(0,op->GetPointCount()) for example for all points. The selection takes place in the BaseSelect. If you have a point BaseSelection from i.e. op->GetPointS() it will select all points. Same for all polygons and edges.



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

    On 17/03/2003 at 18:50, xxxxxxxx wrote:

    But all I have is a BaseObject, not a PolygonObject. Don't know if this matters, but the PolygonObject is derived from BaseObject (not the other way round), so I'm not certain if I even have those methods available - unless I go through 30 classes and changed BaseObject to PolygonObject...
    So, if the objects are polygonal (loaded .obj files), will they have the PolygonObject info available by casting?
    Robert



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

    On 17/03/2003 at 21:39, xxxxxxxx wrote:

    Seems to work without any problems.  See next topic. :)
    Robert


Log in to reply