ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

A common mistake users tends to do is to subdivide the model to minimize the shading issue, this is NOT good as it increases the poly count of the scene without eliminating the problem!

The right solution is to tweak the shading properties of the mesh; If you have no idea of what shading is please read this little introduction.

You need Blender installed and the Collada I/O add-on (this PPA provides a Blender version with Collada support enabled).

How to fix a mesh:

  • Import your mesh in blender: File > Import > Collada (Default) (.dae)
  • Select the mesh by right clicking on it in the 3D view
  • Switch to edit mode (Tab):
  • Switch to face selection (Ctrl+Tab) and select all faces (A) of the model
  • Set the shading of the faces to Smooth:

shading menu

  • Exit the edit mode (Tab)
  • Add an EdgeSplit modifier:

image description

  • Tweak the split angle value: lower values means less smoothing but less artifacts, large values (> 40°) will probably create artifacts!
  • Apply the modifier when the result satisfies you
  • Export the new Collada file

Result after the smoothing: image description

A common mistake users tends to do is to subdivide the model to minimize the shading issue, this is NOT good as it increases the poly count of the scene without eliminating the problem!

The right solution is to tweak the shading properties of the mesh; If you have no idea of what shading is please read this little introduction.

You need Blender installed and the Collada I/O add-on (this PPA provides a Blender version with Collada support enabled).

How to fix a mesh:

  • Import your mesh in blender: File > Import > Collada (Default) (.dae)
  • Select the mesh by right clicking on it in the 3D view
  • Switch to edit mode (Tab):
  • Switch to face selection (Ctrl+Tab) and select all faces (A) of the model
  • Set the shading of the faces to Smooth:

shading menu

  • Exit the edit mode (Tab)
  • Add an EdgeSplit modifier:

image description

  • Tweak the split angle value: lower values means less smoothing but less artifacts, large values (> 40°) will probably create artifacts!
  • Apply the modifier when the result satisfies you
  • Export the new Collada file

Result after the smoothing: image description

Python script

You can use this Python script to do the job for you; The script only modifies the selected objects. After that you need to individually tweak the split angle value and apply the modifier on each mesh.

import bpy
import re

# Applies only on selected objects
if len(bpy.context.selected_objects) > 0:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            bpy.context.scene.objects.active = obj
            bpy.ops.object.editmode_toggle()
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.mesh.faces_shade_smooth()
            bpy.ops.object.editmode_toggle()
            bpy.ops.object.modifier_add(type='EDGE_SPLIT')

# Don't forget to tweak the split angle and apply the modifier!

A common mistake users tends to do is to subdivide the model to minimize the shading issue, this is NOT good as it increases the poly count of the scene without eliminating the problem!

The right solution is to tweak the shading properties of the mesh; If you have no idea of what shading is please read this little introduction.

You need Blender installed and the Collada I/O add-on (this PPA provides a Blender version with Collada support enabled).

How to fix a mesh:

  • Import your mesh in blender: File > Import > Collada (Default) (.dae)
  • Select the mesh by right clicking on it in the 3D view
  • Switch to edit mode (Tab):
  • Switch to face selection (Ctrl+Tab) and select all faces (A) of the model
  • Set the shading of the faces to Smooth:

shading menu

  • Exit the edit mode (Tab)
  • Add an EdgeSplit modifier:

image description

  • Tweak the split angle value: lower values means less smoothing but less artifacts, large values (> 40°) will probably create artifacts!
  • Apply the modifier when the result satisfies you
  • Export the new Collada file

Result after the smoothing: image description

Python script

You can use this Python script to do the job for you; The script only modifies the selected objects. After that you need to individually tweak the split angle value and apply the modifier on each mesh.

import bpy
import re

# Applies only on selected objects
if len(bpy.context.selected_objects) > 0:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            bpy.context.scene.objects.active = obj
            bpy.ops.object.editmode_toggle()
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.mesh.faces_shade_smooth()
            bpy.ops.object.editmode_toggle()
            bpy.ops.object.modifier_add(type='EDGE_SPLIT')

# Don't forget to tweak the split angle!

Once you are done tweaking the split angle values, select all your meshes again and use this script to apply the modifier! EdgeSplit modified:

import bpy
import re

# Apply the EdgeSplit modifier on selected objects
if len(bpy.context.selected_objects) > 0:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            bpy.context.scene.objects.active = obj
            bpy.ops.object.modifier_apply(apply_as='DATA', modifier="EdgeSplit")

