Creating Rigid Bodies is rejected for some meshes #40447

Closed
opened 2014-05-31 14:17:50 +02:00 by Fabian Emmes · 9 comments

System Information
Windows 8.1, Intel integrated graphics (Sandy bridge).

Blender Version
Broken: current master branch (cc2cdfb0)

Short description of error
In engine "Blender Render", creating Rigid Bodies is rejected if the (base) Mesh Data object contains no faces, even if faces are created by the modifier stack (for example using the Screw modifier). Only using the "BASE" as mesh-source should be disallowed in this case, since using "FINAL" will yield a proper mesh.

Exact steps for others to reproduce the error
Create a circle mesh without faces. Use the Screw modifier to create a torus, but don't apply it. Creating a Rigid Body from this object is not possible (message: "Can't create Rigid Body from mesh with no polygons").

Proposed fix

Remove the check from rigidbody_object.c, and possibly add it at a later stage in the pipeline (when it is clear what mesh the Rigid Body should really be based on).

diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c
index e4426fd..8fb79f8 100644
- a/source/blender/editors/physics/rigidbody_object.c
+++ b/source/blender/editors/physics/rigidbody_object.c
@@ -100,10 +100,6 @@ bool ED_rigidbody_object_add(Scene *scene, Object *ob, int type, ReportList *rep

              BKE_report(reports, RPT_ERROR, "Can't add Rigid Body to non mesh object");
              return false;
      }
  • if (((Mesh *)ob->data)->totpoly == 0) {
  • BKE_report(reports, RPT_ERROR, "Can't create Rigid Body from mesh with no polygons");
  • return false;
  • }
      /* Add rigid body world and group if they don't exist for convenience */
      if (rbw == NULL) {
**System Information** Windows 8.1, Intel integrated graphics (Sandy bridge). **Blender Version** Broken: current master branch (cc2cdfb0) **Short description of error** In engine "Blender Render", creating Rigid Bodies is rejected if the (base) Mesh Data object contains no faces, even if faces are created by the modifier stack (for example using the Screw modifier). Only using the "BASE" as mesh-source should be disallowed in this case, since using "FINAL" will yield a proper mesh. **Exact steps for others to reproduce the error** Create a circle mesh without faces. Use the Screw modifier to create a torus, but don't apply it. Creating a Rigid Body from this object is not possible (message: "Can't create Rigid Body from mesh with no polygons"). **Proposed fix** Remove the check from rigidbody_object.c, and possibly add it at a later stage in the pipeline (when it is clear what mesh the Rigid Body should really be based on). diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c index e4426fd..8fb79f8 100644 - a/source/blender/editors/physics/rigidbody_object.c +++ b/source/blender/editors/physics/rigidbody_object.c @@ -100,10 +100,6 @@ bool ED_rigidbody_object_add(Scene *scene, Object *ob, int type, ReportList *rep ``` BKE_report(reports, RPT_ERROR, "Can't add Rigid Body to non mesh object"); return false; } ``` - if (((Mesh *)ob->data)->totpoly == 0) { - BKE_report(reports, RPT_ERROR, "Can't create Rigid Body from mesh with no polygons"); - return false; - } ``` /* Add rigid body world and group if they don't exist for convenience */ if (rbw == NULL) { ```
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @der_fab

Added subscriber: @der_fab
Author

I messed up the formatting of the diff.

diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c
index e4426fd..8fb79f8 100644
  - a/source/blender/editors/physics/rigidbody_object.c
+++ b/source/blender/editors/physics/rigidbody_object.c
@@ -100,10 +100,6 @@ bool ED_rigidbody_object_add(Scene *scene, Object *ob, int type, ReportList *rep
                BKE_report(reports, RPT_ERROR, "Can't add Rigid Body to non mesh object");
                return false;
        }
  • if (((Mesh *)ob->data)->totpoly == 0) {
  • BKE_report(reports, RPT_ERROR, "Can't create Rigid Body from mesh with no polygons");
  • return false;
  • }
        /* Add rigid body world and group if they don't exist for convenience */
        if (rbw == NULL) {
I messed up the formatting of the diff. ``` diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c index e4426fd..8fb79f8 100644 ``` - a/source/blender/editors/physics/rigidbody_object.c ``` +++ b/source/blender/editors/physics/rigidbody_object.c @@ -100,10 +100,6 @@ bool ED_rigidbody_object_add(Scene *scene, Object *ob, int type, ReportList *rep BKE_report(reports, RPT_ERROR, "Can't add Rigid Body to non mesh object"); return false; } ``` - if (((Mesh *)ob->data)->totpoly == 0) { - BKE_report(reports, RPT_ERROR, "Can't create Rigid Body from mesh with no polygons"); - return false; - } ``` /* Add rigid body world and group if they don't exist for convenience */ if (rbw == NULL) { ```
Member

Added subscriber: @LukasTonne

Added subscriber: @LukasTonne
Member

Agreed, this test is also pretty useless, since you can make a "proper" mesh with faces, make it a rigid body, then remove all faces afterward ... or assign different mesh datablock after making a rigid body object ... or something else, probably there are lots of ways to circumvent it.

Agreed, this test is also pretty useless, since you can make a "proper" mesh with faces, make it a rigid body, then remove all faces afterward ... or assign different mesh datablock after making a rigid body object ... or something else, probably there are lots of ways to circumvent it.

This issue was referenced by 7674ebf340

This issue was referenced by 7674ebf3407b4ac8dcf1ba88a9a240b619c13ae5

Added subscriber: @mont29

Added subscriber: @mont29
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Member

Closed by commit 7674ebf340.

Closed by commit 7674ebf340.
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#40447
No description provided.