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
as possible :
___init__.py :
Initialize variables
Update new variables to values from older API. This file needs an update.
ui.py :
Provide property buttons for the user to set up the variables.
primitives.py :
Display some POV native primitives in 3D view for input and output.
shading.py
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.
presets :
Material (sss)
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_(5400K)_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 ;
22_(30000K)_40W_Black_Light_Fluorescent.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",
}
importlib.reload(ui)
importlib.reload(render)
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
StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
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("-", "")
def active_texture_name_from_uilist(self, context):
mat = context.scene.view_layers["View Layer"].objects.active.active_material
index = mat.pov.active_texture_index
name = mat.pov_texture_slots[index].name
newname = mat.pov_texture_slots[index].texture
tex = bpy.data.textures[name]
tex.name = newname
mat.pov_texture_slots[index].name = newname
def active_texture_name_from_search(self, context):
mat = context.scene.view_layers["View Layer"].objects.active.active_material
index = mat.pov.active_texture_index
name = mat.pov_texture_slots[index].texture_search
try:
tex = bpy.data.textures[name]
mat.pov_texture_slots[index].name = name
mat.pov_texture_slots[index].texture = name
except:
pass
Bastien Montagne
committed
###############################################################################
# Scene POV properties.
###############################################################################
class RenderPovSettingsScene(PropertyGroup):
"""Declare scene level properties controllable in UI and translated to POV."""
name="Enable SDL window",
description="Enable the SDL window in Linux OS",
default=True,
)
name="Text Scene Name",
description="Name of POV scene to use. "
"Set when clicking Run to render current text only",
maxlen=1024,
)
name="Enable Tempfiles",
description="Enable the OS-Tempfiles. Otherwise set the path where"
name="POV editor",
description="Don't Close POV editor after rendering (Overridden"
deletefiles_enable: BoolProperty(
Loading
Loading full blame...