[Bf-extensions-cvs] [aa71fb1f] master: Rune Morling patch to finish fixing (dupli) instances post 2.8 THANKS!

Maurice Raybaud noreply at git.blender.org
Sun Aug 25 11:58:43 CEST 2019


Commit: aa71fb1f169c8a7234ef3559fc616272be9a7741
Author: Maurice Raybaud
Date:   Sun Aug 25 11:57:40 2019 +0200
Branches: master
https://developer.blender.org/rBAaa71fb1f169c8a7234ef3559fc616272be9a7741

Rune Morling patch to finish fixing (dupli) instances post 2.8 THANKS!

===================================================================

M	render_povray/render.py

===================================================================

diff --git a/render_povray/render.py b/render_povray/render.py
index 1b03c241..710c7493 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -2064,7 +2064,7 @@ def write_pov(filename, scene=None, info_callback=None):
 
         ob_num = 0
         for ob in sel:
-            #subtract original from the count of their instances as were not counted before 2.8 
+            #subtract original from the count of their instances as were not counted before 2.8
             if not (ob.is_instancer and ob.original != ob):
                 ob_num += 1
 
@@ -3238,6 +3238,10 @@ def write_pov(filename, scene=None, info_callback=None):
                         dup = "#declare DATA%s = union{\n" %(string_strip_hyphen(bpy.path.clean_name(ob.name)))
                     for eachduplicate in depsgraph.object_instances:
                         if eachduplicate.is_instance:  # Real dupli instance filtered because original included in list since 2.8
+                            print("eachduplicate.object.name: %s" % eachduplicate.object.name)
+                            if not "name" in dir(bpy.data.objects[eachduplicate.object.name].data):
+                                print("WARNING: No 'name' in dir(bpy.data.objects[eachduplicate.object.name].data) = %s" % (dir(bpy.data.objects[eachduplicate.object.name].data)))
+                                continue # don't try to parse objects with no name
                             duplidataname = "OB"+string_strip_hyphen(bpy.path.clean_name(bpy.data.objects[eachduplicate.object.name].data.name))
                             dupmatrix = eachduplicate.matrix_world.copy() #has to be copied to not store instance since 2.8
                             dup += ("\tobject {\n\t\tDATA%s\n\t\t%s\t}\n" %(string_strip_hyphen(bpy.path.clean_name(bpy.data.objects[eachduplicate.object.name].data.name)), MatrixAsPovString(ob.matrix_world.inverted() @ dupmatrix)))
@@ -3812,7 +3816,6 @@ class PovrayRender(bpy.types.RenderEngine):
     def _export(self, depsgraph, povPath, renderImagePath):
         import tempfile
         scene = bpy.context.scene
-        
         if scene.pov.tempfiles_enable:
             self._temp_file_in = tempfile.NamedTemporaryFile(suffix=".pov", delete=False).name
             # PNG with POV 3.7, can show the background color with alpha. In the long run using the



More information about the Bf-extensions-cvs mailing list