Cycles dupli object baking issues #43553

Open
opened 2015-02-03 21:25:48 +01:00 by Vilem Duha · 23 comments
Member

System Information
nvidia g880m

Blender Version
Broken: blender-2.73-d56c9fb-win64
Worked: (optional) probably never

Short description of error
when assigning object as duplis to some mesh, and then trying to bake these duplis to another mesh, duplis appear black. But in normals mode, it works, so they are there, just without material or something.
Also, you can see that the duplis are there actually twice, one offset quite strongly. In some other file, I got them also four times...

Exact steps for others to reproduce the error
bakebug.blend
open the file, hit bake.
the group of objects in the ceter bakes to the cube.

also, you can see another group of objects, where duplis have been made "real" and it works well, it's group of objects called "fine", baking to the cube works well with seemingly same meshes.

**System Information** nvidia g880m **Blender Version** Broken: blender-2.73-d56c9fb-win64 Worked: (optional) probably never **Short description of error** when assigning object as duplis to some mesh, and then trying to bake these duplis to another mesh, duplis appear black. But in normals mode, it works, so they are there, just without material or something. Also, you can see that the duplis are there actually twice, one offset quite strongly. In some other file, I got them also four times... **Exact steps for others to reproduce the error** [bakebug.blend](https://archive.blender.org/developer/F140745/bakebug.blend) open the file, hit bake. the group of objects in the ceter bakes to the cube. also, you can see another group of objects, where duplis have been made "real" and it works well, it's group of objects called "fine", baking to the cube works well with seemingly same meshes.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Dalai Felinto was assigned by Vilem Duha 2015-02-03 21:25:48 +01:00
Author
Member

Added subscriber: @VilemDuha

Added subscriber: @VilemDuha

#83527 was marked as duplicate of this issue

#83527 was marked as duplicate of this issue

#76864 was marked as duplicate of this issue

#76864 was marked as duplicate of this issue

#54133 was marked as duplicate of this issue

#54133 was marked as duplicate of this issue

#46224 was marked as duplicate of this issue

#46224 was marked as duplicate of this issue
Author
Member

just foud the reason for the fact that there are actually more duplis:

when you hit bake, you can even see in the viewport for a second, that the code triangulates the faces of the dupli parent - this causes double count of the duplis ;)

just foud the reason for the fact that there are actually more duplis: when you hit bake, you can even see in the viewport for a second, that the code triangulates the faces of the dupli parent - this causes double count of the duplis ;)
Author
Member

Also,
forgot to mention - the actual dupli parent renders too, while it shouldn't render at all.
It also renders totally black. You can see it if you make the duplicated object smaller, there are more artifacts coming not from the spheres, but also from the parent object.

Also, forgot to mention - the actual dupli parent renders too, while it shouldn't render at all. It also renders totally black. You can see it if you make the duplicated object smaller, there are more artifacts coming not from the spheres, but also from the parent object.

Added subscribers: @Sergey, @brecht

Added subscribers: @Sergey, @brecht

The issue is that BKE_mesh_new_from_object() (or the python functions that use it: object_to_mesh(), new_from_object()) don't return the dupli groups converted to the final mesh.

What Blender does (in Cycles and in exporters) is to use object.dupli_list_create() and grab the objects and their matrices from it.

The options I thought of:

  1. To handle all of this in object_bake_api.c.

In order to do that I would replace all the BKE_mesh_new_from_object() calls by a new function that would get all the meshes of all the dupli objects, and join them as the final mesh to return. I have an idea of how to do this (but for the 'join'), but the biggest issue is that we need to guarantee that the mesh is "joined" just as it would in Cycles. In order to keep the primitive_id consistent.

  1. To handle this by changing the api to pass the object id and the object matrix.

This way we can pass each of the individual duplicated objects as an individual High Poly object to bake from.

@brecht , @Sergey, any thoughts? I would like to have an agreed design before I head to the implementation.

The issue is that `BKE_mesh_new_from_object()` (or the python functions that use it: `object_to_mesh()`, `new_from_object()`) don't return the dupli groups converted to the final mesh. What Blender does (in Cycles and in exporters) is to use `object.dupli_list_create()` and grab the objects and their matrices from it. The options I thought of: 1. To handle all of this in `object_bake_api.c`. In order to do that I would replace all the `BKE_mesh_new_from_object()` calls by a new function that would get all the meshes of all the dupli objects, and join them as the final mesh to return. I have an idea of how to do this (but for the 'join'), but the biggest issue is that we need to guarantee that the mesh is "joined" just as it would in Cycles. In order to keep the primitive_id consistent. 2. To handle this by changing the api to pass the `object id` and the `object matrix`. This way we can pass each of the individual duplicated objects as an individual High Poly object to bake from. @brecht , @Sergey, any thoughts? I would like to have an agreed design before I head to the implementation.

Added subscriber: @dfelinto

Added subscriber: @dfelinto

@dfelinto, passing object matrix seems cleaner solution for me and easier to implement. And would work faster than joining meshes i think.

At least i'd try matrix approach and see if all the corner cases are solved with this.

@dfelinto, passing object matrix seems cleaner solution for me and easier to implement. And would work faster than joining meshes i think. At least i'd try matrix approach and see if all the corner cases are solved with this.

Added subscriber: @mont29

Added subscriber: @mont29

And would work faster than joining meshes I think.

It would be faster, but the memory footprint will go through the roofs.
I think we should first prioritize #41092 (or rather D772) before this one then.

> And would work faster than joining meshes I think. It would be faster, but the memory footprint will go through the roofs. I think we should first prioritize #41092 (or rather [D772](https://archive.blender.org/developer/D772)) before this one then.

This issue was referenced by 1eb561bfc1e357ab50c90f18632c485d657c8007

This issue was referenced by 1eb561bfc1e357ab50c90f18632c485d657c8007

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Changed status from 'Resolved' to: 'Open'

Changed status from 'Resolved' to: 'Open'

:/ I pushed it to the wrong repository, it was never intended to go to blender.org

:/ I pushed it to the wrong repository, it was never intended to go to blender.org

For the records, those are the test files I'm using lately. They both fail to bake properly at the moment.

dupligroup_colored.blend

dupligroup_textured.blend

For the records, those are the test files I'm using lately. They both fail to bake properly at the moment. [dupligroup_colored.blend](https://archive.blender.org/developer/F197156/dupligroup_colored.blend) [dupligroup_textured.blend](https://archive.blender.org/developer/F197157/dupligroup_textured.blend)

Added subscriber: @AidyBurrows-1

Added subscriber: @AidyBurrows-1
Brecht Van Lommel changed title from baking duplicate objects renders them black in Cycles, and also multiple times... to Cycles dupli object baking issues 2016-02-21 15:13:36 +01:00
Dalai Felinto removed their assignment 2019-12-23 16:37:50 +01:00
Member

Added subscribers: @sanne, @lichtwerk, @LazyDodo

Added subscribers: @sanne, @lichtwerk, @LazyDodo
Member

Added subscribers: @SteffenD, @mano-wii, @iss

Added subscribers: @SteffenD, @mano-wii, @iss
Member

Added subscriber: @Lluc3D

Added subscriber: @Lluc3D
Philipp Oeser removed the
Interest
Render & Cycles
label 2023-02-09 13:56:49 +01:00
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
6 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#43553
No description provided.