3

I am creating an icosphere and subdivide it.

When I do it in the GUI console, no warnings.

enter image description here


However, when I put these code into a script and invoke it by blender --background --python ..., I get the following warnings.

warning DM_ensure_tessface: could not create tessfaces from 240 polygons, dm->type=2
warning DM_ensure_tessface: could not create tessfaces from 960 polygons, dm->type=2

What does this warning mean?

Crantisz
  • 35,244
  • 2
  • 37
  • 89
Sibbs Gambling
  • 719
  • 2
  • 15
  • 30

1 Answers1

2

No errors here. Make sure that the context is set to Object Mode and save the file:

import bpy

# set context
bpy.ops.object.mode_set(mode='OBJECT')

# get active object
target = bpy.data.objects['Icosphere']
bpy.context.scene.objects.active = target

# apply modifier
bpy.ops.object.modifier_apply(modifier="Subsurf") # apply_as='DATA'

# save the file
bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath)

Command line:

blender -b <path-to-blend-file> --python <path-to-python-script>
brockmann
  • 12,613
  • 4
  • 50
  • 93