Newer
Older
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
"""Import, export and render to POV engines.
These engines can be POV-Ray or Uberpov but others too, since POV is a
Scene Description Language. The script has been split in as few files
Update new variables to values from older API. This file needs an update
Provide property buttons for the user to set up the variables
Display some POV native primitives in 3D view for input and output
Translate shading properties to declared textures at the top of a pov file
nodes.py
Translate node trees to the pov file
render.py :
Translate geometry and UI properties (Blender and POV native) to the POV file
Along these essential files also coexist a few additional libraries to help make
Blender stand up to other POV IDEs such as povwin or QTPOV
apple.py ; chicken.py ; cream.py ; Ketchup.py ; marble.py ;
potato.py ; skim_milk.py ; skin1.py ; skin2.py ; whole_milk.py
Radiosity
01_Debug.py ; 02_Fast.py ; 03_Normal.py ; 04_Two_Bounces.py ;
05_Final.py ; 06_Outdoor_Low_Quality.py ; 07_Outdoor_High_Quality.py ;
08_Outdoor(Sun)Light.py ; 09_Indoor_Low_Quality.py ;
10_Indoor_High_Quality.py ;
World
01_Clear_Blue_Sky.py ; 02_Partly_Hazy_Sky.py ; 03_Overcast_Sky.py ;
04_Cartoony_Sky.py ; 05_Under_Water.py ;
Light
01_(4800K)_Direct_Sun.py ;
02_(5400K)_High_Noon_Sun.py ;
03_(6000K)_Daylight_Window.py ;
04_(6000K)_2500W_HMI_(Halogen_Metal_Iodide).py ;
05_(4000K)_100W_Metal_Halide.py ;
06_(3200K)_100W_Quartz_Halogen.py ;
07_(2850K)_100w_Tungsten.py ;
08_(2600K)_40w_Tungsten.py ;
09_(5000K)_75W_Full_Spectrum_Fluorescent_T12.py ;
10_(4300K)_40W_Vintage_Fluorescent_T12.py ;
11_(5000K)_18W_Standard_Fluorescent_T8 ;
12_(4200K)_18W_Cool_White_Fluorescent_T8.py ;
14_(6500K)_54W_Grow_Light_Fluorescent_T5-HO.py ;
15_(3200K)_40W_Induction_Fluorescent.py ;
16_(2100K)_150W_High_Pressure_Sodium.py ;
17_(1700K)_135W_Low_Pressure_Sodium.py ;
18_(6800K)_175W_Mercury_Vapor.py ;
19_(5200K)_700W_Carbon_Arc.py ;
20_(6500K)_15W_LED_Spot.py ;
21_(2700K)_7W_OLED_Panel.py ;
23_(30000K)_40W_Black_Light_Bulb.py;
24_(1850K)_Candle.py
templates:
abyss.pov ; biscuit.pov ; bsp_Tango.pov ; chess2.pov ;
cornell.pov ; diffract.pov ; diffuse_back.pov ; float5 ;
gamma_showcase.pov ; grenadine.pov ; isocacti.pov ;
mediasky.pov ; patio-radio.pov ; subsurface.pov ; wallstucco.pov
"""
"name": "Persistence of Vision",
"author": "Campbell Barton, "
"Maurice Raybaud, "
"Leonid Desyatkov, "
"Bastien Montagne, "
"Constantin Rahn, "
"Silvio Falcinelli",
"location": "Render Properties > Render Engine > Persistence of Vision",
"description": "Persistence of Vision integration for blender",
"doc_url": "{BLENDER_MANUAL_URL}/addons/render/povray.html",
"category": "Render",
"warning": "Under active development, seeking co-maintainer(s)",
importlib.reload(render)
importlib.reload(primitives)
importlib.reload(update_files)
from bpy.utils import register_class, unregister_class
# import addon_utils # To use some other addons
import nodeitems_utils # for Nodes
from nodeitems_utils import NodeCategory, NodeItem # for Nodes
from bl_operators.presets import AddPresetBase
from bpy.types import (
AddonPreferences,
PropertyGroup,
NodeSocket,
)
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
EnumProperty,
PointerProperty,
CollectionProperty,
)
from . import ui, render, update_files
CoDEmanX
committed
def string_strip_hyphen(name):
"""Remove hyphen characters from a string to avoid POV errors"""
return name.replace("-", "")
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
def pov_context_tex_datablock(context):
"""Texture context type recreated as deprecated in blender 2.8"""
idblock = context.brush
if idblock and context.scene.texture_context == 'OTHER':
return idblock
# idblock = bpy.context.active_object.active_material
idblock = context.view_layer.objects.active.active_material
if idblock and context.scene.texture_context == 'MATERIAL':
return idblock
idblock = context.world
if idblock and context.scene.texture_context == 'WORLD':
return idblock
idblock = context.light
if idblock and context.scene.texture_context == 'LIGHT':
return idblock
if context.particle_system and context.scene.texture_context == 'PARTICLES':
idblock = context.particle_system.settings
return idblock
idblock = context.line_style
if idblock and context.scene.texture_context == 'LINESTYLE':
return idblock
def brush_texture_update(self, context):
"""Brush texture rolldown must show active slot texture props"""
idblock = pov_context_tex_datablock(context)
if idblock is not None:
#mat = context.view_layer.objects.active.active_material
idblock = pov_context_tex_datablock(context)
slot = idblock.pov_texture_slots[idblock.pov.active_texture_index]
tex = slot.texture
if tex:
# Switch paint brush to active texture so slot and settings remain contextual
bpy.context.tool_settings.image_paint.brush.texture = bpy.data.textures[tex]
bpy.context.tool_settings.image_paint.brush.mask_texture = bpy.data.textures[tex]
Loading
Loading full blame...