Skip to content
Snippets Groups Projects
Commit 015248ed authored by Maurice Raybaud's avatar Maurice Raybaud
Browse files

POV: Fix POV specific primitives

Using object.update_tag() as pov specific object typing property set from python would not be visible from depsgraph before file save, causing mesh proxies to export rather than their pure untesselated pov shapes.
parent 478f0466
Branches
Tags
No related merge requests found
...@@ -27,13 +27,13 @@ render_gui.py : ...@@ -27,13 +27,13 @@ render_gui.py :
Display properties from render_properties.py for user to change them Display properties from render_properties.py for user to change them
render.py : render.py :
Translate render properties (Blender and POV native) to POV, ini file and bash Translate render properties (Blender and POV native) to POV, ini file and CLI
__------------------Z__ __------------------Z__
_--¨¨] | __ __ _____________|| _--¨¨] | __ __ _____________||
_-¨7____/ | | °|° | □□□ □□□ □□□ || _-¨7____/ | | °|° | □□□ □□□ □□□ ||
(===========|=| | |=============|| (===========|=| | |=============||
`-(@)@)--------------------(@)(@)-' `-,_(@)(@)----------------(@)(@)-'
############################################# LAYOUT ############################################## ############################################# LAYOUT ##############################################
scenography_properties.py scenography_properties.py
...@@ -49,7 +49,7 @@ scenography.py ...@@ -49,7 +49,7 @@ scenography.py
_--¨¨] | __ __ _____________|||____________________| _--¨¨] | __ __ _____________|||____________________|
_-¨7____/ | | °|° | □□□ □□□ □□□ ||| □□□ □□□ □□□ □□□ □□ | _-¨7____/ | | °|° | □□□ □□□ □□□ ||| □□□ □□□ □□□ □□□ □□ |
(===========|=| | |=============|||====================| (===========|=| | |=============|||====================|
`-(@)@)--------------------(@)(@)-^-(@)(@)--------(@)(@)- `-,_(@)(@)----------------(@)(@)-'^-(@)(@)--------(@)(@)'
############################################### MODEL ############################################# ############################################### MODEL #############################################
model_properties.py : model_properties.py :
...@@ -80,7 +80,7 @@ model_primitives_topology.py : ...@@ -80,7 +80,7 @@ model_primitives_topology.py :
_--¨¨] | __ __ _____________|||____________________|||____________________ _--¨¨] | __ __ _____________|||____________________|||____________________
_-¨7____/ | | °|° | □□□ □□□ □□□ ||| □□□ □□□ □□□ □□□ □□ ||| □□□ □□□ □□□ □□□ □□ _-¨7____/ | | °|° | □□□ □□□ □□□ ||| □□□ □□□ □□□ □□□ □□ ||| □□□ □□□ □□□ □□□ □□
(===========|=| | |=============|||====================|||==================== (===========|=| | |=============|||====================|||====================
`-(@)@)--------------------(@)(@)-^-(@)(@)--------(@)(@)-^-(@)(@)--------(@)(@) `-,_(@)(@)----------------(@)(@)-'^-(@)(@)--------(@)(@)-^-(@)(@)--------(@)(@)
############################################ SHADING ############################################# ############################################ SHADING #############################################
shading_properties.py : shading_properties.py :
...@@ -111,7 +111,7 @@ texturing_procedural.py : ...@@ -111,7 +111,7 @@ texturing_procedural.py :
_--¨¨] | __ __ _____________|||____________________|||____________________|||________________ _--¨¨] | __ __ _____________|||____________________|||____________________|||________________
_-¨7____/ | | °|° | □□□ □□□ □□□ ||| □□□ □□□ □□□ □□□ □□ ||| □□□ □□□ □□□ □□□ □□ ||| □□□ □□□ □□□ □□□ _-¨7____/ | | °|° | □□□ □□□ □□□ ||| □□□ □□□ □□□ □□□ □□ ||| □□□ □□□ □□□ □□□ □□ ||| □□□ □□□ □□□ □□□
(===========|=| | |=============|||====================|||====================|||================ (===========|=| | |=============|||====================|||====================|||================
`-(@)@)--------------------(@)(@)-^-(@)(@)--------(@)(@)-^-(@)(@)--------(@)(@)-^-(@)(@)---------- `-,_(@)(@)----------------(@)(@)-'^-(@)(@)--------(@)(@)-^-(@)(@)--------(@)(@)-^-(@)(@)----------
############################################ VFX/TECH ############################################# ############################################ VFX/TECH #############################################
particles_properties.py : particles_properties.py :
......
...@@ -351,14 +351,13 @@ def objects_loop( ...@@ -351,14 +351,13 @@ def objects_loop(
% povdataname, % povdataname,
) )
continue # Don't render empty object but this is later addition, watch it. continue # Don't render empty object but this is later addition, watch it.
if mesh_eval_exported := model_poly_topology.export_mesh(file, ob, povdataname, if ob.pov.object_as:
pass
else:
model_poly_topology.export_mesh(file, ob, povdataname,
material_names_dictionary, material_names_dictionary,
unpacked_images, unpacked_images,
tab_level, tab_write, linebreaksinlists): tab_level, tab_write, linebreaksinlists)
pass # XXX Caution pass may write both proxy mesh and primitive, so propagate a test
# for non mesh_eval_exported or switch back other primitives before meshes
else:
continue
# ------------ Povray Primitives ------------ # # ------------ Povray Primitives ------------ #
# Also implicit elif (continue) clauses and sorted after mesh # Also implicit elif (continue) clauses and sorted after mesh
......
...@@ -126,6 +126,7 @@ class POV_OT_plane_add(Operator): ...@@ -126,6 +126,7 @@ class POV_OT_plane_add(Operator):
bpy.ops.object.mode_set(mode="OBJECT") bpy.ops.object.mode_set(mode="OBJECT")
bpy.ops.object.shade_smooth() bpy.ops.object.shade_smooth()
ob.pov.object_as = "PLANE" ob.pov.object_as = "PLANE"
ob.update_tag() # as prop set via python not updated in depsgraph
return {"FINISHED"} return {"FINISHED"}
...@@ -154,6 +155,7 @@ class POV_OT_box_add(Operator): ...@@ -154,6 +155,7 @@ class POV_OT_box_add(Operator):
bpy.ops.mesh.hide(unselected=False) bpy.ops.mesh.hide(unselected=False)
bpy.ops.object.mode_set(mode="OBJECT") bpy.ops.object.mode_set(mode="OBJECT")
ob.pov.object_as = "BOX" ob.pov.object_as = "BOX"
ob.update_tag() # as prop set via python not updated in depsgraph
return {"FINISHED"} return {"FINISHED"}
...@@ -180,6 +182,7 @@ def pov_cylinder_define(context, op, ob, radius, loc, loc_cap): ...@@ -180,6 +182,7 @@ def pov_cylinder_define(context, op, ob, radius, loc, loc_cap):
ob.pov.cylinder_location_cap = vec ob.pov.cylinder_location_cap = vec
ob.data.use_auto_smooth = True ob.data.use_auto_smooth = True
ob.pov.object_as = "CYLINDER" ob.pov.object_as = "CYLINDER"
ob.update_tag() # as prop set via python not updated in depsgraph
else: else:
ob.location = loc ob.location = loc
...@@ -326,6 +329,7 @@ def pov_sphere_define(context, op, ob, loc): ...@@ -326,6 +329,7 @@ def pov_sphere_define(context, op, ob, loc):
ob.data.use_auto_smooth = True ob.data.use_auto_smooth = True
bpy.ops.object.shade_smooth() bpy.ops.object.shade_smooth()
ob.pov.object_as = "SPHERE" ob.pov.object_as = "SPHERE"
ob.update_tag() # as prop set via python not updated in depsgraph
class POV_OT_sphere_add(Operator): class POV_OT_sphere_add(Operator):
...@@ -379,6 +383,7 @@ class POV_OT_sphere_add(Operator): ...@@ -379,6 +383,7 @@ class POV_OT_sphere_add(Operator):
# bpy.ops.object.mode_set(mode="OBJECT") # bpy.ops.object.mode_set(mode="OBJECT")
# bpy.ops.object.shade_smooth() # bpy.ops.object.shade_smooth()
# ob.pov.object_as = "SPHERE" # ob.pov.object_as = "SPHERE"
# ob.update_tag() # as prop set via python not updated in depsgraph
# ob.name = ob.data.name = 'PovSphere' # ob.name = ob.data.name = 'PovSphere'
# return {'FINISHED'} # return {'FINISHED'}
...@@ -469,6 +474,7 @@ def pov_cone_define(context, op, ob): ...@@ -469,6 +474,7 @@ def pov_cone_define(context, op, ob):
ob.data.use_auto_smooth = True ob.data.use_auto_smooth = True
bpy.ops.object.shade_smooth() bpy.ops.object.shade_smooth()
ob.pov.object_as = "CONE" ob.pov.object_as = "CONE"
ob.update_tag() # as prop set via python not updated in depsgraph
class POV_OT_cone_add(Operator): class POV_OT_cone_add(Operator):
"""Add the representation of POV cone using pov_cone_define() function.""" """Add the representation of POV cone using pov_cone_define() function."""
...@@ -584,6 +590,7 @@ class POV_OT_rainbow_add(Operator): ...@@ -584,6 +590,7 @@ class POV_OT_rainbow_add(Operator):
ob.data.energy = 0 ob.data.energy = 0
ob.name = ob.data.name = "PovRainbow" ob.name = ob.data.name = "PovRainbow"
ob.pov.object_as = "RAINBOW" ob.pov.object_as = "RAINBOW"
ob.update_tag() # as prop set via python not updated in depsgraph
# obj = context.object # obj = context.object
bpy.ops.object.constraint_add(type="DAMPED_TRACK") bpy.ops.object.constraint_add(type="DAMPED_TRACK")
...@@ -656,6 +663,7 @@ def pov_torus_define(context, op, ob): ...@@ -656,6 +663,7 @@ def pov_torus_define(context, op, ob):
ob.data.auto_smooth_angle = 0.6 ob.data.auto_smooth_angle = 0.6
bpy.ops.object.shade_smooth() bpy.ops.object.shade_smooth()
ob.pov.object_as = "TORUS" ob.pov.object_as = "TORUS"
ob.update_tag() # as prop set via python not updated in depsgraph
class POV_OT_torus_add(Operator): class POV_OT_torus_add(Operator):
"""Add the representation of POV torus using using pov_torus_define() function.""" """Add the representation of POV torus using using pov_torus_define() function."""
......
...@@ -56,6 +56,7 @@ class POV_OT_lathe_add(Operator): ...@@ -56,6 +56,7 @@ class POV_OT_lathe_add(Operator):
mod = ob.modifiers[-1] mod = ob.modifiers[-1]
mod.axis = "Y" mod.axis = "Y"
mod.show_render = False mod.show_render = False
ob.update_tag() # as prop set via python not updated in depsgraph
return {"FINISHED"} return {"FINISHED"}
...@@ -173,6 +174,7 @@ def pov_superellipsoid_define(context, op, ob): ...@@ -173,6 +174,7 @@ def pov_superellipsoid_define(context, op, ob):
ob.data.auto_smooth_angle = 1.3 ob.data.auto_smooth_angle = 1.3
bpy.ops.object.shade_smooth() bpy.ops.object.shade_smooth()
ob.pov.object_as = "SUPERELLIPSOID" ob.pov.object_as = "SUPERELLIPSOID"
ob.update_tag() # as prop set via python not updated in depsgraph
class POV_OT_superellipsoid_add(Operator): class POV_OT_superellipsoid_add(Operator):
"""Add the representation of POV superellipsoid using the pov_superellipsoid_define().""" """Add the representation of POV superellipsoid using the pov_superellipsoid_define()."""
...@@ -376,6 +378,7 @@ def pov_supertorus_define(context, op, ob): ...@@ -376,6 +378,7 @@ def pov_supertorus_define(context, op, ob):
ob.pov.st_cross = st_n2 ob.pov.st_cross = st_n2
ob.pov.st_ie = st_ie ob.pov.st_ie = st_ie
ob.pov.st_edit = st_edit ob.pov.st_edit = st_edit
ob.update_tag() # as prop set via python not updated in depsgraph
class POV_OT_supertorus_add(Operator): class POV_OT_supertorus_add(Operator):
...@@ -624,6 +627,7 @@ def pov_isosurface_view_define(context, op, ob, loc): ...@@ -624,6 +627,7 @@ def pov_isosurface_view_define(context, op, ob, loc):
ob.pov.isosurface_eq = eq ob.pov.isosurface_eq = eq
ob.pov.contained_by = "box" ob.pov.contained_by = "box"
bpy.ops.object.mode_set(mode="OBJECT") bpy.ops.object.mode_set(mode="OBJECT")
ob.update_tag() # as prop set via python not updated in depsgraph
class POV_OT_isosurface_add(Operator): class POV_OT_isosurface_add(Operator):
...@@ -722,6 +726,7 @@ class POV_OT_isosurface_box_add(Operator): ...@@ -722,6 +726,7 @@ class POV_OT_isosurface_box_add(Operator):
ob.pov.object_as = "ISOSURFACE_NODE" ob.pov.object_as = "ISOSURFACE_NODE"
ob.pov.contained_by = "box" ob.pov.contained_by = "box"
ob.name = "PovIsosurfaceBox" ob.name = "PovIsosurfaceBox"
ob.update_tag() # as prop set via python not updated in depsgraph
return {"FINISHED"} return {"FINISHED"}
...@@ -752,6 +757,7 @@ class POV_OT_isosurface_sphere_add(Operator): ...@@ -752,6 +757,7 @@ class POV_OT_isosurface_sphere_add(Operator):
ob.pov.object_as = "ISOSURFACE_NODE" ob.pov.object_as = "ISOSURFACE_NODE"
ob.pov.contained_by = "sphere" ob.pov.contained_by = "sphere"
ob.name = "PovIsosurfaceSphere" ob.name = "PovIsosurfaceSphere"
ob.update_tag() # as prop set via python not updated in depsgraph
return {"FINISHED"} return {"FINISHED"}
...@@ -960,6 +966,7 @@ class POV_OT_height_field_add(bpy.types.Operator, ImportHelper): ...@@ -960,6 +966,7 @@ class POV_OT_height_field_add(bpy.types.Operator, ImportHelper):
# POV-Ray will soon use only forwards slashes on every OS and already can # POV-Ray will soon use only forwards slashes on every OS and already can
forward_impath = impath.replace(os.sep, "/") forward_impath = impath.replace(os.sep, "/")
ob.pov.hf_filename = forward_impath ob.pov.hf_filename = forward_impath
ob.update_tag() # as prop set via python not updated in depsgraph
return {"FINISHED"} return {"FINISHED"}
...@@ -1047,6 +1054,8 @@ def pov_parametric_define(context, op, ob): ...@@ -1047,6 +1054,8 @@ def pov_parametric_define(context, op, ob):
ob.data.auto_smooth_angle = 0.6 ob.data.auto_smooth_angle = 0.6
bpy.ops.object.shade_smooth() bpy.ops.object.shade_smooth()
ob.pov.object_as = "PARAMETRIC" ob.pov.object_as = "PARAMETRIC"
ob.update_tag() # as prop set via python not updated in depsgraph
return{'FINISHED'}
class POV_OT_parametric_add(Operator): class POV_OT_parametric_add(Operator):
"""Add the representation of POV parametric surfaces using pov_parametric_define() function.""" """Add the representation of POV parametric surfaces using pov_parametric_define() function."""
...@@ -1174,6 +1183,7 @@ class POV_OT_polygon_to_circle_add(Operator): ...@@ -1174,6 +1183,7 @@ class POV_OT_polygon_to_circle_add(Operator):
#ob.data.auto_smooth_angle = 0.1 #ob.data.auto_smooth_angle = 0.1
#bpy.ops.object.shade_smooth() #bpy.ops.object.shade_smooth()
ob.pov.object_as = "POLYCIRCLE" ob.pov.object_as = "POLYCIRCLE"
ob.update_tag() # as prop set via python not updated in depsgraph
return {"FINISHED"} return {"FINISHED"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment