On 27/07/2018 at 20:01, xxxxxxxx wrote:
Hey there,
I'm trying to make a simple script that will do two different functions depending on if an object is already selected or not selected in the current document. In the end, I'd like to just be able to select the first object if nothing is already selected otherwise I'd like it to pass and not select the first object. I've tried a bunch of ways already but this code seems to have got me the furthest way there.
Any ideas how I can do this? Thanks!
import c4d
def main() :
currDoc = c4d.documents.GetActiveDocument()
selection = currDoc.GetSelection()
if selection == None:
print 'need a selection'
else:
print 'an object is already selected'
if __name__=='__main__':
main()