Page MenuHome

Cycles: Initial Support For Local View
ClosedPublic

Authored by Jeroen Bakker (jbakker) on Wed, Sep 11, 11:46 AM.

Details

Summary

This diff will add support for local view to Cycles rendered preview mode.

Currently the implementation shows same results as EEVEE does. This means there is a difference with Blender 2.79, where lights were automatically added to the local view. T69780: Local/Global View handles light differently between Blender 2.79 and Blender 2.80 describes this should be solved before the next release.

This patch also solves missing owner_id issues when using the RNA CPP Api from Cycles. Cycles didn't provide the owner_id making some functionality fail, what then was worked around in Blender. It also fixes an issue in makesrna where incorrect CPP code was generated when only PARM_RNAPTR was provided.

An optional view_layer parameter is added to the Object.local_view_get method to reduce lookups.

Diff Detail

Repository
rB Blender

Event Timeline

Jeroen Bakker (jbakker) planned changes to this revision.Wed, Sep 11, 4:20 PM
Jeroen Bakker (jbakker) added inline comments.
source/blender/makesrna/intern/rna_object_api.c
258

blender_python.cpp seems to be the reason, not the CPP API.

PointerRNA v3dptr;
RNA_pointer_create(NULL, &RNA_SpaceView3D, pylong_as_voidptr_typesafe(pyv3d), &v3dptr);
BL::SpaceView3D v3d(v3dptr);

The first NULL is the reference to the ID datablock where the SpaceView3D is part of. As cycles set it to NULL some parts of the API needs to take some counter measurements. I have also seen this when working on the Viewport Render Parameters.

Will update the patch so BlenderPython also receives the Appropriate Screen. And update the documentation.

Cycles now set the correct owner_id

Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Wed, Sep 11, 4:44 PM

Removed unneeded code, after fixing owner_id in cycles

Brecht Van Lommel (brecht) added inline comments.
source/blender/makesrna/intern/rna_object_api.c
825

Remove . at the end of the description.

This revision is now accepted and ready to land.Wed, Sep 11, 5:16 PM
Jeroen Bakker (jbakker) retitled this revision from Cycles: Support For Local View to Cycles: Initial Support For Local View.Thu, Sep 12, 9:06 AM
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)
Jeroen Bakker (jbakker) edited the summary of this revision. (Show Details)Thu, Sep 12, 9:07 AM
Jeroen Bakker (jbakker) updated this revision to Diff 18139.

Removed '. ' at the end of the description

Jeroen Bakker (jbakker) marked an inline comment as done.Thu, Sep 12, 9:07 AM
This revision was automatically updated to reflect the committed changes.