Drivers set to Active Camera's Pass Index only updating on Grease Pencil objects #112212

Closed
opened 2023-09-11 02:46:28 +02:00 by Matthew Gafford · 4 comments

System Information
Operating system: Win 11 Home
Graphics card: RTX4090

Blender Version
Broken: 3.6.1
Worked: N/A

Short description of error

Drivers set to the active camera's pass index only update on Grease Pencil objects, and not meshes, bezier curves, etc.

Video Explanation
https://www.youtube.com/watch?v=l1VAbHzugno

Exact steps for others to reproduce the error

Download .blend
DriverSetToActiveCameraNotUpdating.blend

  1. Make two cameras, give one a pass index of 1, and the other a pass index of 2

  2. Put two markers on the timeline and set each marker to a different camera

  3. Create a Grease Pencil object and a mesh object, then set both of their Show in Viewport/Render icons to a driver with the following expression:
    bpy.context.scene.camera.pass_index != 1

  4. Drag the timeline back and forth to see that only the Grease Pencil object updates properly.

**System Information** Operating system: Win 11 Home Graphics card: RTX4090 **Blender Version** Broken: 3.6.1 Worked: N/A **Short description of error** Drivers set to the active camera's pass index only update on Grease Pencil objects, and not meshes, bezier curves, etc. Video Explanation https://www.youtube.com/watch?v=l1VAbHzugno **Exact steps for others to reproduce the error** Download .blend [DriverSetToActiveCameraNotUpdating.blend](/attachments/826ea4d0-674d-48b5-82eb-ee803196511a) 1. Make two cameras, give one a pass index of 1, and the other a pass index of 2 2. Put two markers on the timeline and set each marker to a different camera 3. Create a Grease Pencil object and a mesh object, then set both of their Show in Viewport/Render icons to a driver with the following expression: bpy.context.scene.camera.pass_index != 1 4. Drag the timeline back and forth to see that only the Grease Pencil object updates properly.
Matthew Gafford added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-09-11 02:46:29 +02:00
Member

Hi! you should be able to see a warning message when you add driver via this kind of path bpy.context.scene.camera.pass_index like this:

图片

The reason is that the expression is evaluated in python, blender will have no idea on what data this expression depends on, thus this expression could be evaluated before scene camera switch. To get it to work, you could specify scene camera as a driver variable like this, this way blender will know to evaluate scene camera before objects, then you can get correct result:

图片

Please verify if this does solve the issue. Thanks for reporting!

Hi! you should be able to see a warning message when you add driver via this kind of path `bpy.context.scene.camera.pass_index` like this: ![图片](/attachments/fdc79c8b-2185-4ede-98b8-8b6804b27abe) The reason is that the expression is evaluated in python, blender will have no idea on what data this expression depends on, thus this expression could be evaluated before scene camera switch. To get it to work, you could specify scene camera as a driver variable like this, this way blender will know to evaluate scene camera before objects, then you can get correct result: ![图片](/attachments/0cb0d565-feb0-4f5e-9359-ddbd18c1b135) Please verify if this does solve the issue. Thanks for reporting!
YimingWu added
Status
Needs Information from User
and removed
Status
Needs Triage
labels 2023-09-11 04:34:24 +02:00

Thank you, that worked perfectly. I just thought it was strange that it worked for GP objects but not anything else. Hope I didn't waste anyone's time!

Thank you, that worked perfectly. I just thought it was strange that it worked for GP objects but not anything else. Hope I didn't waste anyone's time!
Blender Bot added
Status
Archived
and removed
Status
Needs Information from User
labels 2023-09-11 05:06:32 +02:00
Member

Glad it solved :)

Glad it solved :)

Glad it solved :)

Just tried this again in 4.1.1 RC, and I'm having the same problem again; only Grease Pencil objects work with your solution.

For anyone else having this problem, I fixed it by moving the ".pass_index" property from var down to camera:

image

> Glad it solved :) Just tried this again in 4.1.1 RC, and I'm having the same problem again; only Grease Pencil objects work with your solution. For anyone else having this problem, I fixed it by moving the ".pass_index" property from var down to camera: ![image](/attachments/d1c7390c-923b-4454-9447-b2e6ba12ff23)
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
2 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#112212
No description provided.