Do not work change the grid taken from another scene. #46338

Closed
opened 2015-10-01 06:04:14 +02:00 by Tort · 17 comments

System Information
Ubuntu 12.04

Blender Version
Broken: (2.75a)
Worked: (2.70a)

Short description of error
Do not work change the grid taken from another scene.

Exact steps for others to reproduce the error
Do not work
sce.objects['obj'].replaceMesh(mesh, True, False)
If the mesh is in a different scene.

**System Information** Ubuntu 12.04 **Blender Version** Broken: (2.75a) Worked: (2.70a) **Short description of error** Do not work change the grid taken from another scene. **Exact steps for others to reproduce the error** Do not work sce.objects['obj'].replaceMesh(mesh, True, False) If the mesh is in a different scene.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @Tort

Added subscriber: @Tort

Added subscriber: @panzergame

Added subscriber: @panzergame

@Tort : Please provide an example file, reopen this task when you will do it.

@Tort : Please provide an example file, reopen this task when you will do it.
Author
Example [Bug_2.75a_replace_mesh_from_another_scene.blend](https://archive.blender.org/developer/F241480/Bug_2.75a_replace_mesh_from_another_scene.blend)
Member

Added subscriber: @JorgeBernalMartinez

Added subscriber: @JorgeBernalMartinez
Member

I confirm the bug.

I confirm the bug.

It's not a bug because two scene can have a mesh with the same name, so by default replaceMesh function works only with the object's scene meshes.

The bug is more that BGE doesn't print a message error for this.

It's not a bug because two scene can have a mesh with the same name, so by default replaceMesh function works only with the object's scene meshes. The bug is more that BGE doesn't print a message error for this.

Added subscriber: @sindra1961

Added subscriber: @sindra1961

@panzergame:
I think that your understanding is wrong.
Even if the scenes are different, the object of the same name cannot exist.
In such a case we cannot identify an object by the name in bpy.data.objects.

@panzergame: I think that your understanding is wrong. Even if the scenes are different, the object of the same name cannot exist. In such a case we cannot identify an object by the name in bpy.data.objects.

Added subscriber: @you.le

Added subscriber: @you.le

The problem seems to come from this commit:

$ git bisect bad
6c9dd174a8 is the first bad commit
commit 6c9dd174a8
Author: Mitchell Stokes mogurijin@gmail.com
Date: Mon Jun 2 18:52:13 2014 -0700

Fix #39053: Replace mesh actuator does not replace material (only mesh)

The replace mesh actuator was reconverting the mesh data which causes
conflicts with the LoD code. Instead, we just look for an already
converted mesh, which should already be in the scene.

https://developer.blender.org/rB6c9dd174a8bc2cd9a857c96f3ddfdb398aa6f88c

The problem seems to come from this commit: $ git bisect bad 6c9dd174a8bc2cd9a857c96f3ddfdb398aa6f88c is the first bad commit commit 6c9dd174a8bc2cd9a857c96f3ddfdb398aa6f88c Author: Mitchell Stokes <mogurijin@gmail.com> Date: Mon Jun 2 18:52:13 2014 -0700 Fix #39053: Replace mesh actuator does not replace material (only mesh) The replace mesh actuator was reconverting the mesh data which causes conflicts with the LoD code. Instead, we just look for an already converted mesh, which should already be in the scene. https://developer.blender.org/rB6c9dd174a8bc2cd9a857c96f3ddfdb398aa6f88c

Added subscribers: @Moguri, @ideasman42, @dr.sybren

Added subscribers: @Moguri, @ideasman42, @dr.sybren

Mesh are shared by library in blender but not in the BGE : the BGE make a copy of a mesh for each scene if at least one object use it. So you can't replace by a mesh not in the object's scene, KX_GameObject.replaceMesh respect this behavior only the replace mesh logic brick respect half it : it does nothing but doesn't print any warning message.

Why not share meshes between scenes ?
It will disallow to free a scene because one of the scene's mesh can be owned in any other object, and the replace mesh brick should always check if its mesh still exist.
Of course we can do like libload : remove all meshes in all objects owned by the freeing library.

@ideasman42, @Moguri, @dr.sybren : What are your opinion on this report ?

Mesh are shared by library in blender but not in the BGE : the BGE make a copy of a mesh for each scene if at least one object use it. So you can't replace by a mesh not in the object's scene, KX_GameObject.replaceMesh respect this behavior only the replace mesh logic brick respect half it : it does nothing but doesn't print any warning message. `Why not share meshes between scenes ?` It will disallow to free a scene because one of the scene's mesh can be owned in any other object, and the replace mesh brick should always check if its mesh still exist. Of course we can do like libload : remove all meshes in all objects owned by the freeing library. @ideasman42, @Moguri, @dr.sybren : What are your opinion on this report ?
Author

Why not share meshes between scenes ?

Because no room to swing fall.
Снимок экрана от 2015-10-17 17:31:37.jpg

> Why not share meshes between scenes ? Because no room to swing fall. ![Снимок экрана от 2015-10-17 17:31:37.jpg](https://archive.blender.org/developer/F245640/Снимок_экрана_от_2015-10-17_17_31_37.jpg)

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

This issue was referenced by 8d3d931f6a

This issue was referenced by 8d3d931f6a6401b44a23357839f498fdb7f24e36
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#46338
No description provided.