Note that in case something didn't go well, you can easily revert the changes with a Remove doubles in edit mode and switching back to flat shading.

A common mistake users tends to do is to subdivide the model to minimize the shading issue, this is NOT good as it increases the poly count of the scene without eliminating the problem!

The right solution is to tweak the shading properties of the mesh; If you have no idea of what shading is please read this little introduction.

You need Blender installed and the Collada I/O add-on (this PPA provides a Blender version with Collada support enabled).

How to fix a mesh:

  • Import your mesh in blender: File > Import > Collada (Default) (.dae)
  • Select the mesh by right clicking on it in the 3D view
  • Switch to edit mode (Tab):
  • Switch to face selection (Ctrl+Tab) and select all faces (A) of the model
  • Set the shading of the faces to Smooth:

shading menu

  • Exit the edit mode (Tab)
  • Add an EdgeSplit modifier:

image description

  • Tweak the split angle value: lower values means less smoothing but less artifacts, large values (> 40°) will probably create artifacts!
  • Apply the modifier when the result satisfies you
  • Export the new Collada file

Result after the smoothing: image description

Python script

You can use this Python script to do the job for you; The script only modifies the selected objects. After that you need to individually tweak the split angle value and apply the modifier on each mesh.

import bpy
import re

# Applies only on selected objects
if len(bpy.context.selected_objects) > 0:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            bpy.context.scene.objects.active = obj
            bpy.ops.object.editmode_toggle()
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.mesh.faces_shade_smooth()
            bpy.ops.object.editmode_toggle()
            bpy.ops.object.modifier_add(type='EDGE_SPLIT')

# Don't forget to tweak the split angle!

Once you are done tweaking the split angle values, select all your meshes again and use this script to apply the EdgeSplit modified:modifier:

import bpy
import re

# Apply the EdgeSplit modifier on selected objects
if len(bpy.context.selected_objects) > 0:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            bpy.context.scene.objects.active = obj
            bpy.ops.object.modifier_apply(apply_as='DATA', modifier="EdgeSplit")

Note that in case something didn't go well, you can easily revert the changes with a Remove doubles in edit mode and switching back to flat shading.

A common mistake users tends to do is to subdivide the model to minimize the shading issue, this is NOT good as it increases the poly count of the scene without eliminating the problem!

The right solution is to tweak the shading properties of the mesh; If you have no idea of what shading is please read this little introduction.

You need Blender installed and the Collada I/O add-on (this PPA provides a Blender version with Collada support enabled).

How to fix a mesh:

  • Import your mesh in blender: File > Import > Collada (Default) (.dae)
  • Select the mesh by right clicking on it in the 3D view
  • Switch to edit mode (Tab):
  • Switch to face selection (Ctrl+Tab) and select all faces (A) of the model
  • Set the shading of the faces to Smooth:

shading menu

  • Exit the edit mode (Tab)
  • Add an EdgeSplit modifier:

image description

  • Tweak the split angle value: lower values means less smoothing but less artifacts, large values (> 40°) will probably create artifacts!
  • Apply the modifier when the result satisfies you
  • Export the new Collada file

Result after the smoothing: image description

Python script

You can use this Python script to do the job for you; The script only modifies the selected objects. After that you need to individually tweak the split angle value and apply the modifier on each mesh.

import bpy
import re

# Applies only on selected objects
if len(bpy.context.selected_objects) > 0:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            bpy.context.scene.objects.active = obj
            bpy.ops.object.editmode_toggle()
            bpy.ops.mesh.select_all(action='SELECT')
            bpy.ops.mesh.remove_doubles()
            bpy.ops.mesh.faces_shade_smooth()
            bpy.ops.object.editmode_toggle()
            bpy.ops.object.modifier_add(type='EDGE_SPLIT')

# Don't forget to tweak the split angle!

Once you are done tweaking the split angle values, select all your meshes again and use this script to apply the EdgeSplit modifier:

import bpy
import re

# Apply the EdgeSplit modifier on selected objects
if len(bpy.context.selected_objects) > 0:
    for obj in bpy.context.selected_objects:
        if obj.type == 'MESH':
            bpy.context.scene.objects.active = obj
            bpy.ops.object.modifier_apply(apply_as='DATA', modifier="EdgeSplit")

Note that in case something didn't go well, you can easily revert the changes with a Remove doubles in edit mode and switching back to flat shading.