SelectionTag



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

    On 12/03/2011 at 08:26, xxxxxxxx wrote:

    Is this class not finished yet ? GetSelection() does not work. And what about a SetSelection() function ?



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

    On 12/03/2011 at 11:21, xxxxxxxx wrote:

    Please use GetBaseSelect().

    Cheers, Sebastian



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

    On 12/03/2011 at 13:27, xxxxxxxx wrote:

    Ah, Is it part of the SelectionTag Class ? Its not in the Sdk.
    I'd rather need SetBaseSelect() or something.
    And something like

    MyPolygonObject.SetPolygonSelection(MyBaseSelectObject)

    Thanks, nux



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

    On 12/03/2011 at 14:24, xxxxxxxx wrote:

    to set the selection you can manipulate the BaseSelect which you get by calling GetBaseSelect()



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

    On 12/03/2011 at 17:52, xxxxxxxx wrote:

    Ah, so this is a direct link to the BaseSelect? Would never ahve thought of this
    I'll try this, thanks. :)



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

    On 12/03/2011 at 20:37, xxxxxxxx wrote:

    Here's a simple example using GetBaseSelect() just in case anyone needs it.

      
    import c4d  
    from c4d import gui  
      
    def main() :  
     obj = doc.GetFirstObject()  
     tag = obj.GetFirstTag() # make sure the selection tag is the first one in the list of tags  
     polycountOfObject = obj.GetPolygonCount()#How many polygons does the object have in total?  
     selected = tag.GetBaseSelect()#Gets the selected polygons on the object  
     countSelected = selected.GetCount()#how many polygons are selected?  
     print "total polys in object = ", polycountOfObject  
     print "total of selected polys = ", countSelected  
      
    #Loop through the polys to get the selected one's index numbers  
      
     for i in range(polycountOfObject) :  
      if selected.IsSelected(i) :  
    print i  
      
    if __name__=='__main__':  
      main()  
    

    -ScottA



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

    On 13/03/2011 at 05:50, xxxxxxxx wrote:

    Btw, you don't need to declare i before the for-loop.
    And it was about setting selection, not getting. ;)

    Works perfect, Satara ! But i'd rather use SetSelection(BaseSelectObject). Unfortunately it's not possible

    Cheers, nux



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

    On 13/03/2011 at 07:48, xxxxxxxx wrote:

    The methods BaseSelect.CopyTo and BaseSelect.GetClone might help you here.


Log in to reply