Duplicated objects transforms start at 0 #55247

Closed
opened 2018-05-29 15:49:03 +02:00 by Julien Kaspar · 9 comments
Member

Blender Version
Broken: 44b99d1052

Short description of error
When duplicating any object the duplicated object moves back to the scene origin. Also when not moving the object while duplicating (RMB to cancel) the object scale turns to 0 as well.

**Blender Version** Broken: 44b99d10520 **Short description of error** When duplicating any object the duplicated object moves back to the scene origin. Also when not moving the object while duplicating (RMB to cancel) the object scale turns to 0 as well.
Author
Member

Added subscriber: @JulienKaspar

Added subscriber: @JulienKaspar
Francesco Siddi was assigned by Julien Kaspar 2018-05-29 15:49:26 +02:00
Francesco Siddi removed their assignment 2018-05-29 15:55:31 +02:00
Dalai Felinto was assigned by Francesco Siddi 2018-05-29 15:55:31 +02:00

Added subscriber: @fsiddi

Added subscriber: @fsiddi

This is a blocking issue. Word on the street is that aligorith was working on it, but I could not get confirmation. Could you please look into this? Thanks!

This is a blocking issue. Word on the street is that aligorith was working on it, but I could not get confirmation. Could you please look into this? Thanks!

And if you cancel the operator, the new object has scale 0, 0, 0.

And if you cancel the operator, the new object has scale 0, 0, 0.
Member

Added subscribers: @dfelinto, @JoshuaLeung

Added subscribers: @dfelinto, @JoshuaLeung
Dalai Felinto was unassigned by Joshua Leung 2018-05-30 14:36:54 +02:00
Joshua Leung self-assigned this 2018-05-30 14:36:54 +02:00
Member

Calling the OBJECT_OT_duplicate operator directly seems to work ok.

What's probably happening is that the "evaluated" copy of the newly created object(s) haven't been initiated yet (i.e. the memory exists, but the settings from the old objects haven't been copied, as the objects haven't been evaluated yet. This in turn means that the transform code gets garbage (0 values), which results in the bugs we're seeing.

Investigating a fix.

Calling the `OBJECT_OT_duplicate` operator directly seems to work ok. What's probably happening is that the "evaluated" copy of the newly created object(s) haven't been initiated yet (i.e. the memory exists, but the settings from the old objects haven't been copied, as the objects haven't been evaluated yet. This in turn means that the transform code gets garbage (0 values), which results in the bugs we're seeing. Investigating a fix.
Joshua Leung removed their assignment 2018-05-30 15:56:00 +02:00
Dalai Felinto was assigned by Joshua Leung 2018-05-30 15:56:00 +02:00
Member

Unassigning from self - this requires a bit more low-level trickery than I have time to explore right now.

Notes from my investigations so far:

  • You cannot hack around it by just copying values onto DEG_get_evaluated_object() copies of the new object from within the operator.
    • Doing it within the first loop fails as the DEG_relations_tag_update will cause all existing COW evaluated copies that the depsgraph holds on to get freed/invalidated, so you lose any values you wrote onto those. (That happens because the depsgraph gets rebuilt to include the new relations at this point)
    • Doing a second loop over the selected objects (which should just be the duplicated ones now) doesn't work either, as the DEG_get_evaluated_object still returns the original object instead of something in COW domain
  • Putting DEG_id_tag_update(&basen->object->id, DEG_TAG_COPY_ON_WRITE); in either loop mentioned above has no effect...
  • Somewhere between the end of object_add.c :: duplicate_exec() and the start of transform_conversions.c :: ObjectToTransData(), something is making it so that there are memory blocks allocated in the depsgraph for the new evaluated data. However, the same thing doesn't perform any copy-on-write copying + evaluation during this step (so everything in ob_eval is 0.
Unassigning from self - this requires a bit more low-level trickery than I have time to explore right now. Notes from my investigations so far: * You cannot hack around it by just copying values onto `DEG_get_evaluated_object()` copies of the new object from within the operator. * Doing it within the first loop fails as the `DEG_relations_tag_update` will cause all existing COW evaluated copies that the depsgraph holds on to get freed/invalidated, so you lose any values you wrote onto those. (That happens because the depsgraph gets rebuilt to include the new relations at this point) * Doing a second loop over the selected objects (which should just be the duplicated ones now) doesn't work either, as the `DEG_get_evaluated_object` still returns the original object instead of something in COW domain * Putting `DEG_id_tag_update(&basen->object->id, DEG_TAG_COPY_ON_WRITE);` in either loop mentioned above has no effect... * Somewhere between the end of `object_add.c :: duplicate_exec()` and the start of `transform_conversions.c :: ObjectToTransData()`, something is making it so that there are memory blocks allocated in the depsgraph for the new evaluated data. However, the same thing *doesn't* perform any copy-on-write copying + evaluation during this step (so everything in ob_eval is 0.

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Fixed in 2.8 since the single-editing context changes to copy-on-write.

Fixed in 2.8 since the single-editing context changes to copy-on-write.
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
4 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#55247
No description provided.