THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 01/04/2011 at 01:59, xxxxxxxx wrote:
I was hoping to get some advice on how to properly use the following functions that are part of c4d.BaseSelect()
Snippets that don't work as I would expect
#Select all points and polys
point_select.SelectAll(0, point_count)
poly_select.SelectAll(0, poly_count)
My Full Source Code
"""
Select All Polygons
-------------------------------
Open Source - Free for all
Originally written by:
Donovan Keith
[email protected]
Last Edit: 04/01/2011
"""
import c4d
from c4d import gui, documents
def main() :
#Get active document
doc = documents.GetActiveDocument()
if not doc:
gui.MessageDialog("No active document.")
return False
#Get first active object
op = doc.GetActiveObject()
if not op or not op.CheckType(c4d.Opolygon) :
gui.MessageDialog("No poly objected selected")
return False
#Get point and polygon selections and counts
point_select = op.GetPointS()
poly_select = op.GetPolygonS()
point_count = op.GetPointCount()
poly_count = op.GetPolygonCount()
#Select all points and polys
point_select.SelectAll(0, point_count)
poly_select.SelectAll(0, poly_count)
#Alert C4D something has changed
c4d.EventAdd()
if __name__=='__main__':
main()
What am I doing incorrectly? I can properly select and deselect elements using .Select() and .Deselect(), but no joy otherwise.
Thanks,
Donovan