How to delete world without get the name of world in blender 2.8. For add world i use new_world = bpy.data.worlds.new(my_var_string) but name change by string. I think : can delete "Active world" without name? i try:bpy.data.worlds.remove()`but that line need a world .. i think if is possible delete world in use?

  • $\begingroup$ bpy.data.worlds.remove(new_world) $\endgroup$ – batFINGER Apr 16 '19 at 18:11
  • $\begingroup$ sorry @batFINGER your example is right but not work for me because i create a class with button panel for delete world background $\endgroup$ – Pastrokkio Apr 17 '19 at 2:03
  • $\begingroup$ maybe if context.world: bpy.data.worlds.remove(context.world) to totally remove that world, or do you want to just unlink from scene? $\endgroup$ – batFINGER Apr 17 '19 at 4:00
  • $\begingroup$ @batFINGER your example give me error: context object has no attribute 'world' $\endgroup$ – Pastrokkio Apr 17 '19 at 4:33
  • 1
    $\begingroup$ * context.scene.world (context.world is only available in the PROPERTIES space) $\endgroup$ – batFINGER Apr 17 '19 at 4:35

Your Answer

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

Browse other questions tagged or ask your own question.