3
$\begingroup$

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?

$\endgroup$
2
+25
$\begingroup$

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>
| improve this answer | |
$\endgroup$
  • $\begingroup$ I tried setting context to Object Mode, but the error seems to persist? $\endgroup$ – Sibbs Gambling Jun 30 '17 at 18:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.