Driver/Keyframes on object visibility do not update viewport #56635

Closed
opened 2018-08-31 22:16:19 +02:00 by Antonio Vazquez · 74 comments

Blender 2.8 Windows 64 bits version 30/08/2018 20:49

If one objet visibility option is changed using a driver, the visibility only changes after save and reload.

To reproduce:

The attached file has 2 objects, a Cube and a Suzanne monkey. There is a driver attached to suzanne to hide/show and the driver is handled using a custom prop of Cube. I know this is not a common use, but I tried to make a file as simple as possible to reproduce the bug.

  1. Open attached file
  2. Select the cube and in properties change "hide" property value to 1.
  3. Look at the outliner and verify hide property change in Suzanne.
  4. In viewport the Suzanne object still remain visible.
  5. Save and reload, the property now works.

I have tested the same driver hidden a collection and the problem is the same. Tested also in 2.79b and the drive hide/show suzanne without problems.

Driver_280.blend

image.png image.png

Blender 2.8 Windows 64 bits version 30/08/2018 20:49 If one objet visibility option is changed using a driver, the visibility only changes after save and reload. To reproduce: The attached file has 2 objects, a Cube and a Suzanne monkey. There is a driver attached to suzanne to hide/show and the driver is handled using a custom prop of Cube. I know this is not a common use, but I tried to make a file as simple as possible to reproduce the bug. 1) Open attached file 2) Select the cube and in properties change "hide" property value to 1. 3) Look at the outliner and verify hide property change in Suzanne. 4) In viewport the Suzanne object still remain visible. 5) Save and reload, the property now works. I have tested the same driver hidden a collection and the problem is the same. Tested also in 2.79b and the drive hide/show suzanne without problems. [Driver_280.blend](https://archive.blender.org/developer/F4488445/Driver_280.blend) ![image.png](https://archive.blender.org/developer/F4488454/image.png) ![image.png](https://archive.blender.org/developer/F4488458/image.png)
Author
Member

Added subscriber: @antoniov

Added subscriber: @antoniov

#61900 was marked as duplicate of this issue

#61900 was marked as duplicate of this issue

#61395 was marked as duplicate of this issue

#61395 was marked as duplicate of this issue

#61410 was marked as duplicate of this issue

#61410 was marked as duplicate of this issue

#61348 was marked as duplicate of this issue

#61348 was marked as duplicate of this issue

#61034 was marked as duplicate of this issue

#61034 was marked as duplicate of this issue

#60937 was marked as duplicate of this issue

#60937 was marked as duplicate of this issue

#58593 was marked as duplicate of this issue

#58593 was marked as duplicate of this issue

#60642 was marked as duplicate of this issue

#60642 was marked as duplicate of this issue

#58817 was marked as duplicate of this issue

#58817 was marked as duplicate of this issue

#60521 was marked as duplicate of this issue

#60521 was marked as duplicate of this issue

#60162 was marked as duplicate of this issue

#60162 was marked as duplicate of this issue

#58187 was marked as duplicate of this issue

#58187 was marked as duplicate of this issue

#60042 was marked as duplicate of this issue

#60042 was marked as duplicate of this issue

#59639 was marked as duplicate of this issue

#59639 was marked as duplicate of this issue

Added subscribers: @Sergey, @mont29

Added subscribers: @Sergey, @mont29
Sergey Sharybin was assigned by Bastien Montagne 2018-09-03 16:18:17 +02:00

Seems to be an update issue, clicking on the show/hide 'eye' icon, or on the render 'camera' one in the outliner fixes to visibility too, but clicking again on the viewport 'grid' one exhibits again the problem. As if driver eval was not updating things properly. not suer what exactly is the problem here, would suspect again some COW/depsgraph thingy, @Sergey?

Seems to be an update issue, clicking on the show/hide 'eye' icon, or on the render 'camera' one in the outliner fixes to visibility too, but clicking again on the viewport 'grid' one exhibits again the problem. As if driver eval was not updating things properly. not suer what exactly is the problem here, would suspect again some COW/depsgraph thingy, @Sergey?
Author
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Author
Member

@lichtwerk I think this could be related to #56636

Could you take a look?

@lichtwerk I think this could be related to #56636 Could you take a look?

Added subscriber: @brecht

Added subscriber: @brecht

This really is an issue for @Sergey to look at, it's a limitation regarding animation visibility in the dependency graph. We may not even support it in the first 2.80 release since it is quite complex to solve.

This really is an issue for @Sergey to look at, it's a limitation regarding animation visibility in the dependency graph. We may not even support it in the first 2.80 release since it is quite complex to solve.
Author
Member

Thanks for the info!

Thanks for the info!

Added subscriber: @heini

Added subscriber: @heini
Member

Added subscriber: @FrancescoArena

Added subscriber: @FrancescoArena
Philipp Oeser changed title from Driver property does not update viewport to Driver/Keyframes on object visibility do not update viewport 2019-01-02 09:57:17 +01:00
Member
Added subscribers: @The_art_of_spinjitsu_1_2_3, @1seby, @Picklejones, @clepsydrae, @MaferM, @JakubSteiner, @JustinJensen
Member

@Sergey: just letting you know this gets reported quite often...

@Sergey: just letting you know this gets reported quite often...

Added subscriber: @HenriqueGonzaga

Added subscriber: @HenriqueGonzaga

Added subscriber: @B_Engstler

Added subscriber: @B_Engstler

Really hoping this is fixed soon. It feels like a basic feature for all animators.

Really hoping this is fixed soon. It feels like a basic feature for all animators.

Added subscriber: @Alewinn

Added subscriber: @Alewinn

Still don't work with today build (downloaded from blender.org / beta section / windows 64).

If this can be useful ; I added the file I use to test this feature (see attached blend file).

The cube should desapear if you move up the constrained cone.
With the current build, I noticed that the outliner updates correctly when you hoover it with mouse cursor (icons updates, sometimes with a bit lag, as long as you hoover the outliner with the mouse cursor) but the 3D view won't update. You will have to disable/enable the cube object selection in the outliner, then the 3D view will update.

Also, if you play too much with the 3D view visibility of the cube inside the outliner (the eye icon) it will krashes blender, and/or have unpredictable behaviours.

Hope this would help a bit...

zz_Drivers_Visibility.blend

Still don't work with today build (downloaded from blender.org / beta section / windows 64). If this can be useful ; I added the file I use to test this feature (see attached blend file). The cube should desapear if you move up the constrained cone. With the current build, I noticed that the outliner updates correctly when you hoover it with mouse cursor (icons updates, sometimes with a bit lag, as long as you hoover the outliner with the mouse cursor) but the 3D view won't update. You will have to disable/enable the cube object selection in the outliner, then the 3D view will update. Also, if you play too much with the 3D view visibility of the cube inside the outliner (the eye icon) it will krashes blender, and/or have unpredictable behaviours. Hope this would help a bit... [zz_Drivers_Visibility.blend](https://archive.blender.org/developer/F6286073/zz_Drivers_Visibility.blend)

Added subscriber: @KillerWolf

Added subscriber: @KillerWolf

i've just found this problem - keyframing renderability for a Plane object and a Point Lamp are not working in an animation file that worked at 2.79

i've just found this problem - keyframing renderability for a Plane object and a Point Lamp are not working in an animation file that worked at 2.79

Added subscriber: @tomnel

Added subscriber: @tomnel

Added subscriber: @daniel.vanwesten

Added subscriber: @daniel.vanwesten

Added subscribers: @Cenda, @ZedDB

Added subscribers: @Cenda, @ZedDB

Added subscriber: @doakey3

Added subscriber: @doakey3

Added subscribers: @candreacchio, @Micool, @JacquesLucke

Added subscribers: @candreacchio, @Micool, @JacquesLucke

Added subscriber: @JuanCamardella

Added subscriber: @JuanCamardella

Added subscriber: @fletchgraham

Added subscriber: @fletchgraham

To get around the issues with keyframing visibility in 2.80, I used a script instead.

import bpy

# create a list of frames:
frames = []
for i in range(26):
    frames.append([str(i)])


# define which objects are visible on each frame:
frames[1] = ['object1']
frames[2] = ['object2', 'object3']
frames[3] = ['object1', 'object4', 'object2']

# define the function that runs before we advance to the next frame:
def run_script(scene):
    
    objects = bpy.data.collections['subject'].objects

    current_frame = bpy.context.scene.frame_current

    for object in objects:
        if object.name in frames[current_frame]:
            object.hide_viewport = False
            object.hide_render = False
        else:
            object.hide_viewport = True
            object.hide_render = True

bpy.app.handlers.frame_change_pre.append(run_script)

There's probably a more pythonic way to write this but it works!

To get around the issues with keyframing visibility in 2.80, I used a script instead. ``` import bpy # create a list of frames: frames = [] for i in range(26): frames.append([str(i)]) # define which objects are visible on each frame: frames[1] = ['object1'] frames[2] = ['object2', 'object3'] frames[3] = ['object1', 'object4', 'object2'] # define the function that runs before we advance to the next frame: def run_script(scene): objects = bpy.data.collections['subject'].objects current_frame = bpy.context.scene.frame_current for object in objects: if object.name in frames[current_frame]: object.hide_viewport = False object.hide_render = False else: object.hide_viewport = True object.hide_render = True bpy.app.handlers.frame_change_pre.append(run_script) ``` There's probably a more pythonic way to write this but it works!

Added subscriber: @ImmanuelCalvinHerchenbach

Added subscriber: @ImmanuelCalvinHerchenbach

I allready had this problem in a few projects.
Thank you @fletchgraham for your suggestion on forcing blender to update through python.

Here is my temporary fix.
After running the script the keyframes should behave as usual.

import bpy

render_only = False

def hide_on_render(scene):
    current_frame = bpy.context.scene.frame_current
    
    for object in bpy.data.objects:
        fcurve = object.animation_data.action.fcurves.find('hide_render')
        
        if fcurve:
            hide = fcurve.evaluate(current_frame) > 0

            object.hide_viewport = hide
            object.hide_render = hide
        

if render_only:
    bpy.app.handlers.render_pre.append(hide_on_render)
else:
    bpy.app.handlers.frame_change_pre.append(hide_on_render)
I allready had this problem in a few projects. Thank you @fletchgraham for your suggestion on forcing blender to update through python. Here is my temporary fix. After running the script the keyframes should behave as usual. ``` import bpy render_only = False def hide_on_render(scene): current_frame = bpy.context.scene.frame_current for object in bpy.data.objects: fcurve = object.animation_data.action.fcurves.find('hide_render') if fcurve: hide = fcurve.evaluate(current_frame) > 0 object.hide_viewport = hide object.hide_render = hide if render_only: bpy.app.handlers.render_pre.append(hide_on_render) else: bpy.app.handlers.frame_change_pre.append(hide_on_render) ```

Added subscribers: @arkadiusz_palki, @WilliamReynish

Added subscribers: @arkadiusz_palki, @WilliamReynish

Added subscriber: @HiddeJansen

Added subscriber: @HiddeJansen

Added subscriber: @BlandSauce

Added subscriber: @BlandSauce

Added subscriber: @DBAGibbz

Added subscriber: @DBAGibbz
Member

Added subscriber: @StephenHamacek

Added subscriber: @StephenHamacek

Added subscriber: @EugenioPignataro

Added subscriber: @EugenioPignataro

I've the same problem.
I believe that being able to control visibility on viewport is very important.

Using scripts can be a patch, but I doubt it is the best solution.
It was better than it was before.

I've the same problem. I believe that being able to control visibility on viewport is very important. Using scripts can be a patch, but I doubt it is the best solution. It was better than it was before.

Added subscriber: @Yassir

Added subscriber: @Yassir

I've just discovered this problem. I don't really understand the script workaround, but I know it's something with the internal code not updating. Because if I move a keyframe of Disable Render channel from the object, it will be updated, but then stays like the last render until I move any keyframe of Disable Render channel again.

I've just discovered this problem. I don't really understand the script workaround, but I know it's something with the internal code not updating. Because if I **move** a keyframe of Disable Render channel from the object, it will be updated, but then stays like the last render until I move any keyframe of Disable Render channel again.

Also I don't know if I should write here or create another task, but I can't even insert keyframe on viewport visibility, while I can insert one for render visibility. It will show an error as shown in the screenshot: viewport_visibility_error_no_active_keying_set.png
If some people with earlier build can insert keyframe on viewport visibility, even if they don't update correctly, is this one more regression from earlier build or intended to prevent crash? I've tried this on few builds that I still have, with the earliest build on 552b2287db (01/02/2019) and the latest build blender-2.80-d3870471edd7-win64 (12/02/2019).

Also I don't know if I should write here or create another task, but I can't even insert keyframe on viewport visibility, while I can insert one for render visibility. It will show an error as shown in the screenshot: ![viewport_visibility_error_no_active_keying_set.png](https://archive.blender.org/developer/F6594618/viewport_visibility_error_no_active_keying_set.png) If some people with earlier build can insert keyframe on viewport visibility, even if they don't update correctly, is this one more regression from earlier build or intended to prevent crash? I've tried this on few builds that I still have, with the earliest build on 552b2287db86 (01/02/2019) and the latest build blender-2.80-d3870471edd7-win64 (12/02/2019).

Added subscriber: @crantisz

Added subscriber: @crantisz

Added subscriber: @ConradDueck

Added subscriber: @ConradDueck

Added subscriber: @dskjal-1

Added subscriber: @dskjal-1

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Committed quite some fixes in various related ares and this report is supposed to be fixed now! The minimal revision required is 846d265a06.

Thanks for the report, closing.

Committed quite some fixes in various related ares and this report is supposed to be fixed now! The minimal revision required is 846d265a06. Thanks for the report, closing.

On blender-2.80-e795dd4a20a1-win64

This fix created a new issue on the rendering an hidden object test anim.blend :

Please try to render this example when the cube is disabled -> blender crashes.

On blender-2.80-e795dd4a20a1-win64 This fix created a new issue on the rendering an hidden object [test anim.blend](https://archive.blender.org/developer/F6736090/test_anim.blend) : Please try to render this example when the cube is disabled -> blender crashes.

@Micool, please create a new bug report about that.

@Micool, please create a new bug report about that.

@brecht, @Micool, fixed it now.

@brecht, @Micool, fixed it now.

@Sergey : this will make me the happiest man :)
I'll test it in the next build.
Thanks a lot.

@Sergey : this will make me the happiest man :) I'll test it in the next build. Thanks a lot.

Hi Guys,

Im trying the new build, and still cannot animate the "Hide collection in viewport" (the eye icon). Is there some hidden way to animate this value now that its fixed? The tooltip doesnt give me any clues....

Edit:
Looks like on collections these values are still not animatable on either of them....

collection = bpy.data.collections.new("Frame_" + str(fi))
collection.hide_render = False
collection.hide_viewport = False
collection.keyframe_insert( data_path="hide_viewport",
index=-1,
frame=current_frame)
collection.keyframe_insert( data_path="hide_render",
index=-1,
frame=current_frame)

TypeError: bpy_struct.keyframe_insert() property "hide_viewport" not animatable

Hi Guys, Im trying the new build, and still cannot animate the "Hide collection in viewport" (the eye icon). Is there some hidden way to animate this value now that its fixed? The tooltip doesnt give me any clues.... Edit: Looks like on collections these values are still not animatable on either of them.... collection = bpy.data.collections.new("Frame_" + str(fi)) collection.hide_render = False collection.hide_viewport = False collection.keyframe_insert( data_path="hide_viewport", index=-1, frame=current_frame) collection.keyframe_insert( data_path="hide_render", index=-1, frame=current_frame) TypeError: bpy_struct.keyframe_insert() property "hide_viewport" not animatable

Currently only objects visibility is animated.

Allowing animation of collection animation is possible, but is more tricky to implement without loosing ability to keep memory footprint in control.

For now you can instance the collection and control visibility of the instancer.

Currently only objects visibility is animated. Allowing animation of collection animation is possible, but is more tricky to implement without loosing ability to keep memory footprint in control. For now you can instance the collection and control visibility of the instancer.

Added subscriber: @NSeif

Added subscriber: @NSeif

Hello, I am facing the same problem.
Can someone give an example or a step by step guide of how to key visibility on instanced collection or object? (with the latest build of blender 2.80)

It would be appreciated a lot!
Thanks,

Hello, I am facing the same problem. Can someone give an example or a step by step guide of how to key visibility on instanced collection or object? (with the latest build of blender 2.80) It would be appreciated a lot! Thanks,

Likewise just tried object visibility keyframing in latest build as of today (Mac) and still no option to keyframe or add drivers to object viewport visibility (eye icon in outliner). This is quite a crucial feature for me to start migrating my main project to 2.80

Likewise just tried object visibility keyframing in latest build as of today (Mac) and still no option to keyframe or add drivers to object viewport visibility (eye icon in outliner). This is quite a crucial feature for me to start migrating my main project to 2.80

For that issue, see #62094 (Unable to insert a hide_viewport keyframe via the UI).

For that issue, see #62094 (Unable to insert a hide_viewport keyframe via the UI).

Added subscriber: @TheOldBen

Added subscriber: @TheOldBen

Can confirm, this persists on 2.82.6 and 2.83 alpha.
I have attached a sample file and a demo video.

VIsibilityDriverToggleGlitch.blend
VisibilityDriverGlitch.mp4

The file only has a cube with a single Custom Property called "Visibility" on it. Range is 0 to 1.
This drives both Viewport and Render Visibility.

If you activate and deactivate it by dragging, it goes amiss a little less often, but with the arrows, it glitches out irregularly, roughly about 1 in 5 times.

Can confirm, this persists on 2.82.6 and 2.83 alpha. I have attached a sample file and a demo video. [VIsibilityDriverToggleGlitch.blend](https://archive.blender.org/developer/F8342994/VIsibilityDriverToggleGlitch.blend) [VisibilityDriverGlitch.mp4](https://archive.blender.org/developer/F8342993/VisibilityDriverGlitch.mp4) The file only has a cube with a single Custom Property called "Visibility" on it. Range is 0 to 1. This drives both Viewport and Render Visibility. If you activate and deactivate it by dragging, it goes amiss a little less often, but with the arrows, it glitches out irregularly, roughly about 1 in 5 times.

Added subscriber: @mavixtious

Added subscriber: @mavixtious

I can confirm this. I have the same problem. I have an armature with a mesh parented to it and a properties bone. I tried to drive the visibility of the mesh both in viewport and render and switch between hiding and revealing them using that bone. But I can't hide/reveal them both at same time. Some times they do, sometimes they interchange. In other words, the driver of hiding the mesh in viewport alone works fine with the bone, but if you also drive the rendering, then it bugs and doesn't allow you to hide/reveal them both at the same time, only one at a time. Saving and reloading the file doesn't work for me.

Visibility drivers are not only extremely useful but most of the time necessary, they speed things up and make life much easier, so we can't have them bugging. I strongly suggest you fix this issue as soon as possible. Thank you.

I can confirm this. I have the same problem. I have an armature with a mesh parented to it and a properties bone. I tried to drive the visibility of the mesh both in viewport and render and switch between hiding and revealing them using that bone. But I can't hide/reveal them both at same time. Some times they do, sometimes they interchange. In other words, the driver of hiding the mesh in viewport alone works fine with the bone, but if you also drive the rendering, then it bugs and doesn't allow you to hide/reveal them both at the same time, only one at a time. Saving and reloading the file doesn't work for me. Visibility drivers are not only extremely useful but most of the time necessary, they speed things up and make life much easier, so we can't have them bugging. I strongly suggest you fix this issue as soon as possible. Thank you.

Added subscriber: @MarcelLegindi

Added subscriber: @MarcelLegindi

Added subscriber: @jcbize

Added subscriber: @jcbize
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
28 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#56635
No description provided.