2
$\begingroup$

Code from example:

import bpy

bpy.ops.object.select_all(action='DESELECT')
for ob in bpy.context.scene.objects:
    if not ob.hide:
        continue
    ...

Fails on ob.hide:

AttributeError: 'Object' object has no attribute 'hide'

How to solve this issue? It seems that example was written for 2.79.

$\endgroup$

1 Answer 1

4
$\begingroup$

Blender 2.80 use a more complicated (sound and safe for code) API to deal with some attributes.

As the object.hide in Blender 2.79 is replaced by getter and setter function:

object.hide_get() # get the hide value {True, False}
object.hide_set(True) # set hide to True

so, ob.hide needed to be replaced by ob.hide_get()

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .