Results 1 to 4 of 4

Thread: How to test if an object exists

  1. #1

    How to test if an object exists

    How do I run a check to see if an object exists in python?



  2. #2
    Member
    Join Date
    Dec 2011
    Location
    Germany
    Posts
    3,991
    like to check for an object by name?

    Code:
    if bpy.data.objects.get("ObjectName") is not None:
        print("found object")



  3. #3
    Thanks Very much!



  4. #4
    Member Richcolburn's Avatar
    Join Date
    Aug 2009
    Location
    Secret lab at the bottom of the Marianas Trench
    Posts
    256
    Slightly faster:
    Code:
    found = 'ObjectName' in bpy.data.objects
    The 3D Advantage



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •