Merge from trunk -r 24182:24247. Skipped change 24182 (merge of this branch into trunk).

This commit is contained in:
Arystanbek Dyussenov
2009-11-02 17:35:23 +00:00
183 changed files with 37969 additions and 30114 deletions

View File

@@ -91,7 +91,7 @@ IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")
ENDIF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
IF (WITH_OPENCOLLADA)
IF (WITH_OPENCOLLADA AND NOT APPLE)
SET(OPENCOLLADA /usr/local/opencollada CACHE FILEPATH "OpenCollada Directory")
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA})
SET(OPENCOLLADA_LIB OpenCollada)
@@ -101,8 +101,7 @@ SET(PCRE_LIB pcre)
SET(EXPAT /usr CACHE FILEPATH "Expat Directory")
SET(EXPAT_LIBPATH ${EXPAT}/lib)
SET(EXPAT_LIB expat)
ENDIF (WITH_OPENCOLLADA)
ENDIF (WITH_OPENCOLLADA AND NOT APPLE)
# For alternate Python locations the commandline can be used to override detected/default cache settings, e.g:
# On Unix:
@@ -517,12 +516,28 @@ IF(APPLE)
SET(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
SET(PLATFORM_LINKFLAGS "-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime")
ENDIF (WITH_COCOA)
IF(WITH_OPENMP)
SET(LLIBS "${LLIBS} -lgomp ")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp ")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp ")
ENDIF(WITH_OPENMP)
IF (WITH_OPENCOLLADA)
SET(OPENCOLLADA ${LIBDIR}/opencollada)
SET(OPENCOLLADA_INC ${OPENCOLLADA}/include)
SET(OPENCOLLADA_LIBPATH ${OPENCOLLADA}/lib)
SET(OPENCOLLADA_LIB "OpenCOLLADASaxFrameworkLoader -lOpenCOLLADAFramework -lOpenCOLLADABaseUtils -lOpenCOLLADAStreamWriter -lMathMLSolver -lGeneratedSaxParser -lUTF -lxml2" )
#pcre is bundled with openCollada
#SET(PCRE ${LIBDIR}/pcre)
#SET(PCRE_LIBPATH ${PCRE}/lib)
SET(PCRE_LIB pcre)
#native OSX libxml2 is used
#SET(EXPAT ${LIBDIR}/expat)
#SET(EXPAT_LIBPATH ${EXPAT}/lib)
#SET(EXPAT_LIB expat)
ENDIF (WITH_OPENCOLLADA)
SET(SDL ${LIBDIR}/sdl)
SET(SDL_INCLUDE_DIR ${SDL}/include)
SET(SDL_LIBRARY SDL)

View File

@@ -246,6 +246,9 @@ BF_OPENGL_LIB = 'GL GLU'
BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
#OpenCollada flags
WITH_BF_COLLADA = False
#############################################################################
################### various compile settings and flags ##################
#############################################################################

View File

@@ -126,6 +126,10 @@ BF_OPENGL_LIB = 'opengl32 glu32'
BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a',
'${BF_OPENGL}/lib/libXmu.a', '${BF_OPENGL}/lib/libXext.a',
'${BF_OPENGL}/lib/libX11.a', '${BF_OPENGL}/lib/libXi.a' ]
# Disable Collada by default
WITH_BF_COLLADA = False
##
CC = 'gcc'
CXX = 'g++'

View File

@@ -145,7 +145,7 @@ BF_COLLADA_LIB = 'bf_collada'
BF_OPENCOLLADA = LIBDIR + '/opencollada'
BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
BF_OPENCOLLADA_LIB = 'opencollada'
BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver xml2 pcre'
BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
WITH_BF_STATICOPENGL = False

View File

@@ -10,15 +10,6 @@ sources = env.Glob('intern/*.cpp')
if window_system == 'darwin':
sources += env.Glob('intern/*.mm')
#if env['WITH_GHOST_COCOA'] == True:
# env.Append(CFLAGS=['-DGHOST_COCOA'])
# env.Append(CXXFLAGS=['-DGHOST_COCOA'])
# env.Append(CPPFLAGS=['-DGHOST_COCOA'])
#defs = ''
#if env['WITH_GHOST_COCOA']:
# defs += 'GHOST_COCOA'
# maybe we need it later
pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_Window']

View File

@@ -7,6 +7,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
{6E24BF09-9653-4166-A871-F65CC9E98A9B} = {6E24BF09-9653-4166-A871-F65CC9E98A9B}
{A90C4918-4B21-4277-93BD-AF65F30951D9} = {A90C4918-4B21-4277-93BD-AF65F30951D9}
{FB88301F-F725-401B-ACD7-D2ABBF333B71} = {FB88301F-F725-401B-ACD7-D2ABBF333B71}
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2} = {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}
{BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE} = {BAAE3F2B-BCF8-4E84-B8BA-CFB2D64945FE}
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
{D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}
@@ -294,6 +295,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_build_install_all", "..
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WM_windowmanager", "windowmanager\windowmanager.vcproj", "{884D8731-654C-4C7F-9A75-8F37A305BE1E}"
ProjectSection(ProjectDependencies) = postProject
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2} = {76D3102B-7DD2-8BA1-034A-8B19FE2897C2}
{DFE7F3E3-E62A-4677-B666-DF0DDF70C359} = {DFE7F3E3-E62A-4677-B666-DF0DDF70C359}
EndProjectSection
EndProject
@@ -332,6 +334,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzo", "..\..\extern\lzo
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BRE_raytrace", "render\BRE_raytrace.vcproj", "{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BF_collada", "collada\BF_collada.vcproj", "{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3D Plugin Debug|Win32 = 3D Plugin Debug|Win32
@@ -1569,6 +1573,26 @@ Global
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Debug|Win32.Build.0 = Blender Debug|Win32
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Release|Win32.ActiveCfg = Blender Release|Win32
{37DB6A34-2E91-4ADB-BC1A-02F6D0A5E2F1}.Release|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Debug|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Debug|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Release|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3D Plugin Release|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Debug|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Debug|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Release|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.3DPlugin Release|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Blender Release|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Debug|Win32.ActiveCfg = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Debug|Win32.Build.0 = Blender Debug|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Release|Win32.ActiveCfg = Blender Release|Win32
{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}.Release|Win32.Build.0 = Blender Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -74,12 +74,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib"
AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half.lib Iex.lib IlmImf.lib Imath.lib IlmThread.lib avcodec-52.lib avformat-52.lib avutil-50.lib swscale-0.lib avdevice-52.lib libsndfile-1.lib opencollada.lib"
ShowProgress="0"
OutputFile="..\..\..\install\msvc_9\blender.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\build\msvc_9\libs\intern;..\..\..\build\msvc_9\libs\extern;..\..\..\lib\windows\ffmpeg\lib;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib"
AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\build\msvc_9\libs\intern;..\..\..\build\msvc_9\libs\extern;..\..\..\lib\windows\ffmpeg\lib;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib;..\..\..\lib\windows\opencollada\lib"
IgnoreAllDefaultLibraries="false"
IgnoreDefaultLibraryNames="msvcprt.lib;glut32.lib;libc.lib;libcd.lib;libcpd.lib;libcp.lib;libcmtd.lib;odbc32.lib;odbccp32.lib"
GenerateDebugInformation="true"
@@ -169,12 +169,12 @@
<Tool
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386&#x0D;&#x0A;"
AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib"
AdditionalDependencies="libsamplerate.lib SDL.lib freetype2ST.lib gnu_gettext.lib qtmlClient.lib OpenAL32.lib wrap_oal.lib ws2_32.lib dxguid.lib opengl32.lib libjpeg.lib glu32.lib vfw32.lib winmm.lib libpng_st.lib zlib.lib python31_d.lib pthreadVSE2.lib pthreadVC2.lib libtiff.lib Half_d.lib Iex_d.lib Imath_d.lib IlmImf_d.lib IlmThread_d.lib avcodec-52.lib avformat-52.lib avdevice-52.lib avutil-50.lib swscale-0.lib libsndfile-1.lib opencollada.lib"
ShowProgress="0"
OutputFile="..\..\..\install\msvc_9d\blender.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\lib\windows\ffmpeg\lib;..\..\..\build\msvc_9\libs\intern\debug;..\..\..\build\msvc_9\libs\extern\debug;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib"
AdditionalLibraryDirectories="..\..\..\lib\windows\sdl\lib;..\..\..\lib\windows\ode\lib;..\..\..\lib\windows\zlib\lib;..\..\..\lib\windows\png\lib;..\..\..\lib\windows\jpeg\lib;..\..\..\lib\windows\pthreads\lib;..\..\..\lib\windows\tiff\lib;..\..\..\lib\windows\gettext\lib;..\..\..\lib\windows\freetype\lib;..\..\..\lib\windows\python\lib;..\..\..\lib\windows\openal\lib;..\..\..\lib\windows\openexr\lib_vs2008;..\..\..\lib\windows\QTDevWin\Libraries;..\..\..\lib\windows\ffmpeg\lib;..\..\..\build\msvc_9\libs\intern\debug;..\..\..\build\msvc_9\libs\extern\debug;..\..\..\lib\windows\samplerate\lib;..\..\..\lib\windows\sndfile\lib;..\..\..\lib\windows\opencollada\lib"
IgnoreDefaultLibraryNames="libc.lib, libcmt.lib, msvcrt.lib, libcd.lib, odbc32.lib, odbccp32.lib"
GenerateDebugInformation="true"
ProgramDatabaseFile="..\..\..\build\msvc_9\libs\debug\blender.pdb"

View File

@@ -0,0 +1,214 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="9,00"
Name="BF_collada"
ProjectGUID="{76D3102B-7DD2-8BA1-034A-8B19FE2897C2}"
RootNamespace="BF_collada"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Blender Debug|Win32"
OutputDirectory="..\..\..\..\build\msvc_9\source\blender\collada\debug"
IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\collada\debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\windowmanager;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\opencollada\include\COLLADAStreamWriter\include;..\..\..\..\lib\windows\opencollada\include\COLLADABaseUtils\include;..\..\..\..\lib\windows\opencollada\include\COLLADAFramework\include;..\..\..\..\lib\windows\opencollada\include\COLLADASaxFrameworkLoader\include"
PreprocessorDefinitions="WIN32,_DEBUG,_LIB"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\collada\debug\BF_collada.pch"
AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\collada\debug\"
ObjectFile="..\..\..\..\build\msvc_9\source\blender\collada\debug\"
ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\collada\debug\"
WarningLevel="2"
SuppressStartupBanner="true"
DebugInformationFormat="3"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1043"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\build\msvc_9\libs\debug\BF_collada.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Blender Release|Win32"
OutputDirectory="..\..\..\..\build\msvc_9\source\blender\collada"
IntermediateDirectory="..\..\..\..\build\msvc_9\source\blender\collada"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\windowmanager;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\opencollada\include\COLLADAStreamWriter\include;..\..\..\..\lib\windows\opencollada\include\COLLADABaseUtils\include;..\..\..\..\lib\windows\opencollada\include\COLLADAFramework\include;..\..\..\..\lib\windows\opencollada\include\COLLADASaxFrameworkLoader\include"
PreprocessorDefinitions="WIN32,NDEBUG,_LIB"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
DefaultCharIsUnsigned="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="..\..\..\..\build\msvc_9\source\blender\yafray\BF_collada.pch"
AssemblerListingLocation="..\..\..\..\build\msvc_9\source\blender\collada\"
ObjectFile="..\..\..\..\build\msvc_9\source\blender\collada\"
ProgramDataBaseFileName="..\..\..\..\build\msvc_9\source\blender\collada\"
WarningLevel="2"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1043"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile="..\..\..\..\build\msvc_9\libs\BF_collada.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="..\..\..\source\blender\collada\collada.cpp"
>
</File>
<File
RelativePath="..\..\..\source\blender\collada\DocumentExporter.cpp"
>
</File>
<File
RelativePath="..\..\..\source\blender\collada\DocumentImporter.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="..\..\..\source\blender\collada\collada.h"
>
</File>
<File
RelativePath="..\..\..\source\blender\collada\collada_internal.h"
>
</File>
<File
RelativePath="..\..\..\source\blender\collada\DocumentExporter.h"
>
</File>
<File
RelativePath="..\..\..\source\blender\collada\DocumentImporter.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -43,8 +43,8 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\collada"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;WITH_COLLADA"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -113,8 +113,8 @@
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS"
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\source\blender\blenlib;..\..\..\source\blender\imbuf;..\..\..\source\blender\python;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\blenloader;..\..\..\source\blender\gpu;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\kernel\gen_system;..\..\..\source\kernel\gen_messaging;..\..\..\source\blender\windowmanager;..\..\..\source\blender\editors\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\blender\collada"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;WITH_COLLADA"
MinimalRebuild="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="false"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 190 KiB

View File

@@ -27,23 +27,23 @@
import sys, os
if len(sys.argv) < 2:
sys.stdout.write("Usage: datatoc <data_file>\n")
sys.exit(1)
sys.stdout.write("Usage: datatoc <data_file>\n")
sys.exit(1)
filename = sys.argv[1]
try:
fpin = open(filename, "rb");
fpin = open(filename, "rb");
except:
sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
sys.exit(1)
sys.stdout.write("Unable to open input %s\n" % sys.argv[1])
sys.exit(1)
fpin.seek(0, os.SEEK_END)
size = fpin.tell()
fpin.seek(0)
if filename[0] == ".":
filename = filename[1:]
filename = filename[1:]
cname = filename + ".c"
sys.stdout.write("Making C file <%s>\n" % cname)
@@ -52,10 +52,10 @@ filename = filename.replace(".", "_")
sys.stdout.write(str(size))
sys.stdout.write("\n")
try:
fpout = open(cname, "w")
fpout = open(cname, "w")
except:
sys.stdout.write("Unable to open output %s\n" % cname)
sys.exit(1)
sys.stdout.write("Unable to open output %s\n" % cname)
sys.exit(1)
fpout.write("/* DataToC output of file <%s> */\n\n" % filename)
fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
@@ -63,11 +63,11 @@ fpout.write("int datatoc_%s_size= %d;\n" % (filename, size))
fpout.write("char datatoc_%s[]= {\n" % filename)
while size > 0:
size -= 1
if size % 32 == 31:
fpout.write("\n")
fpout.write("%3d," % ord(fpin.read(1)))
size -= 1
if size % 32 == 31:
fpout.write("\n")
fpout.write("%3d," % ord(fpin.read(1)))
fpout.write("\n 0};\n\n")

View File

@@ -1,98 +1,139 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy, Mathutils
from math import cos, sin, pi, radians
# <pep8-80 compliant>
import bpy
import Mathutils
from math import cos, sin, pi
def add_torus(PREF_MAJOR_RAD, PREF_MINOR_RAD, PREF_MAJOR_SEG, PREF_MINOR_SEG):
Vector = Mathutils.Vector
Quaternion = Mathutils.Quaternion
PI_2= pi*2
Z_AXIS = 0,0,1
verts = []
faces = []
i1 = 0
tot_verts = PREF_MAJOR_SEG * PREF_MINOR_SEG
for major_index in range(PREF_MAJOR_SEG):
verts_tmp = []
quat = Quaternion( Z_AXIS, (major_index/PREF_MAJOR_SEG)*PI_2)
def add_torus(major_rad, minor_rad, major_seg, minor_seg):
Vector = Mathutils.Vector
Quaternion = Mathutils.Quaternion
for minor_index in range(PREF_MINOR_SEG):
angle = 2*pi*minor_index/PREF_MINOR_SEG
vec = Vector(PREF_MAJOR_RAD+(cos(angle)*PREF_MINOR_RAD), 0, (sin(angle)*PREF_MINOR_RAD)) * quat
verts.extend([vec.x, vec.y, vec.z])
if minor_index+1==PREF_MINOR_SEG:
i2 = (major_index)*PREF_MINOR_SEG
i3 = i1 + PREF_MINOR_SEG
i4 = i2 + PREF_MINOR_SEG
else:
i2 = i1 + 1
i3 = i1 + PREF_MINOR_SEG
i4 = i3 + 1
if i2>=tot_verts: i2 = i2-tot_verts
if i3>=tot_verts: i3 = i3-tot_verts
if i4>=tot_verts: i4 = i4-tot_verts
# stupid eekadoodle
if i2: faces.extend( [i1,i3,i4,i2] )
else: faces.extend( [i2,i1,i3,i4] )
i1+=1
return verts, faces
PI_2 = pi * 2
z_axis = (0, 0, 1)
verts = []
faces = []
i1 = 0
tot_verts = major_seg * minor_seg
for major_index in range(major_seg):
quat = Quaternion(z_axis, (major_index / major_seg) * PI_2)
for minor_index in range(minor_seg):
angle = 2 * pi * minor_index / minor_seg
vec = Vector(major_rad + (cos(angle) * minor_rad), 0.0,
(sin(angle) * minor_rad)) * quat
verts.extend([vec.x, vec.y, vec.z])
if minor_index + 1 == minor_seg:
i2 = (major_index) * minor_seg
i3 = i1 + minor_seg
i4 = i2 + minor_seg
else:
i2 = i1 + 1
i3 = i1 + minor_seg
i4 = i3 + 1
if i2 >= tot_verts:
i2 = i2 - tot_verts
if i3 >= tot_verts:
i3 = i3 - tot_verts
if i4 >= tot_verts:
i4 = i4 - tot_verts
# stupid eekadoodle
if i2:
faces.extend([i1, i3, i4, i2])
else:
faces.extend([i2, i1, i3, i4])
i1 += 1
return verts, faces
from bpy.props import *
class MESH_OT_primitive_torus_add(bpy.types.Operator):
'''Add a torus mesh.'''
__idname__ = "mesh.primitive_torus_add"
__label__ = "Add Torus"
__register__ = True
__undo__ = True
__props__ = [
bpy.props.FloatProperty(attr="major_radius", name="Major Radius", description="Number of segments for the main ring of the torus", default= 1.0, min= 0.01, max= 100.0),
bpy.props.FloatProperty(attr="minor_radius", name="Minor Radius", description="Number of segments for the minor ring of the torus", default= 0.25, min= 0.01, max= 100.0),
bpy.props.IntProperty(attr="major_segments", name="Major Segments", description="Number of segments for the main ring of the torus", default= 48, min= 3, max= 256),
bpy.props.IntProperty(attr="minor_segments", name="Minor Segments", description="Number of segments for the minor ring of the torus", default= 16, min= 3, max= 256),
]
def execute(self, context):
verts_loc, faces = add_torus(self.major_radius, self.minor_radius, self.major_segments, self.minor_segments)
me= bpy.data.add_mesh("Torus")
me.add_geometry(int(len(verts_loc)/3), 0, int(len(faces)/4))
me.verts.foreach_set("co", verts_loc)
me.faces.foreach_set("verts_raw", faces)
sce = context.scene
# ugh
for ob in sce.objects:
ob.selected = False
me.update()
ob= bpy.data.add_object('MESH', "Torus")
ob.data= me
context.scene.add_object(ob)
context.scene.active_object = ob
ob.selected = True
ob.location = tuple(context.scene.cursor_location)
return ('FINISHED',)
class AddTorusPrimitive(bpy.types.Operator):
'''Add a torus mesh.'''
bl_idname = "mesh.primitive_torus_add"
bl_label = "Add Torus"
bl_register = True
bl_undo = True
major_radius = FloatProperty(name="Major Radius",
description="Number of segments for the main ring of the torus",
default=1.0, min=0.01, max=100.0)
minor_radius = FloatProperty(name="Minor Radius",
description="Number of segments for the minor ring of the torus",
default=0.25, min=0.01, max=100.0)
major_segments = IntProperty(name="Major Segments",
description="Number of segments for the main ring of the torus",
default=48, min=3, max=256)
minor_segments = IntProperty(name="Minor Segments",
description="Number of segments for the minor ring of the torus",
default=16, min=3, max=256)
def execute(self, context):
verts_loc, faces = add_torus(self.major_radius,
self.minor_radius,
self.major_segments,
self.minor_segments)
mesh = bpy.data.add_mesh("Torus")
mesh.add_geometry(int(len(verts_loc) / 3), 0, int(len(faces) / 4))
mesh.verts.foreach_set("co", verts_loc)
mesh.faces.foreach_set("verts_raw", faces)
scene = context.scene
# ugh
for ob in scene.objects:
ob.selected = False
mesh.update()
ob_new = bpy.data.add_object('MESH', "Torus")
ob_new.data = mesh
scene.add_object(ob_new)
scene.active_object = ob_new
ob_new.selected = True
ob_new.location = tuple(context.scene.cursor_location)
return ('FINISHED',)
# Register the operator
bpy.ops.add(MESH_OT_primitive_torus_add)
bpy.ops.add(AddTorusPrimitive)
# Add to a menu
import dynamic_menu
import space_info
menu_item = dynamic_menu.add(bpy.types.INFO_MT_mesh_add, (lambda self, context: self.layout.itemO("mesh.primitive_torus_add", text="Torus", icon='ICON_MESH_DONUT')) )
menu_func = (lambda self, context: self.layout.itemO("mesh.primitive_torus_add",
text="Torus", icon='ICON_MESH_DONUT'))
menu_item = dynamic_menu.add(bpy.types.INFO_MT_mesh_add, menu_func)
if __name__ == "__main__":
bpy.ops.mesh.primitive_torus_add()
bpy.ops.mesh.primitive_torus_add()

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
from math import atan, pi, degrees
@@ -697,8 +715,8 @@ IntProperty( attr="pov_radio_recursion_limit",
class PovrayRender(bpy.types.RenderEngine):
__idname__ = 'POVRAY_RENDER'
__label__ = "Povray"
bl_idname = 'POVRAY_RENDER'
bl_label = "Povray"
DELAY = 0.02
def _export(self, scene):
@@ -826,33 +844,33 @@ class PovrayRender(bpy.types.RenderEngine):
bpy.types.register(PovrayRender)
# Use some of the existing buttons.
import buttons_render
buttons_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
buttons_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('POVRAY_RENDER')
buttons_render.RENDER_PT_antialiasing.COMPAT_ENGINES.add('POVRAY_RENDER')
buttons_render.RENDER_PT_output.COMPAT_ENGINES.add('POVRAY_RENDER')
del buttons_render
import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_render.RENDER_PT_antialiasing.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_render.RENDER_PT_output.COMPAT_ENGINES.add('POVRAY_RENDER')
del properties_render
# Use only a subset of the world panels
import buttons_world
buttons_world.WORLD_PT_preview.COMPAT_ENGINES.add('POVRAY_RENDER')
buttons_world.WORLD_PT_context_world.COMPAT_ENGINES.add('POVRAY_RENDER')
buttons_world.WORLD_PT_world.COMPAT_ENGINES.add('POVRAY_RENDER')
buttons_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')
del buttons_world
import properties_world
properties_world.WORLD_PT_preview.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_world.WORLD_PT_context_world.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_world.WORLD_PT_world.COMPAT_ENGINES.add('POVRAY_RENDER')
properties_world.WORLD_PT_mist.COMPAT_ENGINES.add('POVRAY_RENDER')
del properties_world
# Example of wrapping every class 'as is'
import buttons_material
for member in dir(buttons_material):
subclass = getattr(buttons_material, member)
import properties_material
for member in dir(properties_material):
subclass = getattr(properties_material, member)
try: subclass.COMPAT_ENGINES.add('POVRAY_RENDER')
except: pass
del buttons_material
del properties_material
class RenderButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "render"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
@@ -860,7 +878,7 @@ class RenderButtonsPanel(bpy.types.Panel):
return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
class RENDER_PT_povray_radiosity(RenderButtonsPanel):
__label__ = "Radiosity"
bl_label = "Radiosity"
COMPAT_ENGINES = set(['POVRAY_RENDER'])
def draw_header(self, context):

View File

@@ -1,4 +1,22 @@
# coding: utf-8
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
__author__ = ["Campbell Barton", "Bob Holcomb", "Richard Lärkäng", "Damien McGinnes", "Mark Stijnman"]
__url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/")
__version__ = "0.90a"
@@ -1090,19 +1108,19 @@ def save_3ds(filename, context):
# else:
# Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
# # save_3ds('/test_b.3ds')
from bpy.props import *
class EXPORT_OT_autodesk_3ds(bpy.types.Operator):
'''Export to 3DS file format (.3ds).'''
__idname__ = "export.autodesk_3ds"
__label__ = 'Export 3DS'
bl_idname = "export.autodesk_3ds"
bl_label = 'Export 3DS'
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = [
# bpy.props.StringProperty(attr="filename", name="File Name", description="File name used for exporting the 3DS file", maxlen= 1024, default= ""),
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the 3DS file", maxlen= 1024, default= ""),
]
# filename = StringProperty(name="File Name", description="File name used for exporting the 3DS file", maxlen= 1024, default= ""),
path = StringProperty(name="File Path", description="File path used for exporting the 3DS file", maxlen= 1024, default= "")
def execute(self, context):
save_3ds(self.path, context)
@@ -1110,7 +1128,7 @@ class EXPORT_OT_autodesk_3ds(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)
def poll(self, context): # Poll isnt working yet

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
__author__ = "Campbell Barton"
__url__ = ['www.blender.org', 'blenderartists.org']
__version__ = "1.2"
@@ -3332,44 +3350,44 @@ def write_ui():
# GLOBALS.clear()
from bpy.props import *
class EXPORT_OT_fbx(bpy.types.Operator):
'''Selection to an ASCII Autodesk FBX'''
__idname__ = "export.fbx"
__label__ = "Export FBX"
bl_idname = "export.fbx"
bl_label = "Export FBX"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the FBX file", maxlen= 1024, default= ""),
bpy.props.BoolProperty(attr="EXP_OBS_SELECTED", name="Selected Objects", description="Export selected objects on visible layers", default=True),
# bpy.props.BoolProperty(attr="EXP_OBS_SCENE", name="Scene Objects", description="Export all objects in this scene", default=True),
bpy.props.FloatProperty(attr="_SCALE", name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0),
bpy.props.BoolProperty(attr="_XROT90", name="Rot X90", description="Rotate all objects 90 degrese about the X axis", default=True),
bpy.props.BoolProperty(attr="_YROT90", name="Rot Y90", description="Rotate all objects 90 degrese about the Y axis", default=False),
bpy.props.BoolProperty(attr="_ZROT90", name="Rot Z90", description="Rotate all objects 90 degrese about the Z axis", default=False),
bpy.props.BoolProperty(attr="EXP_EMPTY", name="Empties", description="Export empty objects", default=True),
bpy.props.BoolProperty(attr="EXP_CAMERA", name="Cameras", description="Export camera objects", default=True),
bpy.props.BoolProperty(attr="EXP_LAMP", name="Lamps", description="Export lamp objects", default=True),
bpy.props.BoolProperty(attr="EXP_ARMATURE", name="Armatures", description="Export armature objects", default=True),
bpy.props.BoolProperty(attr="EXP_MESH", name="Meshes", description="Export mesh objects", default=True),
bpy.props.BoolProperty(attr="EXP_MESH_APPLY_MOD", name="Modifiers", description="Apply modifiers to mesh objects", default=True),
bpy.props.BoolProperty(attr="EXP_MESH_HQ_NORMALS", name="HQ Normals", description="Generate high quality normals", default=True),
bpy.props.BoolProperty(attr="EXP_IMAGE_COPY", name="Copy Image Files", description="Copy image files to the destination path", default=False),
# armature animation
bpy.props.BoolProperty(attr="ANIM_ENABLE", name="Enable Animation", description="Export keyframe animation", default=True),
bpy.props.BoolProperty(attr="ANIM_OPTIMIZE", name="Optimize Keyframes", description="Remove double keyframes", default=True),
bpy.props.FloatProperty(attr="ANIM_OPTIMIZE_PRECISSION", name="Precision", description="Tolerence for comparing double keyframes (higher for greater accuracy)", min=1, max=16, soft_min=1, soft_max=16, default=6.0),
# bpy.props.BoolProperty(attr="ANIM_ACTION_ALL", name="Current Action", description="Use actions currently applied to the armatures (use scene start/end frame)", default=True),
bpy.props.BoolProperty(attr="ANIM_ACTION_ALL", name="All Actions", description="Use all actions for armatures, if false, use current action", default=False),
# batch
bpy.props.BoolProperty(attr="BATCH_ENABLE", name="Enable Batch", description="Automate exporting multiple scenes or groups to files", default=False),
bpy.props.BoolProperty(attr="BATCH_GROUP", name="Group > File", description="Export each group as an FBX file, if false, export each scene as an FBX file", default=False),
bpy.props.BoolProperty(attr="BATCH_OWN_DIR", name="Own Dir", description="Create a dir for each exported file", default=True),
bpy.props.StringProperty(attr="BATCH_FILE_PREFIX", name="Prefix", description="Prefix each file with this name", maxlen= 1024, default=""),
]
path = StringProperty(name="File Path", description="File path used for exporting the FBX file", maxlen= 1024, default= "")
EXP_OBS_SELECTED = BoolProperty(name="Selected Objects", description="Export selected objects on visible layers", default=True)
# EXP_OBS_SCENE = BoolProperty(name="Scene Objects", description="Export all objects in this scene", default=True)
_SCALE = FloatProperty(name="Scale", description="Scale all data, (Note! some imports dont support scaled armatures)", min=0.01, max=1000.0, soft_min=0.01, soft_max=1000.0, default=1.0)
_XROT90 = BoolProperty(name="Rot X90", description="Rotate all objects 90 degrese about the X axis", default=True)
_YROT90 = BoolProperty(name="Rot Y90", description="Rotate all objects 90 degrese about the Y axis", default=False)
_ZROT90 = BoolProperty(name="Rot Z90", description="Rotate all objects 90 degrese about the Z axis", default=False)
EXP_EMPTY = BoolProperty(name="Empties", description="Export empty objects", default=True)
EXP_CAMERA = BoolProperty(name="Cameras", description="Export camera objects", default=True)
EXP_LAMP = BoolProperty(name="Lamps", description="Export lamp objects", default=True)
EXP_ARMATURE = BoolProperty(name="Armatures", description="Export armature objects", default=True)
EXP_MESH = BoolProperty(name="Meshes", description="Export mesh objects", default=True)
EXP_MESH_APPLY_MOD = BoolProperty(name="Modifiers", description="Apply modifiers to mesh objects", default=True)
EXP_MESH_HQ_NORMALS = BoolProperty(name="HQ Normals", description="Generate high quality normals", default=True)
EXP_IMAGE_COPY = BoolProperty(name="Copy Image Files", description="Copy image files to the destination path", default=False)
# armature animation
ANIM_ENABLE = BoolProperty(name="Enable Animation", description="Export keyframe animation", default=True)
ANIM_OPTIMIZE = BoolProperty(name="Optimize Keyframes", description="Remove double keyframes", default=True)
ANIM_OPTIMIZE_PRECISSION = FloatProperty(name="Precision", description="Tolerence for comparing double keyframes (higher for greater accuracy)", min=1, max=16, soft_min=1, soft_max=16, default=6.0)
# ANIM_ACTION_ALL = BoolProperty(name="Current Action", description="Use actions currently applied to the armatures (use scene start/end frame)", default=True)
ANIM_ACTION_ALL = BoolProperty(name="All Actions", description="Use all actions for armatures, if false, use current action", default=False)
# batch
BATCH_ENABLE = BoolProperty(name="Enable Batch", description="Automate exporting multiple scenes or groups to files", default=False)
BATCH_GROUP = BoolProperty(name="Group > File", description="Export each group as an FBX file, if false, export each scene as an FBX file", default=False)
BATCH_OWN_DIR = BoolProperty(name="Own Dir", description="Create a dir for each exported file", default=True)
BATCH_FILE_PREFIX = StringProperty(name="Prefix", description="Prefix each file with this name", maxlen= 1024, default="")
def poll(self, context):
print("Poll")
@@ -3411,7 +3429,7 @@ class EXPORT_OT_fbx(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)

View File

@@ -1,3 +1,20 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
__author__ = "Bill L.Nieuwendorp"
__bpydoc__ = """\
@@ -133,10 +150,12 @@ def write(filename, sce, ob, PREF_STARTFRAME, PREF_ENDFRAME, PREF_FPS):
"""
sce.set_frame(orig_frame)
from bpy.props import *
class EXPORT_OT_mdd(bpy.types.Operator):
'''Animated mesh to MDD vertex keyframe file.'''
__idname__ = "export.mdd"
__label__ = "Export MDD"
bl_idname = "export.mdd"
bl_label = "Export MDD"
# get first scene to get min and max properties for frames, fps
@@ -148,12 +167,10 @@ class EXPORT_OT_mdd(bpy.types.Operator):
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the MDD file", maxlen= 1024, default= "tmp.mdd"),
bpy.props.IntProperty(attr="fps", name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default= 25),
bpy.props.IntProperty(attr="start_frame", name="Start Frame", description="Start frame for baking", min=minframe,max=maxframe,default=1),
bpy.props.IntProperty(attr="end_frame", name="End Frame", description="End frame for baking", min=minframe, max=maxframe, default= 250),
]
path = StringProperty(name="File Path", description="File path used for exporting the MDD file", maxlen= 1024, default= "tmp.mdd")
fps = IntProperty(name="Frames Per Second", description="Number of frames/second", min=minfps, max=maxfps, default= 25)
start_frame = IntProperty(name="Start Frame", description="Start frame for baking", min=minframe,max=maxframe,default=1)
end_frame = IntProperty(name="End Frame", description="End frame for baking", min=minframe, max=maxframe, default= 250)
def poll(self, context):
return context.active_object != None
@@ -167,7 +184,7 @@ class EXPORT_OT_mdd(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)
bpy.ops.add(EXPORT_OT_mdd)

View File

@@ -1,4 +1,20 @@
#!BPY
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
"""
Name: 'Wavefront (.obj)...'
@@ -913,44 +929,46 @@ Currently the exporter lacks these features:
* multiple scene export (only active scene is written)
* particles
'''
from bpy.props import *
class EXPORT_OT_obj(bpy.types.Operator):
'''Save a Wavefront OBJ File'''
__idname__ = "export.obj"
__label__ = 'Export OBJ'
bl_idname = "export.obj"
bl_label = 'Export OBJ'
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= ""),
path = StringProperty(name="File Path", description="File path used for exporting the OBJ file", maxlen= 1024, default= "")
# context group
bpy.props.BoolProperty(attr="use_selection", name="Selection Only", description="", default= False),
bpy.props.BoolProperty(attr="use_all_scenes", name="All Scenes", description="", default= False),
bpy.props.BoolProperty(attr="use_animation", name="All Animation", description="", default= False),
# context group
use_selection = BoolProperty(name="Selection Only", description="", default= False)
use_all_scenes = BoolProperty(name="All Scenes", description="", default= False)
use_animation = BoolProperty(name="All Animation", description="", default= False)
# object group
bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="", default= True),
bpy.props.BoolProperty(attr="use_rotate90", name="Rotate X90", description="", default= True),
# object group
use_modifiers = BoolProperty(name="Apply Modifiers", description="", default= True)
use_rotate90 = BoolProperty(name="Rotate X90", description="", default= True)
# extra data group
bpy.props.BoolProperty(attr="use_edges", name="Edges", description="", default= True),
bpy.props.BoolProperty(attr="use_normals", name="Normals", description="", default= False),
bpy.props.BoolProperty(attr="use_hq_normals", name="High Quality Normals", description="", default= True),
bpy.props.BoolProperty(attr="use_uvs", name="UVs", description="", default= True),
bpy.props.BoolProperty(attr="use_materials", name="Materials", description="", default= True),
bpy.props.BoolProperty(attr="copy_images", name="Copy Images", description="", default= False),
bpy.props.BoolProperty(attr="use_triangles", name="Triangulate", description="", default= False),
bpy.props.BoolProperty(attr="use_vertex_groups", name="Polygroups", description="", default= False),
bpy.props.BoolProperty(attr="use_nurbs", name="Nurbs", description="", default= False),
# extra data group
use_edges = BoolProperty(name="Edges", description="", default= True)
use_normals = BoolProperty(name="Normals", description="", default= False)
use_hq_normals = BoolProperty(name="High Quality Normals", description="", default= True)
use_uvs = BoolProperty(name="UVs", description="", default= True)
use_materials = BoolProperty(name="Materials", description="", default= True)
copy_images = BoolProperty(name="Copy Images", description="", default= False)
use_triangles = BoolProperty(name="Triangulate", description="", default= False)
use_vertex_groups = BoolProperty(name="Polygroups", description="", default= False)
use_nurbs = BoolProperty(name="Nurbs", description="", default= False)
# grouping group
bpy.props.BoolProperty(attr="use_blen_objects", name="Objects as OBJ Objects", description="", default= True),
bpy.props.BoolProperty(attr="group_by_object", name="Objects as OBJ Groups ", description="", default= False),
bpy.props.BoolProperty(attr="group_by_material", name="Material Groups", description="", default= False),
bpy.props.BoolProperty(attr="keep_vertex_order", name="Keep Vertex Order", description="", default= False)
]
# grouping group
use_blen_objects = BoolProperty(name="Objects as OBJ Objects", description="", default= True)
group_by_object = BoolProperty(name="Objects as OBJ Groups ", description="", default= False)
group_by_material = BoolProperty(name="Material Groups", description="", default= False)
keep_vertex_order = BoolProperty(name="Keep Vertex Order", description="", default= False)
def execute(self, context):
@@ -977,7 +995,7 @@ class EXPORT_OT_obj(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)
def poll(self, context): # Poll isnt working yet

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
__author__ = "Bruce Merry"
@@ -231,21 +249,24 @@ def write(filename, scene, ob, \
Blender.Window.EditMode(1, '', 0)
"""
from bpy.props import *
class EXPORT_OT_ply(bpy.types.Operator):
'''Export a single object as a stanford PLY with normals, colours and texture coordinates.'''
__idname__ = "export.ply"
__label__ = "Export PLY"
bl_idname = "export.ply"
bl_label = "Export PLY"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""),
bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True),
bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True),
bpy.props.BoolProperty(attr="use_colors", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
]
path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
use_modifiers = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
use_normals = BoolProperty(name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True)
use_uvs = BoolProperty(name="Export UVs", description="Exort the active UV layer", default= True)
use_colors = BoolProperty(name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
def poll(self, context):
return context.active_object != None
@@ -267,7 +288,7 @@ class EXPORT_OT_ply(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)

View File

@@ -1,3 +1,20 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
__author__ = ("Bart", "Campbell Barton")
__email__ = ["Bart, bart:neeneenee*de"]
@@ -1196,21 +1213,21 @@ def x3d_export_ui(filename):
# if __name__ == '__main__':
# Blender.Window.FileSelector(x3d_export_ui,"Export X3D", Blender.Get('filename').replace('.blend', '.x3d'))
from bpy.props import *
class EXPORT_OT_x3d(bpy.types.Operator):
'''Export selection to Extensible 3D file (.x3d)'''
__idname__ = "export.x3d"
__label__ = 'Export X3D'
bl_idname = "export.x3d"
bl_label = 'Export X3D'
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= ""),
bpy.props.BoolProperty(attr="apply_modifiers", name="Apply Modifiers", description="Use transformed mesh data from each object.", default=True),
bpy.props.BoolProperty(attr="triangulate", name="Triangulate", description="Triangulate quads.", default=False),
bpy.props.BoolProperty(attr="compress", name="Compress", description="GZip the resulting file, requires a full python install.", default=False),
]
path = StringProperty(name="File Path", description="File path used for exporting the X3D file", maxlen= 1024, default= "")
apply_modifiers = BoolProperty(name="Apply Modifiers", description="Use transformed mesh data from each object.", default=True)
triangulate = BoolProperty(name="Triangulate", description="Triangulate quads.", default=False)
compress = BoolProperty(name="Compress", description="GZip the resulting file, requires a full python install.", default=False)
def execute(self, context):
x3d_export(self.path, context, self.apply_modifiers, self.triangulate, self.compress)
@@ -1218,7 +1235,7 @@ class EXPORT_OT_x3d(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)
bpy.ops.add(EXPORT_OT_x3d)

View File

@@ -1,3 +1,20 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
__author__= ['Bob Holcomb', 'Richard L?rk?ng', 'Damien McGinnes', 'Campbell Barton', 'Mario Lapin']
__url__ = ("blenderartists.org", "www.blender.org", "www.gametutorials.com", "lib3ds.sourceforge.net/")
@@ -1121,22 +1138,22 @@ else:
print 'TOTAL TIME: %.6f' % (Blender.sys.time() - TIME)
'''
from bpy.props import *
class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
'''Import from 3DS file format (.3ds)'''
__idname__ = "import.autodesk_3ds"
__label__ = 'Import 3DS'
bl_idname = "import.autodesk_3ds"
bl_label = 'Import 3DS'
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
path = StringProperty(name="File Path", description="File path used for importing the 3DS file", maxlen= 1024, default= ""),
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for importing the 3DS file", maxlen= 1024, default= ""),
# bpy.props.FloatProperty(attr="size_constraint", name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0),
# bpy.props.BoolProperty(attr="search_images", name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True),
# bpy.props.BoolProperty(attr="apply_matrix", name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
]
# size_constraint = FloatProperty(name="Size Constraint", description="Scale the model by 10 until it reacehs the size constraint. Zero Disables.", min=0.0, max=1000.0, soft_min=0.0, soft_max=1000.0, default=10.0),
# search_images = BoolProperty(name="Image Search", description="Search subdirectories for any assosiated images (Warning, may be slow)", default=True),
# apply_matrix = BoolProperty(name="Transform Fix", description="Workaround for object transformations importing incorrectly", default=False),
def execute(self, context):
load_3ds(self.path, context, 0.0, False, False)
@@ -1144,7 +1161,7 @@ class IMPORT_OT_autodesk_3ds(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)
bpy.ops.add(IMPORT_OT_autodesk_3ds)

View File

@@ -1,3 +1,20 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
__author__= "Campbell Barton", "Jiri Hnidek", "Paolo Ciccone"
__url__= ['http://wiki.blender.org/index.php/Scripts/Manual/Import/wavefront_obj', 'blender.org', 'blenderartists.org']
@@ -1553,31 +1570,33 @@ else:
print 'TOTAL TIME: %.6f' % (sys.time() - TIME)
'''
from bpy.props import *
class IMPORT_OT_obj(bpy.types.Operator):
'''Load a Wavefront OBJ File.'''
__idname__ = "import.obj"
__label__ = "Import OBJ"
bl_idname = "import.obj"
bl_label = "Import OBJ"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for importing the OBJ file", maxlen= 1024, default= ""),
path = StringProperty(name="File Path", description="File path used for importing the OBJ file", maxlen= 1024, default= "")
bpy.props.BoolProperty(attr="CREATE_SMOOTH_GROUPS", name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True),
bpy.props.BoolProperty(attr="CREATE_FGONS", name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True),
bpy.props.BoolProperty(attr="CREATE_EDGES", name="Lines as Edges", description="Import lines and faces with 2 verts as edge", default= True),
bpy.props.BoolProperty(attr="SPLIT_OBJECTS", name="Object", description="Import OBJ Objects into Blender Objects", default= True),
bpy.props.BoolProperty(attr="SPLIT_GROUPS", name="Group", description="Import OBJ Groups into Blender Objects", default= True),
bpy.props.BoolProperty(attr="SPLIT_MATERIALS", name="Material", description="Import each material into a seperate mesh (Avoids > 16 per mesh error)", default= True),
# old comment: only used for user feedback
# disabled this option because in old code a handler for it disabled SPLIT* params, it's not passed to load_obj
# bpy.props.BoolProperty(attr="KEEP_VERT_ORDER", name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True),
bpy.props.BoolProperty(attr="ROTATE_X90", name="-X90", description="Rotate X 90.", default= True),
bpy.props.FloatProperty(attr="CLAMP_SIZE", name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.01, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0),
bpy.props.BoolProperty(attr="POLYGROUPS", name="Poly Groups", description="Import OBJ groups as vertex groups.", default= True),
bpy.props.BoolProperty(attr="IMAGE_SEARCH", name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default= True),
]
CREATE_SMOOTH_GROUPS = BoolProperty(name="Smooth Groups", description="Surround smooth groups by sharp edges", default= True)
CREATE_FGONS = BoolProperty(name="NGons as FGons", description="Import faces with more then 4 verts as fgons", default= True)
CREATE_EDGES = BoolProperty(name="Lines as Edges", description="Import lines and faces with 2 verts as edge", default= True)
SPLIT_OBJECTS = BoolProperty(name="Object", description="Import OBJ Objects into Blender Objects", default= True)
SPLIT_GROUPS = BoolProperty(name="Group", description="Import OBJ Groups into Blender Objects", default= True)
SPLIT_MATERIALS = BoolProperty(name="Material", description="Import each material into a seperate mesh (Avoids > 16 per mesh error)", default= True)
# old comment: only used for user feedback
# disabled this option because in old code a handler for it disabled SPLIT* params, it's not passed to load_obj
# KEEP_VERT_ORDER = BoolProperty(name="Keep Vert Order", description="Keep vert and face order, disables split options, enable for morph targets", default= True)
ROTATE_X90 = BoolProperty(name="-X90", description="Rotate X 90.", default= True)
CLAMP_SIZE = FloatProperty(name="Clamp Scale", description="Clamp the size to this maximum (Zero to Disable)", min=0.01, max=1000.0, soft_min=0.0, soft_max=1000.0, default=0.0)
POLYGROUPS = BoolProperty(name="Poly Groups", description="Import OBJ groups as vertex groups.", default= True)
IMAGE_SEARCH = BoolProperty(name="Image Search", description="Search subdirs for any assosiated images (Warning, may be slow)", default= True)
def execute(self, context):
# print("Selected: " + context.active_object.name)
@@ -1599,7 +1618,7 @@ class IMPORT_OT_obj(bpy.types.Operator):
def invoke(self, context, event):
wm = context.manager
wm.add_fileselect(self.__operator__)
wm.add_fileselect(self)
return ('RUNNING_MODAL',)

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# import Blender
import time, functools
import bpy
@@ -620,15 +638,14 @@ def main(context):
class MESH_OT_skin(bpy.types.Operator):
'''Bridge face loops.'''
__idname__ = "mesh.skin"
__label__ = "Add Torus"
__register__ = True
__undo__ = True
bl_idname = "mesh.skin"
bl_label = "Add Torus"
bl_register = True
bl_undo = True
'''
__props__ = [
bpy.props.EnumProperty(attr="loft_method", items=[(), ()], description="", default= True),
]
loft_method = EnumProperty(attr="loft_method", items=[(), ()], description="", default= True)
'''
def execute(self, context):

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# This directory is a Python package.
import model
@@ -14,6 +32,7 @@ import ui
import bpy
bpy.data.netrender_jobs = []
bpy.data.netrender_slaves = []
bpy.data.netrender_blacklist = []
bpy.netrender_jobs = []
bpy.netrender_slaves = []
bpy.netrender_blacklist = []

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import time
from netrender.utils import *

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
import sys, os, re
import http, http.client, http.server, urllib
@@ -159,8 +177,8 @@ def requestResult(conn, job_id, frame):
@rnaType
class NetworkRenderEngine(bpy.types.RenderEngine):
__idname__ = 'NET_RENDER'
__label__ = "Network Render"
bl_idname = 'NET_RENDER'
bl_label = "Network Render"
def render(self, scene):
if scene.network_render.mode == "RENDER_CLIENT":
self.render_client(scene)

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import sys, os
import http, http.client, http.server, urllib, socket
import subprocess, shutil, time, hashlib

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import re
from netrender.utils import *

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import sys, os
import http, http.client, http.server, urllib
import subprocess, shutil, time, hashlib

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
import sys, os
import http, http.client, http.server, urllib, socket
@@ -10,13 +28,8 @@ import netrender.model
@rnaOperator
class RENDER_OT_netclientanim(bpy.types.Operator):
'''Start rendering an animation on network'''
__idname__ = "render.netclientanim"
__label__ = "Animation on network"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientanim"
bl_label = "Animation on network"
def poll(self, context):
return True
@@ -41,13 +54,8 @@ class RENDER_OT_netclientanim(bpy.types.Operator):
@rnaOperator
class RENDER_OT_netclientsend(bpy.types.Operator):
'''Send Render Job to the Network'''
__idname__ = "render.netclientsend"
__label__ = "Send job"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientsend"
bl_label = "Send job"
def poll(self, context):
return True
@@ -70,13 +78,8 @@ class RENDER_OT_netclientsend(bpy.types.Operator):
@rnaOperator
class RENDER_OT_netclientstatus(bpy.types.Operator):
'''Refresh the status of the current jobs'''
__idname__ = "render.netclientstatus"
__label__ = "Client Status"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientstatus"
bl_label = "Client Status"
def poll(self, context):
return True
@@ -96,10 +99,10 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
while(len(netsettings.jobs) > 0):
netsettings.jobs.remove(0)
bpy.data.netrender_jobs = []
bpy.netrender_jobs = []
for j in jobs:
bpy.data.netrender_jobs.append(j)
bpy.netrender_jobs.append(j)
netsettings.jobs.add()
job = netsettings.jobs[-1]
@@ -115,13 +118,8 @@ class RENDER_OT_netclientstatus(bpy.types.Operator):
@rnaOperator
class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.'''
__idname__ = "render.netclientblacklistslave"
__label__ = "Client Blacklist Slave"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientblacklistslave"
bl_label = "Client Blacklist Slave"
def poll(self, context):
return True
@@ -132,8 +130,8 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
if netsettings.active_slave_index >= 0:
# deal with data
slave = bpy.data.netrender_slaves.pop(netsettings.active_slave_index)
bpy.data.netrender_blacklist.append(slave)
slave = bpy.netrender_slaves.pop(netsettings.active_slave_index)
bpy.netrender_blacklist.append(slave)
# deal with rna
netsettings.slaves_blacklist.add()
@@ -150,13 +148,8 @@ class RENDER_OT_netclientblacklistslave(bpy.types.Operator):
@rnaOperator
class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.'''
__idname__ = "render.netclientwhitelistslave"
__label__ = "Client Whitelist Slave"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientwhitelistslave"
bl_label = "Client Whitelist Slave"
def poll(self, context):
return True
@@ -167,8 +160,8 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
if netsettings.active_blacklisted_slave_index >= 0:
# deal with data
slave = bpy.data.netrender_blacklist.pop(netsettings.active_blacklisted_slave_index)
bpy.data.netrender_slaves.append(slave)
slave = bpy.netrender_blacklist.pop(netsettings.active_blacklisted_slave_index)
bpy.netrender_slaves.append(slave)
# deal with rna
netsettings.slaves.add()
@@ -186,13 +179,8 @@ class RENDER_OT_netclientwhitelistslave(bpy.types.Operator):
@rnaOperator
class RENDER_OT_netclientslaves(bpy.types.Operator):
'''Refresh status about available Render slaves'''
__idname__ = "render.netclientslaves"
__label__ = "Client Slaves"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientslaves"
bl_label = "Client Slaves"
def poll(self, context):
return True
@@ -212,17 +200,17 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
while(len(netsettings.slaves) > 0):
netsettings.slaves.remove(0)
bpy.data.netrender_slaves = []
bpy.netrender_slaves = []
for s in slaves:
for i in range(len(bpy.data.netrender_blacklist)):
slave = bpy.data.netrender_blacklist[i]
for i in range(len(bpy.netrender_blacklist)):
slave = bpy.netrender_blacklist[i]
if slave.id == s.id:
bpy.data.netrender_blacklist[i] = s
bpy.netrender_blacklist[i] = s
netsettings.slaves_blacklist[i].name = s.name
break
else:
bpy.data.netrender_slaves.append(s)
bpy.netrender_slaves.append(s)
netsettings.slaves.add()
slave = netsettings.slaves[-1]
@@ -236,13 +224,8 @@ class RENDER_OT_netclientslaves(bpy.types.Operator):
@rnaOperator
class RENDER_OT_netclientcancel(bpy.types.Operator):
'''Cancel the selected network rendering job.'''
__idname__ = "render.netclientcancel"
__label__ = "Client Cancel"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientcancel"
bl_label = "Client Cancel"
def poll(self, context):
netsettings = context.scene.network_render
@@ -253,7 +236,7 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
conn = clientConnection(context.scene)
if conn:
job = bpy.data.netrender_jobs[netsettings.active_job_index]
job = bpy.netrender_jobs[netsettings.active_job_index]
conn.request("POST", "/cancel", headers={"job-id":job.id})
@@ -270,13 +253,8 @@ class RENDER_OT_netclientcancel(bpy.types.Operator):
@rnaOperator
class RENDER_OT_netclientcancelall(bpy.types.Operator):
'''Cancel all running network rendering jobs.'''
__idname__ = "render.netclientcancelall"
__label__ = "Client Cancel All"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientcancelall"
bl_label = "Client Cancel All"
def poll(self, context):
return True
@@ -302,13 +280,8 @@ class RENDER_OT_netclientcancelall(bpy.types.Operator):
@rnaOperator
class netclientdownload(bpy.types.Operator):
'''Download render results from the network'''
__idname__ = "render.netclientdownload"
__label__ = "Client Download"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientdownload"
bl_label = "Client Download"
def poll(self, context):
netsettings = context.scene.network_render
@@ -321,7 +294,7 @@ class netclientdownload(bpy.types.Operator):
conn = clientConnection(context.scene)
if conn:
job = bpy.data.netrender_jobs[netsettings.active_job_index]
job = bpy.netrender_jobs[netsettings.active_job_index]
for frame in job.frames:
client.requestResult(conn, job.id, frame.number)
@@ -352,13 +325,8 @@ class netclientdownload(bpy.types.Operator):
@rnaOperator
class netclientscan(bpy.types.Operator):
'''Operator documentation text, will be used for the operator tooltip and python docs.'''
__idname__ = "render.netclientscan"
__label__ = "Client Scan"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientscan"
bl_label = "Client Scan"
def poll(self, context):
return True
@@ -390,13 +358,8 @@ class netclientscan(bpy.types.Operator):
@rnaOperator
class netclientweb(bpy.types.Operator):
'''Open new window with information about running rendering jobs'''
__idname__ = "render.netclientweb"
__label__ = "Open Master Monitor"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
__props__ = []
bl_idname = "render.netclientweb"
bl_label = "Open Master Monitor"
def poll(self, context):
return True

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import sys, os, platform
import http, http.client, http.server, urllib
import subprocess, time

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
import sys, os
import http, http.client, http.server, urllib
@@ -18,9 +36,9 @@ DONE = 2
ERROR = 3
class RenderButtonsPanel(bpy.types.Panel):
__space_type__ = "PROPERTIES"
__region_type__ = "WINDOW"
__context__ = "render"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "render"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
@@ -30,7 +48,7 @@ class RenderButtonsPanel(bpy.types.Panel):
# Setting panel, use in the scene for now.
@rnaType
class RENDER_PT_network_settings(RenderButtonsPanel):
__label__ = "Network Settings"
bl_label = "Network Settings"
COMPAT_ENGINES = set(['NET_RENDER'])
def draw(self, context):
@@ -56,7 +74,7 @@ class RENDER_PT_network_settings(RenderButtonsPanel):
@rnaType
class RENDER_PT_network_job(RenderButtonsPanel):
__label__ = "Job Settings"
bl_label = "Job Settings"
COMPAT_ENGINES = set(['NET_RENDER'])
def poll(self, context):
@@ -84,7 +102,7 @@ class RENDER_PT_network_job(RenderButtonsPanel):
@rnaType
class RENDER_PT_network_slaves(RenderButtonsPanel):
__label__ = "Slaves Status"
bl_label = "Slaves Status"
COMPAT_ENGINES = set(['NET_RENDER'])
def poll(self, context):
@@ -104,14 +122,14 @@ class RENDER_PT_network_slaves(RenderButtonsPanel):
sub.itemO("render.netclientslaves", icon="ICON_FILE_REFRESH", text="")
sub.itemO("render.netclientblacklistslave", icon="ICON_ZOOMOUT", text="")
if len(bpy.data.netrender_slaves) == 0 and len(netsettings.slaves) > 0:
if len(bpy.netrender_slaves) == 0 and len(netsettings.slaves) > 0:
while(len(netsettings.slaves) > 0):
netsettings.slaves.remove(0)
if netsettings.active_slave_index >= 0 and len(netsettings.slaves) > 0:
layout.itemS()
slave = bpy.data.netrender_slaves[netsettings.active_slave_index]
slave = bpy.netrender_slaves[netsettings.active_slave_index]
layout.itemL(text="Name: " + slave.name)
layout.itemL(text="Address: " + slave.address[0])
@@ -120,7 +138,7 @@ class RENDER_PT_network_slaves(RenderButtonsPanel):
@rnaType
class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
__label__ = "Slaves Blacklist"
bl_label = "Slaves Blacklist"
COMPAT_ENGINES = set(['NET_RENDER'])
def poll(self, context):
@@ -139,14 +157,14 @@ class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
sub = row.column(align=True)
sub.itemO("render.netclientwhitelistslave", icon="ICON_ZOOMOUT", text="")
if len(bpy.data.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
if len(bpy.netrender_blacklist) == 0 and len(netsettings.slaves_blacklist) > 0:
while(len(netsettings.slaves_blacklist) > 0):
netsettings.slaves_blacklist.remove(0)
if netsettings.active_blacklisted_slave_index >= 0 and len(netsettings.slaves_blacklist) > 0:
layout.itemS()
slave = bpy.data.netrender_blacklist[netsettings.active_blacklisted_slave_index]
slave = bpy.netrender_blacklist[netsettings.active_blacklisted_slave_index]
layout.itemL(text="Name: " + slave.name)
layout.itemL(text="Address: " + slave.address[0])
@@ -155,7 +173,7 @@ class RENDER_PT_network_slaves_blacklist(RenderButtonsPanel):
@rnaType
class RENDER_PT_network_jobs(RenderButtonsPanel):
__label__ = "Jobs"
bl_label = "Jobs"
COMPAT_ENGINES = set(['NET_RENDER'])
def poll(self, context):
@@ -177,14 +195,14 @@ class RENDER_PT_network_jobs(RenderButtonsPanel):
sub.itemO("render.netclientcancelall", icon="ICON_PANEL_CLOSE", text="")
sub.itemO("render.netclientdownload", icon='ICON_RENDER_ANIMATION', text="")
if len(bpy.data.netrender_jobs) == 0 and len(netsettings.jobs) > 0:
if len(bpy.netrender_jobs) == 0 and len(netsettings.jobs) > 0:
while(len(netsettings.jobs) > 0):
netsettings.jobs.remove(0)
if netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0:
layout.itemS()
job = bpy.data.netrender_jobs[netsettings.active_job_index]
job = bpy.netrender_jobs[netsettings.active_job_index]
layout.itemL(text="Name: %s" % job.name)
layout.itemL(text="Length: %04i" % len(job))

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
import sys, os
import re

View File

@@ -0,0 +1,189 @@
# bl_author = ["Campbell Barton aka ideasman42", "Keith Boshoff aka Wahooney"]
# bl_url = ["www.blender.org", "blenderartists.org", "www.python.org"]
# bl_version = "0.2"
# ***** BEGIN GPL LICENSE BLOCK *****
#
# Script copyright (C) Campbell J Barton
#
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ***** END GPL LICENCE BLOCK *****
# --------------------------------------------------------------------------
# History
#
# 2009-11-01: * 2.5 port by Keith "Wahooney" Boshoff
# * Replaced old method with my own, speed is similar (about 0.001 sec on Suzanne)
# but results are far more accurate
#
import bpy
import Mathutils
import math
import time
from Mathutils import Vector
from bpy.props import *
def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean, dirt_only, sel_only):
## Window.WaitCursor(1)
#BPyMesh.meshCalcNormals(me)
vert_tone= [0.0] * len(me.verts)
vert_tone_count= [0] * len(me.verts)
# create lookup table for each vertex's connected vertices (via edges)
con = [[] for i in range(len(me.verts))]
min_tone=180.0
max_tone=0.0
# add connected verts
for e in me.edges:
con[e.verts[0]].append(e.verts[1])
con[e.verts[1]].append(e.verts[0])
for v in me.verts:
vec = Vector()
no = v.normal
co = v.co
# get the direction of the vectors between the vertex and it's connected vertices
for c in con[v.index]:
vec += Vector(me.verts[c].co - co).normalize()
# normalize the vector by dividing by the number of connected verts
vec /= len(con[v.index])
# angle is the acos of the dot product between vert and connected verts normals
ang = math.acos(no.dot(vec))
# enforce min/max
vert_tone[v.index] = max(clamp_clean, min(clamp_dirt, ang))
# average vert_tone_list into vert_tonef
# for i, tones in enumerate(vert_tone):
# if vert_tone_count[i]:
# vert_tone[i] = vert_tone[i] / vert_tone_count[i]
# Below we use edges to blur along so the edges need counting, not the faces
vert_tone_count= [0] * len(me.verts)
for ed in me.edges:
vert_tone_count[ed.verts[0]] += 1
vert_tone_count[ed.verts[1]] += 1
# Blur tone
blur = blur_strength
blur_inv = 1.0 - blur_strength
for i in range(blur_iterations):
# backup the original tones
orig_vert_tone= list(vert_tone)
for ed in me.edges:
i1 = ed.verts[0]
i2 = ed.verts[1]
val1 = (orig_vert_tone[i2]*blur) + (orig_vert_tone[i1]*blur_inv)
val2 = (orig_vert_tone[i1]*blur) + (orig_vert_tone[i2]*blur_inv)
# Apply the ton divided by the number of faces connected
vert_tone[i1] += val1 / max(vert_tone_count[i1], 1)
vert_tone[i2] += val2 / max(vert_tone_count[i2], 1)
min_tone= min(vert_tone)
max_tone= max(vert_tone)
print(min_tone)
print(max_tone)
print(clamp_clean)
print(clamp_dirt)
tone_range= max_tone-min_tone
if max_tone==min_tone:
return
for lay in me.vertex_colors:
if lay.active:
active_col_layer = lay.data
if not active_col_layer:
return('CANCELLED', )
for i, f in enumerate(me.faces):
if not sel_only or f.sel:
f_col = active_col_layer[i]
f_col = [f_col.color1, f_col.color2, f_col.color3, f_col.color4]
for j, v in enumerate(f.verts):
col = f_col[j]
tone = vert_tone[me.verts[v].index]
tone = (tone-min_tone)/tone_range
col[0] = tone*col[0]
col[1] = tone*col[1]
col[2] = tone*col[2]
## Window.WaitCursor(0)
class VertexPaintDirt(bpy.types.Operator):
'''This script uses the concavity of vertices to shade the mesh, and optionaly blur the shading to remove artifacts from spesific edges.'''
bl_idname = "mesh.vertex_paint_dirt"
bl_label = "Dirty Vertex Colors"
bl_register = True
bl_undo = True
blur_strength = FloatProperty(name="Blur Strength", description="Blur strength per iteration", default=1.0, min=0.01, max=1.0)
blur_iterations = IntProperty(name="Blur Iterations", description="Number times to blur the colors. (higher blurs more)", default=1, min=0, max=40)
clean_angle = FloatProperty(name="Highlight Angle", description="Less then 90 limits the angle used in the tonal range", default=0.0, min=0.0, max=180.0)
dirt_angle = FloatProperty(name="Dirt Angle", description="Less then 90 limits the angle used in the tonal range", default=180.0, min=0.0, max=180.0)
dirt_only = BoolProperty(name="Dirt Only", description="Dont calculate cleans for convex areas", default=False)
sel_faces_only = BoolProperty(name="Selected Faces Only", description="Only apply to UV/Face selected faces (mix vpain/uvface select)", default=False)
def execute(self, context):
sce= context.scene
ob= context.object
if not ob or ob.type != 'MESH':
print('Error, no active mesh object, aborting.')
print(ob)
print(ob.type)
return('CANCELLED',)
me = ob.data
t = time.time()
applyVertexDirt(me, self.blur_iterations, self.blur_strength, math.radians(self.dirt_angle), math.radians(self.clean_angle), self.dirt_only, self.sel_faces_only)
print('done in %.6f' % (time.time()-t))
return('FINISHED',)
bpy.ops.add(VertexPaintDirt)
if __name__ == "__main__":
bpy.ops.mesh.vertex_paint_dirt()

View File

@@ -1,4 +1,22 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
class_obj = bpy.types.Object
class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]
class_obj.getChildren = lambda ob: [child for child in bpy.data.objects if child.parent == ob]

View File

@@ -1 +1,19 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy_ext.Object

View File

@@ -1,422 +1,537 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8-80 compliant>
# for slightly faster access
from bpy.__ops__ import add as op_add
from bpy.__ops__ import remove as op_remove
from bpy.__ops__ import dir as op_dir
from bpy.__ops__ import call as op_call
from bpy.__ops__ import as_string as op_as_string
from bpy.__ops__ import get_rna as op_get_rna
from bpy.__ops__ import add as op_add
from bpy.__ops__ import remove as op_remove
from bpy.__ops__ import dir as op_dir
from bpy.__ops__ import call as op_call
from bpy.__ops__ import as_string as op_as_string
from bpy.__ops__ import get_rna as op_get_rna
# Keep in sync with WM_types.h
context_dict = {
'INVOKE_DEFAULT':0,
'INVOKE_REGION_WIN':1,
'INVOKE_AREA':2,
'INVOKE_SCREEN':3,
'EXEC_DEFAULT':4,
'EXEC_REGION_WIN':5,
'EXEC_AREA':6,
'EXEC_SCREEN':7,
'INVOKE_DEFAULT': 0,
'INVOKE_REGION_WIN': 1,
'INVOKE_AREA': 2,
'INVOKE_SCREEN': 3,
'EXEC_DEFAULT': 4,
'EXEC_REGION_WIN': 5,
'EXEC_AREA': 6,
'EXEC_SCREEN': 7,
}
class bpy_ops(object):
'''
Fake module like class.
'''
Fake module like class.
bpy.ops
'''
bpy.ops
'''
def __getattr__(self, module):
'''
gets a bpy.ops submodule
'''
if module.startswith('__'):
raise AttributeError(module)
return bpy_ops_submodule(module)
def add(self, pyop):
op_add(pyop)
def remove(self, pyop):
op_remove(pyop)
def __dir__(self):
submodules = set()
# add this classes functions
for id_name in dir(self.__class__):
if not id_name.startswith('__'):
submodules.add(id_name)
for id_name in op_dir():
id_split = id_name.split('_OT_', 1)
if len(id_split) == 2:
submodules.add(id_split[0].lower())
else:
submodules.add(id_split[0])
return list(submodules)
def __repr__(self):
return "<module like class 'bpy.ops'>"
def __getattr__(self, module):
'''
gets a bpy.ops submodule
'''
if module.startswith('__'):
raise AttributeError(module)
return bpy_ops_submodule(module)
def add(self, pyop):
op_add(pyop)
def remove(self, pyop):
op_remove(pyop)
def __dir__(self):
submodules = set()
# add this classes functions
for id_name in dir(self.__class__):
if not id_name.startswith('__'):
submodules.add(id_name)
for id_name in op_dir():
id_split = id_name.split('_OT_', 1)
if len(id_split) == 2:
submodules.add(id_split[0].lower())
else:
submodules.add(id_split[0])
return list(submodules)
def __repr__(self):
return "<module like class 'bpy.ops'>"
class bpy_ops_submodule(object):
'''
Utility class to fake submodules.
eg. bpy.ops.object
'''
__keys__ = ('module',)
def __init__(self, module):
self.module = module
def __getattr__(self, func):
'''
gets a bpy.ops.submodule function
'''
return bpy_ops_submodule_op(self.module, func)
def __dir__(self):
functions = set()
module_upper = self.module.upper()
for id_name in op_dir():
id_split = id_name.split('_OT_', 1)
if len(id_split) == 2 and module_upper == id_split[0]:
functions.add(id_split[1])
return list(functions)
def __repr__(self):
return "<module like class 'bpy.ops.%s'>" % self.module
'''
Utility class to fake submodules.
eg. bpy.ops.object
'''
__keys__ = ('module',)
def __init__(self, module):
self.module = module
def __getattr__(self, func):
'''
gets a bpy.ops.submodule function
'''
if func.startswith('__'):
raise AttributeError(func)
return bpy_ops_submodule_op(self.module, func)
def __dir__(self):
functions = set()
module_upper = self.module.upper()
for id_name in op_dir():
id_split = id_name.split('_OT_', 1)
if len(id_split) == 2 and module_upper == id_split[0]:
functions.add(id_split[1])
return list(functions)
def __repr__(self):
return "<module like class 'bpy.ops.%s'>" % self.module
class bpy_ops_submodule_op(object):
'''
Utility class to fake submodule operators.
eg. bpy.ops.object.somefunc
'''
__keys__ = ('module', 'func')
def __init__(self, module, func):
self.module = module
self.func = func
def idname(self):
# submod.foo -> SUBMOD_OT_foo
return self.module.upper() + '_OT_' + self.func
def __call__(self, *args, **kw):
# Get the operator from blender
if len(args) > 2:
raise ValueError("only 1 or 2 arguments for the execution context is supported")
C_dict = None
if args:
C_exec = 'EXEC_DEFAULT'
if len(args) == 2:
C_exec = args[0]
C_dict = args[1]
else:
if type(args[0]) != str:
C_dict= args[0]
else:
C_exec= args[0]
try:
context = context_dict[C_exec]
except:
raise ValueError("Expected a single context argument in: " + str(list(context_dict.keys())))
if len(args) == 2:
C_dict= args[1]
return op_call(self.idname() , C_dict, kw, context)
else:
return op_call(self.idname(), C_dict, kw)
def get_rna(self):
'''
currently only used for '__rna__'
'''
return op_get_rna(self.idname())
def __repr__(self): # useful display, repr(op)
return op_as_string(self.idname())
def __str__(self): # used for print(...)
return "<function bpy.ops.%s.%s at 0x%x'>" % (self.module, self.func, id(self))
'''
Utility class to fake submodule operators.
eg. bpy.ops.object.somefunc
'''
__keys__ = ('module', 'func')
def __init__(self, module, func):
self.module = module
self.func = func
def idname(self):
# submod.foo -> SUBMOD_OT_foo
return self.module.upper() + '_OT_' + self.func
def __call__(self, *args, **kw):
# Get the operator from blender
if len(args) > 2:
raise ValueError("1 or 2 args execution context is supported")
C_dict = None
if args:
C_exec = 'EXEC_DEFAULT'
if len(args) == 2:
C_exec = args[0]
C_dict = args[1]
else:
if type(args[0]) != str:
C_dict = args[0]
else:
C_exec = args[0]
try:
context = context_dict[C_exec]
except:
raise ValueError("Expected a single context argument in: " + \
str(list(context_dict.keys())))
if len(args) == 2:
C_dict = args[1]
return op_call(self.idname(), C_dict, kw, context)
else:
return op_call(self.idname(), C_dict, kw)
def get_rna(self):
'''
currently only used for 'bl_rna'
'''
return op_get_rna(self.idname())
def __repr__(self): # useful display, repr(op)
return op_as_string(self.idname())
def __str__(self): # used for print(...)
return "<function bpy.ops.%s.%s at 0x%x'>" % \
(self.module, self.func, id(self))
import bpy
bpy.ops = bpy_ops()
# TODO, C macro's cant define settings :|
class MESH_OT_delete_edgeloop(bpy.types.Operator):
'''Export a single object as a stanford PLY with normals, colours and texture coordinates.'''
__idname__ = "mesh.delete_edgeloop"
__label__ = "Delete Edge Loop"
def execute(self, context):
bpy.ops.tfm.edge_slide(value=1.0)
bpy.ops.mesh.select_more()
bpy.ops.mesh.remove_doubles()
return ('FINISHED',)
from bpy.props import *
class MESH_OT_delete_edgeloop(bpy.types.Operator):
'''Export a single object as a stanford PLY with normals,
colours and texture coordinates.'''
bl_idname = "mesh.delete_edgeloop"
bl_label = "Delete Edge Loop"
def execute(self, context):
bpy.ops.tfm.edge_slide(value=1.0)
bpy.ops.mesh.select_more()
bpy.ops.mesh.remove_doubles()
return ('FINISHED',)
rna_path_prop = StringProperty(name="Context Attributes",
description="rna context string", maxlen=1024, default="")
rna_reverse_prop = BoolProperty(name="Reverse",
description="Cycle backwards", default=False)
rna_path_prop = bpy.props.StringProperty(attr="path", name="Context Attributes", description="rna context string", maxlen= 1024, default= "")
rna_reverse_prop = bpy.props.BoolProperty(attr="reverse", name="Reverse", description="Cycle backwards", default= False)
class NullPathMember:
pass
pass
def context_path_validate(context, path):
import sys
try:
value = eval("context.%s" % path)
except AttributeError:
if "'NoneType'" in str(sys.exc_info()[1]):
# One of the items in the rna path is None, just ignore this
value = NullPathMember
else:
# We have a real error in the rna path, dont ignore that
raise
return value
import sys
try:
value = eval("context.%s" % path)
except AttributeError:
if "'NoneType'" in str(sys.exc_info()[1]):
# One of the items in the rna path is None, just ignore this
value = NullPathMember
else:
# We have a real error in the rna path, dont ignore that
raise
return value
def execute_context_assign(self, context):
if context_path_validate(context, self.path) == NullPathMember:
return ('PASS_THROUGH',)
exec("context.%s=self.value" % self.path)
return ('FINISHED',)
if context_path_validate(context, self.path) == NullPathMember:
return ('PASS_THROUGH',)
exec("context.%s=self.value" % self.path)
return ('FINISHED',)
class WM_OT_context_set_boolean(bpy.types.Operator):
'''Set a context value.'''
__idname__ = "wm.context_set_boolean"
__label__ = "Context Set"
__props__ = [rna_path_prop, bpy.props.BoolProperty(attr="value", name="Value", description="Assignment value", default= True)]
execute = execute_context_assign
'''Set a context value.'''
bl_idname = "wm.context_set_boolean"
bl_label = "Context Set"
path = rna_path_prop
value = BoolProperty(name="Value",
description="Assignment value", default=True)
execute = execute_context_assign
class WM_OT_context_set_int(bpy.types.Operator): # same as enum
'''Set a context value.'''
__idname__ = "wm.context_set_int"
__label__ = "Context Set"
__props__ = [rna_path_prop, bpy.props.IntProperty(attr="value", name="Value", description="Assignment value", default= 0)]
execute = execute_context_assign
'''Set a context value.'''
bl_idname = "wm.context_set_int"
bl_label = "Context Set"
path = rna_path_prop
value = IntProperty(name="Value", description="Assign value", default=0)
execute = execute_context_assign
class WM_OT_context_set_float(bpy.types.Operator): # same as enum
'''Set a context value.'''
__idname__ = "wm.context_set_int"
__label__ = "Context Set"
__props__ = [rna_path_prop, bpy.props.FloatProperty(attr="value", name="Value", description="Assignment value", default= 0.0)]
execute = execute_context_assign
'''Set a context value.'''
bl_idname = "wm.context_set_int"
bl_label = "Context Set"
path = rna_path_prop
value = FloatProperty(name="Value",
description="Assignment value", default=0.0)
execute = execute_context_assign
class WM_OT_context_set_string(bpy.types.Operator): # same as enum
'''Set a context value.'''
__idname__ = "wm.context_set_string"
__label__ = "Context Set"
__props__ = [rna_path_prop, bpy.props.StringProperty(attr="value", name="Value", description="Assignment value", maxlen= 1024, default= "")]
execute = execute_context_assign
'''Set a context value.'''
bl_idname = "wm.context_set_string"
bl_label = "Context Set"
path = rna_path_prop
value = StringProperty(name="Value",
description="Assign value", maxlen=1024, default="")
execute = execute_context_assign
class WM_OT_context_set_enum(bpy.types.Operator):
'''Set a context value.'''
__idname__ = "wm.context_set_enum"
__label__ = "Context Set"
__props__ = [rna_path_prop, bpy.props.StringProperty(attr="value", name="Value", description="Assignment value (as a string)", maxlen= 1024, default= "")]
execute = execute_context_assign
'''Set a context value.'''
bl_idname = "wm.context_set_enum"
bl_label = "Context Set"
path = rna_path_prop
value = StringProperty(name="Value",
description="Assignment value (as a string)",
maxlen=1024, default="")
execute = execute_context_assign
class WM_OT_context_toggle(bpy.types.Operator):
'''Toggle a context value.'''
__idname__ = "wm.context_toggle"
__label__ = "Context Toggle"
__props__ = [rna_path_prop]
def execute(self, context):
if context_path_validate(context, self.path) == NullPathMember:
return ('PASS_THROUGH',)
exec("context.%s=not (context.%s)" % (self.path, self.path)) # security nuts will complain.
return ('FINISHED',)
'''Toggle a context value.'''
bl_idname = "wm.context_toggle"
bl_label = "Context Toggle"
path = rna_path_prop
def execute(self, context):
if context_path_validate(context, self.path) == NullPathMember:
return ('PASS_THROUGH',)
exec("context.%s=not (context.%s)" % (self.path, self.path))
return ('FINISHED',)
class WM_OT_context_toggle_enum(bpy.types.Operator):
'''Toggle a context value.'''
__idname__ = "wm.context_toggle_enum"
__label__ = "Context Toggle Values"
__props__ = [
rna_path_prop,
bpy.props.StringProperty(attr="value_1", name="Value", description="Toggle enum", maxlen= 1024, default= ""),
bpy.props.StringProperty(attr="value_2", name="Value", description="Toggle enum", maxlen= 1024, default= "")
]
def execute(self, context):
if context_path_validate(context, self.path) == NullPathMember:
return ('PASS_THROUGH',)
exec("context.%s = ['%s', '%s'][context.%s!='%s']" % (self.path, self.value_1, self.value_2, self.path, self.value_2)) # security nuts will complain.
return ('FINISHED',)
'''Toggle a context value.'''
bl_idname = "wm.context_toggle_enum"
bl_label = "Context Toggle Values"
path = rna_path_prop
value_1 = StringProperty(name="Value", \
description="Toggle enum", maxlen=1024, default="")
value_2 = StringProperty(name="Value", \
description="Toggle enum", maxlen=1024, default="")
def execute(self, context):
if context_path_validate(context, self.path) == NullPathMember:
return ('PASS_THROUGH',)
exec("context.%s = ['%s', '%s'][context.%s!='%s']" % \
(self.path, self.value_1, self.value_2, self.path, self.value_2))
return ('FINISHED',)
class WM_OT_context_cycle_int(bpy.types.Operator):
'''Set a context value. Useful for cycling active material, vertex keys, groups' etc.'''
__idname__ = "wm.context_cycle_int"
__label__ = "Context Int Cycle"
__props__ = [rna_path_prop, rna_reverse_prop]
def execute(self, context):
value = context_path_validate(context, self.path)
if value == NullPathMember:
return ('PASS_THROUGH',)
self.value = value
if self.reverse: self.value -= 1
else: self.value += 1
execute_context_assign(self, context)
if self.value != eval("context.%s" % self.path):
# relies on rna clamping int's out of the range
if self.reverse: self.value = (1<<32)
else: self.value = -(1<<32)
execute_context_assign(self, context)
return ('FINISHED',)
'''Set a context value. Useful for cycling active material,
vertex keys, groups' etc.'''
bl_idname = "wm.context_cycle_int"
bl_label = "Context Int Cycle"
path = rna_path_prop
reverse = rna_reverse_prop
def execute(self, context):
value = context_path_validate(context, self.path)
if value == NullPathMember:
return ('PASS_THROUGH',)
self.value = value
if self.reverse:
self.value -= 1
else:
self.value += 1
execute_context_assign(self, context)
if self.value != eval("context.%s" % self.path):
# relies on rna clamping int's out of the range
if self.reverse:
self.value = (1 << 32)
else:
self.value = - (1 << 32)
execute_context_assign(self, context)
return ('FINISHED',)
class WM_OT_context_cycle_enum(bpy.types.Operator):
'''Toggle a context value.'''
__idname__ = "wm.context_cycle_enum"
__label__ = "Context Enum Cycle"
__props__ = [rna_path_prop, rna_reverse_prop]
def execute(self, context):
value = context_path_validate(context, self.path)
if value == NullPathMember:
return ('PASS_THROUGH',)
orig_value = value
# Have to get rna enum values
rna_struct_str, rna_prop_str = self.path.rsplit('.', 1)
i = rna_prop_str.find('[')
if i != -1: rna_prop_str = rna_prop_str[0:i] # just incse we get "context.foo.bar[0]"
rna_struct = eval("context.%s.rna_type" % rna_struct_str)
rna_prop = rna_struct.properties[rna_prop_str]
if type(rna_prop) != bpy.types.EnumProperty:
raise Exception("expected an enum property")
enums = rna_struct.properties[rna_prop_str].items.keys()
orig_index = enums.index(orig_value)
# Have the info we need, advance to the next item
if self.reverse:
if orig_index==0: advance_enum = enums[-1]
else: advance_enum = enums[orig_index-1]
else:
if orig_index==len(enums)-1: advance_enum = enums[0]
else: advance_enum = enums[orig_index+1]
# set the new value
exec("context.%s=advance_enum" % self.path)
return ('FINISHED',)
'''Toggle a context value.'''
bl_idname = "wm.context_cycle_enum"
bl_label = "Context Enum Cycle"
doc_id = bpy.props.StringProperty(attr="doc_id", name="Doc ID", description="ID for the documentation", maxlen= 1024, default= "")
doc_new = bpy.props.StringProperty(attr="doc_new", name="Doc New", description="", maxlen= 1024, default= "")
path = rna_path_prop
reverse = rna_reverse_prop
def execute(self, context):
value = context_path_validate(context, self.path)
if value == NullPathMember:
return ('PASS_THROUGH',)
orig_value = value
# Have to get rna enum values
rna_struct_str, rna_prop_str = self.path.rsplit('.', 1)
i = rna_prop_str.find('[')
# just incse we get "context.foo.bar[0]"
if i != -1:
rna_prop_str = rna_prop_str[0:i]
rna_struct = eval("context.%s.rna_type" % rna_struct_str)
rna_prop = rna_struct.properties[rna_prop_str]
if type(rna_prop) != bpy.types.EnumProperty:
raise Exception("expected an enum property")
enums = rna_struct.properties[rna_prop_str].items.keys()
orig_index = enums.index(orig_value)
# Have the info we need, advance to the next item
if self.reverse:
if orig_index == 0:
advance_enum = enums[-1]
else:
advance_enum = enums[orig_index-1]
else:
if orig_index == len(enums) - 1:
advance_enum = enums[0]
else:
advance_enum = enums[orig_index + 1]
# set the new value
exec("context.%s=advance_enum" % self.path)
return ('FINISHED',)
doc_id = StringProperty(name="Doc ID",
description="ID for the documentation", maxlen=1024, default="")
doc_new = StringProperty(name="Doc New",
description="", maxlen=1024, default="")
class WM_OT_doc_view(bpy.types.Operator):
'''Load online reference docs'''
__idname__ = "wm.doc_view"
__label__ = "View Documentation"
__props__ = [doc_id]
_prefix = 'http://www.blender.org/documentation/250PythonDoc'
def _nested_class_string(self, class_string):
ls = []
class_obj = getattr(bpy.types, class_string, None).__rna__
while class_obj:
ls.insert(0, class_obj)
class_obj = class_obj.nested
return '.'.join([class_obj.identifier for class_obj in ls])
def execute(self, context):
id_split = self.doc_id.split('.')
# Example url, http://www.graphicall.org/ftp/ideasman42/html/bpy.types.Space3DView-class.html#background_image
# Example operator http://www.graphicall.org/ftp/ideasman42/html/bpy.ops.boid-module.html#boidrule_add
if len(id_split) == 1: # rna, class
url= '%s/bpy.types.%s-class.html' % (self._prefix, id_split[0])
elif len(id_split) == 2: # rna, class.prop
class_name, class_prop = id_split
class_name_full = self._nested_class_string(class_name) # It so happens that epydoc nests these
if hasattr(bpy.types, class_name.upper() + '_OT_' + class_prop):
url= '%s/bpy.ops.%s-module.html#%s' % (self._prefix, class_name_full, class_prop)
else:
url= '%s/bpy.types.%s-class.html#%s' % (self._prefix, class_name_full, class_prop)
else:
return ('PASS_THROUGH',)
import webbrowser
webbrowser.open(url)
return ('FINISHED',)
'''Load online reference docs'''
bl_idname = "wm.doc_view"
bl_label = "View Documentation"
doc_id = doc_id
_prefix = 'http://www.blender.org/documentation/250PythonDoc'
def _nested_class_string(self, class_string):
ls = []
class_obj = getattr(bpy.types, class_string, None).bl_rna
while class_obj:
ls.insert(0, class_obj)
class_obj = class_obj.nested
return '.'.join([class_obj.identifier for class_obj in ls])
def execute(self, context):
id_split = self.doc_id.split('.')
if len(id_split) == 1: # rna, class
url = '%s/bpy.types.%s-class.html' % (self._prefix, id_split[0])
elif len(id_split) == 2: # rna, class.prop
class_name, class_prop = id_split
# It so happens that epydoc nests these
class_name_full = self._nested_class_string(class_name)
if hasattr(bpy.types, class_name.upper() + '_OT_' + class_prop):
url = '%s/bpy.ops.%s-module.html#%s' % \
(self._prefix, class_name_full, class_prop)
else:
url = '%s/bpy.types.%s-class.html#%s' % \
(self._prefix, class_name_full, class_prop)
else:
return ('PASS_THROUGH',)
import webbrowser
webbrowser.open(url)
return ('FINISHED',)
class WM_OT_doc_edit(bpy.types.Operator):
'''Load online reference docs'''
__idname__ = "wm.doc_edit"
__label__ = "Edit Documentation"
__props__ = [doc_id, doc_new]
def _send_xmlrpc(self, data_dict):
print("sending data:", data_dict)
import xmlrpc.client
user = 'blenderuser'
pwd = 'blender>user'
docblog = xmlrpc.client.ServerProxy("http://www.mindrones.com/blender/svn/xmlrpc.php")
docblog.metaWeblog.newPost(1,user,pwd, data_dict,1)
def execute(self, context):
class_name, class_prop = self.doc_id.split('.')
if self.doc_new:
op_class = getattr(bpy.types, class_name.upper() + '_OT_' + class_prop, None)
if op_class:
doc_orig = op_class.__rna__.description
if doc_orig != self.doc_new:
print("operator - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
self._send_xmlrpc({'title':'OPERATOR %s:%s' % (self.doc_id,doc_orig),'description':self.doc_new})
else:
doc_orig = getattr(bpy.types, class_name).__rna__.properties[class_prop].description
if doc_orig != self.doc_new:
print("rna - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
# Ugh, will run this on every edit.... better not make any mistakes
self._send_xmlrpc({'title':'RNA %s:%s' % (self.doc_id,doc_orig),'description':self.doc_new})
return ('FINISHED',)
def invoke(self, context, event):
wm = context.manager
wm.invoke_props_popup(self.__operator__, event)
return ('RUNNING_MODAL',)
'''Load online reference docs'''
bl_idname = "wm.doc_edit"
bl_label = "Edit Documentation"
doc_id = doc_id
doc_new = doc_new
_url = "http://www.mindrones.com/blender/svn/xmlrpc.php"
def _send_xmlrpc(self, data_dict):
print("sending data:", data_dict)
import xmlrpc.client
user = 'blenderuser'
pwd = 'blender>user'
docblog = xmlrpc.client.ServerProxy(self._url)
docblog.metaWeblog.newPost(1, user, pwd, data_dict, 1)
def execute(self, context):
class_name, class_prop = self.doc_id.split('.')
if not self.doc_new:
return 'OPERATOR_CANCELLED'
# check if this is an operator
op_name = class_name.upper() + '_OT_' + class_prop
op_class = getattr(bpy.types, op_name, None)
# Upload this to the web server
upload = {}
if op_class:
rna = op_class.bl_rna
doc_orig = rna.description
if doc_orig == self.doc_new:
return 'OPERATOR_CANCELLED'
print("op - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
upload["title"] = 'OPERATOR %s:%s' % (self.doc_id, doc_orig)
upload["description"] = self.doc_new
self._send_xmlrpc(upload)
else:
rna = getattr(bpy.types, class_name).bl_rna
doc_orig = rna.properties[class_prop].description
if doc_orig == self.doc_new:
return 'OPERATOR_CANCELLED'
print("rna - old:'%s' -> new:'%s'" % (doc_orig, self.doc_new))
upload["title"] = 'RNA %s:%s' % s(self.doc_id, doc_orig)
upload["description"] = self.doc_new
self._send_xmlrpc(upload)
return ('FINISHED',)
def invoke(self, context, event):
wm = context.manager
wm.invoke_props_popup(self, event)
return ('RUNNING_MODAL',)
bpy.ops.add(MESH_OT_delete_edgeloop)

View File

@@ -1,11 +1,29 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
import os
def expandpath(path):
if path.startswith("//"):
return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
return path
if path.startswith("//"):
return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
return path
import types
bpy.sys = types.ModuleType("bpy.sys")

View File

@@ -1,86 +1,104 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
def collect_baseclasses(_class, bases):
if _class is type or _class is object:
return bases
bases.append(_class)
for _superclass in _class.__bases__:
collect_baseclasses(_superclass, bases)
return bases
if _class is type or _class is object:
return bases
bases.append(_class)
for _superclass in _class.__bases__:
collect_baseclasses(_superclass, bases)
return bases
def collect_subclasses(_class, subs):
if _class is type or _class is object:
return subs
subs.append(_class)
for _subclass in _class.__subclasses__():
collect_subclasses(_subclass, subs)
return subs
if _class is type or _class is object:
return subs
subs.append(_class)
for _subclass in _class.__subclasses__():
collect_subclasses(_subclass, subs)
return subs
class DynMenu(bpy.types.Menu):
def draw(self, context):
'''
This is a draw function that is used to call all subclasses draw functions
starting from the registered classes draw function and working down.
DynMenu.setup() must be called first.
Sort/group classes could be nice
'''
subclass_ls = []
collect_subclasses(self.__class__, subclass_ls)
# print(subclass_ls)
for subclass in subclass_ls:
# print("drawwing", subclass) # , dir(subclass))
subclass.internal_draw(self, context)
# print("subclass.internal_draw", subclass.internal_draw)
def draw(self, context):
'''
This is a draw function that is used to call all subclasses draw functions
starting from the registered classes draw function and working down.
DynMenu.setup() must be called first.
Sort/group classes could be nice
'''
subclass_ls = []
collect_subclasses(self.__class__, subclass_ls)
# print(subclass_ls)
for subclass in subclass_ls:
# print("drawwing", subclass) # , dir(subclass))
subclass.internal_draw(self, context)
# print("subclass.internal_draw", subclass.internal_draw)
def setup(menu_class):
'''
Setup subclasses (not needed when self.add() is used)
'''
bases = collect_baseclasses(menu_class, [])
# Incase 'DynMenu' isnt last
while bases[-1] is not DynMenu:
bases.pop()
bases.pop() # remove 'DynMenu'
root_class = bases[-1] # this is the registered class
for subclass in collect_subclasses(root_class, []):
#print(subclass)
draw = getattr(subclass, 'draw', None)
if draw and not hasattr(subclass, 'internal_draw'):
# print("replace", subclass, draw)
try:
del subclass.draw
except:
pass
subclass.internal_draw = draw
root_class.draw = DynMenu.draw
'''
Setup subclasses (not needed when self.add() is used)
'''
bases = collect_baseclasses(menu_class, [])
# Incase 'DynMenu' isnt last
while bases[-1] is not DynMenu:
bases.pop()
bases.pop() # remove 'DynMenu'
root_class = bases[-1] # this is the registered class
for subclass in collect_subclasses(root_class, []):
#print(subclass)
draw = getattr(subclass, 'draw', None)
if draw and not hasattr(subclass, 'internal_draw'):
# print("replace", subclass, draw)
try:
del subclass.draw
except:
pass
subclass.internal_draw = draw
root_class.draw = DynMenu.draw
def add(menu_class, func):
'''
Add a single function directly without having to make a class
important that the returned value should be stored in the module that called it.
'''
newclass = type('<menuclass>', (menu_class,), {})
newclass.internal_draw = func
setup(menu_class)
return newclass
'''
Add a single function directly without having to make a class
important that the returned value should be stored in the module that called it.
'''
newclass = type('<menuclass>', (menu_class,), {})
newclass.internal_draw = func
setup(menu_class)
return newclass
'''
# so we dont need to import this module

View File

@@ -1,78 +1,96 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# This script must be assigned to a python controller
# where it can access the object that owns it and the sensors/actuators that it connects to.
# GameLogic has been added to the global namespace no need to import
# for keyboard event comparison
# import GameKeys
# import GameKeys
# support for Vector(), Matrix() types and advanced functions like AngleBetweenVecs(v1,v2) and RotationMatrix(...)
# import Mathutils
# import Mathutils
# for functions like getWindowWidth(), getWindowHeight()
# import Rasterizer
def main():
cont = GameLogic.getCurrentController()
# The KX_GameObject that owns this controller.
own = cont.owner
# for scripts that deal with spacial logic
own_pos = own.worldPosition
# Some example functions, remove to write your own script.
# check for a positive sensor, will run on any object without errors.
print 'Logic info for KX_GameObject', own.name
input = False
for sens in cont.sensors:
# The sensor can be on another object, we may want to use it
own_sens = sens.owner
print ' sensor:', sens.name,
if sens.positive:
print '(true)'
input = True
else:
print '(false)'
for actu in cont.actuators:
# The actuator can be on another object, we may want to use it
own_actu = actu.owner
print ' actuator:', actu.name
# This runs the actuator or turns it off
# note that actuators will continue to run unless explicitly turned off.
if input:
cont.activate(actu)
else:
cont.deactivate(actu)
# Its also good practice to get sensors and actuators by name
# rather then index so any changes to their order wont break the script.
# sens_key = cont.sensors['key_sensor']
# actu_motion = cont.actuators['motion']
# Loop through all other objects in the scene
sce = GameLogic.getCurrentScene()
print 'Scene Objects:', sce.name
for ob in sce.objects:
print ' ', ob.name, ob.worldPosition
# Example where collision objects are checked for their properties
# adding to our objects "life" property
"""
actu_collide = cont.sensors['collision_sens']
for ob in actu_collide.objectHitList:
# Check to see the object has this property
if ob.has_key('life'):
own['life'] += ob['life']
ob['life'] = 0
print own['life']
"""
cont = GameLogic.getCurrentController()
# The KX_GameObject that owns this controller.
own = cont.owner
# for scripts that deal with spacial logic
own_pos = own.worldPosition
# Some example functions, remove to write your own script.
# check for a positive sensor, will run on any object without errors.
print 'Logic info for KX_GameObject', own.name
input = False
for sens in cont.sensors:
# The sensor can be on another object, we may want to use it
own_sens = sens.owner
print ' sensor:', sens.name,
if sens.positive:
print '(true)'
input = True
else:
print '(false)'
for actu in cont.actuators:
# The actuator can be on another object, we may want to use it
own_actu = actu.owner
print ' actuator:', actu.name
# This runs the actuator or turns it off
# note that actuators will continue to run unless explicitly turned off.
if input:
cont.activate(actu)
else:
cont.deactivate(actu)
# Its also good practice to get sensors and actuators by name
# rather then index so any changes to their order wont break the script.
# sens_key = cont.sensors['key_sensor']
# actu_motion = cont.actuators['motion']
# Loop through all other objects in the scene
sce = GameLogic.getCurrentScene()
print 'Scene Objects:', sce.name
for ob in sce.objects:
print ' ', ob.name, ob.worldPosition
# Example where collision objects are checked for their properties
# adding to our objects "life" property
"""
actu_collide = cont.sensors['collision_sens']
for ob in actu_collide.objectHitList:
# Check to see the object has this property
if ob.has_key('life'):
own['life'] += ob['life']
ob['life'] = 0
print own['life']
"""
main()

View File

@@ -1,15 +1,32 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
def main():
cont = GameLogic.getCurrentController()
own = cont.owner
sens = cont.sensors['mySensor']
actu = cont.actuators['myActuator']
if sens.positive:
cont.activate(actu)
else:
cont.deactivate(actu)
cont = GameLogic.getCurrentController()
own = cont.owner
sens = cont.sensors['mySensor']
actu = cont.actuators['myActuator']
if sens.positive:
cont.activate(actu)
else:
cont.deactivate(actu)
main()

View File

@@ -1,3 +1,21 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# This module can be accessed by a python controller with
# its execution method set to 'Module'
# * Set the module string to "gamelogic_module.main" (without quotes)
@@ -13,14 +31,14 @@ import GameLogic
# with multiple objects.
def main(cont):
own = cont.owner
sens = cont.sensors['mySensor']
actu = cont.actuators['myActuator']
if sens.positive:
cont.activate(actu)
else:
cont.deactivate(actu)
own = cont.owner
sens = cont.sensors['mySensor']
actu = cont.actuators['myActuator']
if sens.positive:
cont.activate(actu)
else:
cont.deactivate(actu)
# dont call main(GameLogic.getCurrentController()), the py controller will

View File

@@ -1,44 +1,64 @@
def write_some_data(context, path, use_some_setting):
pass
class ExportSomeData(bpy.types.Operator):
'''This appiers in the tooltip of the operator and in the generated docs.'''
__idname__ = "export.some_data" # this is important since its how bpy.ops.export.some_data is constructed
__label__ = "Export Some Data"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
# TODO, add better example props
__props__ = [
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""),
bpy.props.BoolProperty(attr="use_some_setting", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
]
def poll(self, context):
return context.active_object != None
def execute(self, context):
if not self.is_property_set("path"):
raise Exception("filename not set")
write(self.path, context, use_setting, SOME_SETTING = self.use_some_setting)
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
return ('FINISHED',)
def invoke(self, context, event):
wm = context.manager
if True:
# File selector
wm.add_fileselect(self.__operator__) # will run self.execute()
return ('RUNNING_MODAL',)
else if 0:
# Redo popup
wm.invoke_props_popup(self.__operator__, event) #
return ('RUNNING_MODAL',)
else if 0:
return self.execute(context)
import bpy
def write_some_data(context, path, use_some_setting):
pass
from bpy.props import *
class ExportSomeData(bpy.types.Operator):
'''This appiers in the tooltip of the operator and in the generated docs.'''
bl_idname = "export.some_data" # this is important since its how bpy.ops.export.some_data is constructed
bl_label = "Export Some Data"
# List of operator properties, the attributes will be assigned
# to the class instance from the operator settings before calling.
# TODO, add better example props
path = StringProperty(name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
use_some_setting = BoolProperty(name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
def poll(self, context):
return context.active_object != None
def execute(self, context):
if not self.is_property_set("path"):
raise Exception("filename not set")
write(self.path, context, use_setting, SOME_SETTING = self.use_some_setting)
return ('FINISHED',)
def invoke(self, context, event):
wm = context.manager
if True:
# File selector
wm.add_fileselect(self) # will run self.execute()
return ('RUNNING_MODAL',)
else if 0:
# Redo popup
wm.invoke_props_popup(self, event) #
return ('RUNNING_MODAL',)
else if 0:
return self.execute(context)
bpy.ops.add(ExportSomeData)
@@ -50,4 +70,4 @@ menu_item = dynamic_menu.add(bpy.types.INFO_MT_file_export, menu_func)
# Use for running this script directly
if __name__ == "__main__":
bpy.ops.export.some_data(path="/tmp/test.ply")
bpy.ops.export.some_data(path="/tmp/test.ply")

View File

@@ -1,20 +1,38 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
def main(context):
for ob in context.scene.objects:
print(ob)
for ob in context.scene.objects:
print(ob)
class SimpleOperator(bpy.types.Operator):
''''''
__idname__ = "object.simple_operator"
__label__ = "Simple Object Operator"
def poll(self, context):
return context.active_object != None
def execute(self, context):
main(context)
return ('FINISHED',)
''''''
bl_idname = "object.simple_operator"
bl_label = "Simple Object Operator"
def poll(self, context):
return context.active_object != None
def execute(self, context):
main(context)
return ('FINISHED',)
bpy.ops.add(SimpleOperator)
if __name__ == "__main__":
bpy.ops.object.simple_operator()
bpy.ops.object.simple_operator()

View File

@@ -1,183 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return context.armature
class DATA_PT_context_arm(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
arm = context.armature
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif arm:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_skeleton(DataButtonsPanel):
__label__ = "Skeleton"
def draw(self, context):
layout = self.layout
ob = context.object
arm = context.armature
space = context.space_data
layout.itemR(arm, "pose_position", expand=True)
split = layout.split()
col = split.column()
col.itemL(text="Layers:")
col.itemR(arm, "layer", text="")
col.itemL(text="Protected Layers:")
col.itemR(arm, "layer_protection", text="")
col = split.column()
col.itemL(text="Deform:")
col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
col.itemR(arm, "deform_quaternion", text="Quaternion")
col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
class DATA_PT_display(DataButtonsPanel):
__label__ = "Display"
def draw(self, context):
layout = self.layout
arm = context.armature
layout.row().itemR(arm, "drawtype", expand=True)
flow = layout.column_flow()
flow.itemR(arm, "draw_names", text="Names")
flow.itemR(arm, "draw_axes", text="Axes")
flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
flow.itemR(arm, "draw_group_colors", text="Colors")
flow.itemR(arm, "delay_deform", text="Delay Refresh")
class DATA_PT_bone_groups(DataButtonsPanel):
__label__ = "Bone Groups"
def poll(self, context):
return (context.object and context.object.type=='ARMATURE' and context.object.pose)
def draw(self, context):
layout = self.layout
ob = context.object
pose = ob.pose
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
col = row.column(align=True)
col.active = (ob.proxy == None)
col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
group = pose.active_bone_group
if group:
col = layout.column()
col.active= (ob.proxy == None)
col.itemR(group, "name")
split = layout.split(0.5)
split.active= (ob.proxy == None)
split.itemR(group, "color_set")
if group.color_set:
split.template_triColorSet(group, "colors")
row = layout.row(align=True)
row.active = (ob.proxy == None)
row.itemO("pose.group_assign", text="Assign")
row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
#row.itemO("object.bone_group_select", text="Select")
#row.itemO("object.bone_group_deselect", text="Deselect")
class DATA_PT_paths(DataButtonsPanel):
__label__ = "Paths"
def draw(self, context):
layout = self.layout
arm = context.armature
layout.itemR(arm, "paths_type", expand=True)
split = layout.split()
col = split.column()
sub = col.column(align=True)
if (arm.paths_type == 'CURRENT_FRAME'):
sub.itemR(arm, "path_before_current", text="Before")
sub.itemR(arm, "path_after_current", text="After")
elif (arm.paths_type == 'RANGE'):
sub.itemR(arm, "path_start_frame", text="Start")
sub.itemR(arm, "path_end_frame", text="End")
sub.itemR(arm, "path_size", text="Step")
col.row().itemR(arm, "paths_location", expand=True)
col = split.column()
col.itemL(text="Display:")
col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
layout.itemS()
row = layout.row()
row.itemO("pose.paths_calculate", text="Calculate Paths")
row.itemO("pose.paths_clear", text="Clear Paths")
class DATA_PT_ghost(DataButtonsPanel):
__label__ = "Ghost"
def draw(self, context):
layout = self.layout
arm = context.armature
layout.itemR(arm, "ghost_type", expand=True)
split = layout.split()
col = split.column()
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':
sub.itemR(arm, "ghost_start_frame", text="Start")
sub.itemR(arm, "ghost_end_frame", text="End")
sub.itemR(arm, "ghost_size", text="Step")
elif arm.ghost_type == 'CURRENT_FRAME':
sub.itemR(arm, "ghost_step", text="Range")
sub.itemR(arm, "ghost_size", text="Step")
col = split.column()
col.itemL(text="Display:")
col.itemR(arm, "ghost_only_selected", text="Selected Only")
bpy.types.register(DATA_PT_context_arm)
bpy.types.register(DATA_PT_skeleton)
bpy.types.register(DATA_PT_display)
bpy.types.register(DATA_PT_bone_groups)
bpy.types.register(DATA_PT_paths)
bpy.types.register(DATA_PT_ghost)

View File

@@ -1,228 +0,0 @@
import bpy
class BoneButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "bone"
def poll(self, context):
return (context.bone or context.edit_bone)
class BONE_PT_context_bone(BoneButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
bone = context.bone
if not bone:
bone = context.edit_bone
row = layout.row()
row.itemL(text="", icon='ICON_BONE_DATA')
row.itemR(bone, "name", text="")
class BONE_PT_transform(BoneButtonsPanel):
__label__ = "Transform"
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
if not bone:
bone = context.edit_bone
row = layout.row()
row.column().itemR(bone, "head")
row.column().itemR(bone, "tail")
col = row.column()
sub = col.column(align=True)
sub.itemL(text="Roll:")
sub.itemR(bone, "roll", text="")
sub.itemL()
sub.itemR(bone, "locked")
else:
pchan = ob.pose.pose_channels[context.bone.name]
row = layout.row()
col = row.column()
col.itemR(pchan, "location")
col.active = not (bone.parent and bone.connected)
col = row.column()
if pchan.rotation_mode == 'QUATERNION':
col.itemR(pchan, "rotation_quaternion", text="Rotation")
elif pchan.rotation_mode == 'AXIS_ANGLE':
#col.itemL(text="Rotation")
#col.itemR(pchan, "rotation_angle", text="Angle")
#col.itemR(pchan, "rotation_axis", text="Axis")
col.itemR(pchan, "rotation_axis_angle", text="Rotation")
else:
col.itemR(pchan, "rotation_euler", text="Rotation")
row.column().itemR(pchan, "scale")
layout.itemR(pchan, "rotation_mode")
class BONE_PT_transform_locks(BoneButtonsPanel):
__label__ = "Transform Locks"
__default_closed__ = True
def poll(self, context):
return context.bone
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
pchan = ob.pose.pose_channels[context.bone.name]
row = layout.row()
col = row.column()
col.itemR(pchan, "lock_location")
col.active = not (bone.parent and bone.connected)
col = row.column()
if pchan.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
col.itemR(pchan, "lock_rotations_4d", text="Lock Rotation")
if pchan.lock_rotations_4d:
col.itemR(pchan, "lock_rotation_w", text="W")
col.itemR(pchan, "lock_rotation", text="")
else:
col.itemR(pchan, "lock_rotation", text="Rotation")
row.column().itemR(pchan, "lock_scale")
class BONE_PT_relations(BoneButtonsPanel):
__label__ = "Relations"
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
arm = context.armature
if not bone:
bone = context.edit_bone
pchan = None
else:
pchan = ob.pose.pose_channels[context.bone.name]
split = layout.split()
col = split.column()
col.itemL(text="Layers:")
col.itemR(bone, "layer", text="")
col.itemS()
if ob and pchan:
col.itemL(text="Bone Group:")
col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
col = split.column()
col.itemL(text="Parent:")
if context.bone:
col.itemR(bone, "parent", text="")
else:
col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
sub = col.column()
sub.active = bone.parent != None
sub.itemR(bone, "connected")
sub.itemR(bone, "hinge", text="Inherit Rotation")
sub.itemR(bone, "inherit_scale", text="Inherit Scale")
class BONE_PT_display(BoneButtonsPanel):
__label__ = "Display"
def poll(self, context):
return context.bone
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
arm = context.armature
if not bone:
bone = context.edit_bone
pchan = None
else:
pchan = ob.pose.pose_channels[context.bone.name]
if ob and pchan:
split = layout.split()
col = split.column()
col.itemR(bone, "draw_wire", text="Wireframe")
col.itemR(bone, "hidden", text="Hide")
col = split.column()
col.itemL(text="Custom Shape:")
col.itemR(pchan, "custom_shape", text="")
class BONE_PT_deform(BoneButtonsPanel):
__label__ = "Deform"
__default_closed__ = True
def draw_header(self, context):
bone = context.bone
if not bone:
bone = context.edit_bone
self.layout.itemR(bone, "deform", text="")
def draw(self, context):
layout = self.layout
bone = context.bone
if not bone:
bone = context.edit_bone
layout.active = bone.deform
split = layout.split()
col = split.column()
col.itemL(text="Envelope:")
sub = col.column(align=True)
sub.itemR(bone, "envelope_distance", text="Distance")
sub.itemR(bone, "envelope_weight", text="Weight")
col.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
sub = col.column(align=True)
sub.itemL(text="Radius:")
sub.itemR(bone, "head_radius", text="Head")
sub.itemR(bone, "tail_radius", text="Tail")
col = split.column()
col.itemL(text="Curved Bones:")
sub = col.column(align=True)
sub.itemR(bone, "bbone_segments", text="Segments")
sub.itemR(bone, "bbone_in", text="Ease In")
sub.itemR(bone, "bbone_out", text="Ease Out")
col.itemL(text="Offset:")
col.itemR(bone, "cyclic_offset")
bpy.types.register(BONE_PT_context_bone)
bpy.types.register(BONE_PT_transform)
bpy.types.register(BONE_PT_transform_locks)
bpy.types.register(BONE_PT_relations)
bpy.types.register(BONE_PT_display)
bpy.types.register(BONE_PT_deform)

View File

@@ -1,98 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return context.camera
class DATA_PT_context_camera(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
cam = context.camera
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif cam:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_camera(DataButtonsPanel):
__label__ = "Lens"
def draw(self, context):
layout = self.layout
cam = context.camera
layout.itemR(cam, "type", expand=True)
row = layout.row()
if cam.type == 'PERSP':
if cam.lens_unit == 'MILLIMETERS':
row.itemR(cam, "lens", text="Angle")
elif cam.lens_unit == 'DEGREES':
row.itemR(cam, "angle")
row.itemR(cam, "lens_unit", text="")
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
layout.itemR(cam, "panorama")
split = layout.split()
col = split.column(align=True)
col.itemL(text="Shift:")
col.itemR(cam, "shift_x", text="X")
col.itemR(cam, "shift_y", text="Y")
col = split.column(align=True)
col.itemL(text="Clipping:")
col.itemR(cam, "clip_start", text="Start")
col.itemR(cam, "clip_end", text="End")
layout.itemL(text="Depth of Field:")
row = layout.row()
row.itemR(cam, "dof_object", text="")
row.itemR(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(DataButtonsPanel):
__label__ = "Display"
def draw(self, context):
layout = self.layout
cam = context.camera
split = layout.split()
col = split.column()
col.itemR(cam, "show_limits", text="Limits")
col.itemR(cam, "show_mist", text="Mist")
col.itemR(cam, "show_title_safe", text="Title Safe")
col.itemR(cam, "show_name", text="Name")
col = split.column()
col.itemR(cam, "draw_size", text="Size")
col.itemS()
col.itemR(cam, "show_passepartout", text="Passepartout")
sub = col.column()
sub.active = cam.show_passepartout
sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
bpy.types.register(DATA_PT_context_camera)
bpy.types.register(DATA_PT_camera)
bpy.types.register(DATA_PT_camera_display)

View File

@@ -1,225 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
class DataButtonsPanelCurve(DataButtonsPanel):
'''
Same as above but for curves only
'''
def poll(self, context):
return (context.object and context.object.type == 'CURVE' and context.curve)
class DataButtonsPanelActive(DataButtonsPanel):
'''
Same as above but for curves only
'''
def poll(self, context):
curve = context.curve
return (curve and curve.active_spline)
class DATA_PT_context_curve(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif curve:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_shape_curve(DataButtonsPanel):
__label__ = "Shape"
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
is_surf = (ob.type == 'SURFACE')
if not is_surf:
row = layout.row()
row.itemR(curve, "dimensions", expand=True)
split = layout.split()
col = split.column()
if not is_surf:
sub = col.column()
sub.active = (curve.dimensions=='2D')
sub.itemL(text="Caps:")
row = sub.row()
row.itemR(curve, "front")
row.itemR(curve, "back")
col.itemL(text="Textures:")
# col.itemR(curve, "uv_orco")
col.itemR(curve, "auto_texspace")
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(curve, "resolution_u", text="Preview U")
sub.itemR(curve, "render_resolution_u", text="Render U")
if is_surf:
sub = col.column(align=True)
sub.itemR(curve, "resolution_v", text="Preview V")
sub.itemR(curve, "render_resolution_v", text="Render V")
# XXX - put somewhere nicer.
row= layout.row()
row.itemR(curve, "twist_mode")
row.itemR(curve, "twist_smooth") # XXX - may not be kept
# col.itemL(text="Display:")
# col.itemL(text="HANDLES")
# col.itemL(text="NORMALS")
# col.itemR(curve, "vertex_normal_flip")
class DATA_PT_geometry_curve(DataButtonsPanel):
__label__ = "Geometry"
def draw(self, context):
layout = self.layout
curve = context.curve
split = layout.split()
col = split.column()
col.itemL(text="Modification:")
col.itemR(curve, "width")
col.itemR(curve, "extrude")
col.itemL(text="Taper Object:")
col.itemR(curve, "taper_object", text="")
col = split.column()
col.itemL(text="Bevel:")
col.itemR(curve, "bevel_depth", text="Depth")
col.itemR(curve, "bevel_resolution", text="Resolution")
col.itemL(text="Bevel Object:")
col.itemR(curve, "bevel_object", text="")
class DATA_PT_pathanim(DataButtonsPanelCurve):
__label__ = "Path Animation"
def draw_header(self, context):
curve = context.curve
self.layout.itemR(curve, "use_path", text="")
def draw(self, context):
layout = self.layout
curve = context.curve
layout.active = curve.use_path
split = layout.split()
col = split.column()
col.itemR(curve, "path_length", text="Frames")
col.itemR(curve, "use_path_follow")
col = split.column()
col.itemR(curve, "use_stretch")
col.itemR(curve, "use_radius")
col.itemR(curve, "use_time_offset", text="Offset Children")
class DATA_PT_active_spline(DataButtonsPanelActive):
__label__ = "Active Spline"
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
act_spline = curve.active_spline
is_surf = (ob.type == 'SURFACE')
is_poly = (act_spline.type == 'POLY')
split = layout.split()
if is_poly:
# These settings are below but its easier to have
# poly's set aside since they use so few settings
col = split.column()
col.itemL(text="Cyclic:")
col.itemR(act_spline, "smooth")
col = split.column()
col.itemR(act_spline, "cyclic_u", text="U")
else:
col = split.column()
col.itemL(text="Cyclic:")
if act_spline.type == 'NURBS':
col.itemL(text="Bezier:")
col.itemL(text="Endpoint:")
col.itemL(text="Order:")
col.itemL(text="Resolution:")
col = split.column()
col.itemR(act_spline, "cyclic_u", text="U")
if act_spline.type == 'NURBS':
sub = col.column()
# sub.active = (not act_spline.cyclic_u)
sub.itemR(act_spline, "bezier_u", text="U")
sub.itemR(act_spline, "endpoint_u", text="U")
sub = col.column()
sub.itemR(act_spline, "order_u", text="U")
col.itemR(act_spline, "resolution_u", text="U")
if is_surf:
col = split.column()
col.itemR(act_spline, "cyclic_v", text="V")
# its a surface, assume its a nurb.
sub = col.column()
sub.active = (not act_spline.cyclic_v)
sub.itemR(act_spline, "bezier_v", text="V")
sub.itemR(act_spline, "endpoint_v", text="V")
sub = col.column()
sub.itemR(act_spline, "order_v", text="V")
sub.itemR(act_spline, "resolution_v", text="V")
if not is_surf:
split = layout.split()
col = split.column()
col.active = (curve.dimensions=='3D')
col.itemL(text="Interpolation:")
col.itemR(act_spline, "tilt_interpolation", text="Tilt")
col.itemR(act_spline, "radius_interpolation", text="Radius")
split = layout.split()
col = split.column()
col.itemR(act_spline, "smooth")
bpy.types.register(DATA_PT_context_curve)
bpy.types.register(DATA_PT_shape_curve)
bpy.types.register(DATA_PT_geometry_curve)
bpy.types.register(DATA_PT_pathanim)
bpy.types.register(DATA_PT_active_spline)

View File

@@ -1,23 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return (context.object and context.object.type == 'EMPTY')
class DATA_PT_empty(DataButtonsPanel):
__label__ = "Empty"
def draw(self, context):
layout = self.layout
ob = context.object
layout.itemR(ob, "empty_draw_type", text="Display")
layout.itemR(ob, "empty_draw_size", text="Size")
bpy.types.register(DATA_PT_empty)

View File

@@ -1,312 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return context.lamp
class DATA_PT_preview(DataButtonsPanel):
__label__ = "Preview"
def draw(self, context):
self.layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
lamp = context.lamp
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif lamp:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_lamp(DataButtonsPanel):
__label__ = "Lamp"
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.itemR(lamp, "type", expand=True)
split = layout.split()
col = split.column()
sub = col.column()
sub.itemR(lamp, "color", text="")
sub.itemR(lamp, "energy")
if lamp.type in ('POINT', 'SPOT'):
sub.itemL(text="Falloff:")
sub.itemR(lamp, "falloff_type", text="")
sub.itemR(lamp, "distance")
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
col.itemL(text="Attenuation Factors:")
sub = col.column(align=True)
sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
col.itemR(lamp, "sphere")
if lamp.type == 'AREA':
col.itemR(lamp, "distance")
col.itemR(lamp, "gamma")
col = split.column()
col.itemR(lamp, "negative")
col.itemR(lamp, "layer", text="This Layer Only")
col.itemR(lamp, "specular")
col.itemR(lamp, "diffuse")
class DATA_PT_sunsky(DataButtonsPanel):
__label__ = "Sky & Atmosphere"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type == 'SUN')
def draw(self, context):
layout = self.layout
lamp = context.lamp.sky
layout.itemR(lamp, "sky")
row = layout.row()
row.active = lamp.sky or lamp.atmosphere
row.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
split = layout.split()
col = split.column()
col.active = lamp.sky
col.itemL(text="Blending:")
sub = col.column()
sub.itemR(lamp, "sky_blend_type", text="")
sub.itemR(lamp, "sky_blend", text="Factor")
col.itemL(text="Color Space:")
sub = col.column()
sub.row().itemR(lamp, "sky_color_space", expand=True)
sub.itemR(lamp, "sky_exposure", text="Exposure")
col = split.column()
col.active = lamp.sky
col.itemL(text="Horizon:")
sub = col.column()
sub.itemR(lamp, "horizon_brightness", text="Brightness")
sub.itemR(lamp, "spread", text="Spread")
col.itemL(text="Sun:")
sub = col.column()
sub.itemR(lamp, "sun_brightness", text="Brightness")
sub.itemR(lamp, "sun_size", text="Size")
sub.itemR(lamp, "backscattered_light", slider=True,text="Back Light")
layout.itemS()
layout.itemR(lamp, "atmosphere")
split = layout.split()
col = split.column()
col.active = lamp.atmosphere
col.itemL(text="Intensity:")
col.itemR(lamp, "sun_intensity", text="Sun")
col.itemR(lamp, "atmosphere_distance_factor", text="Distance")
col = split.column()
col.active = lamp.atmosphere
col.itemL(text="Scattering:")
sub = col.column(align=True)
sub.itemR(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
sub.itemR(lamp, "atmosphere_extinction", slider=True ,text="Extinction")
class DATA_PT_shadow(DataButtonsPanel):
__label__ = "Shadow"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type in ('POINT','SUN', 'SPOT', 'AREA'))
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.itemR(lamp, "shadow_method", expand=True)
if lamp.shadow_method != 'NOSHADOW':
split = layout.split()
col = split.column()
col.itemR(lamp, "shadow_color", text="")
col = split.column()
col.itemR(lamp, "shadow_layer", text="This Layer Only")
col.itemR(lamp, "only_shadow")
if lamp.shadow_method == 'RAY_SHADOW':
col = layout.column()
col.itemL(text="Sampling:")
col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
if lamp.type in ('POINT', 'SUN', 'SPOT'):
split = layout.split()
col = split.column()
col.itemR(lamp, "shadow_soft_size", text="Soft Size")
col.itemR(lamp, "shadow_ray_samples", text="Samples")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
col = split.column()
elif lamp.type == 'AREA':
split = layout.split()
col = split.column()
sub = split.column(align=True)
if lamp.shape == 'SQUARE':
col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
col.itemR(lamp, "shadow_ray_samples_x", text="Samples X")
col.itemR(lamp, "shadow_ray_samples_y", text="Samples Y")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
sub.itemR(lamp, "umbra")
sub.itemR(lamp, "dither")
sub.itemR(lamp, "jitter")
elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
col.itemL(text="Buffer Type:")
col.row().itemR(lamp, "shadow_buffer_type", expand=True)
if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
split = layout.split()
col = split.column()
col.itemL(text="Filter Type:")
col.itemR(lamp, "shadow_filter_type", text="")
sub = col.column(align=True)
sub.itemR(lamp, "shadow_buffer_soft", text="Soft")
sub.itemR(lamp, "shadow_buffer_bias", text="Bias")
col = split.column()
col.itemL(text="Sample Buffers:")
col.itemR(lamp, "shadow_sample_buffers", text="")
sub = col.column(align=True)
sub.itemR(lamp, "shadow_buffer_size", text="Size")
sub.itemR(lamp, "shadow_buffer_samples", text="Samples")
if lamp.shadow_buffer_type == 'DEEP':
col.itemR(lamp, "compression_threshold")
elif lamp.shadow_buffer_type == 'IRREGULAR':
layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
row = layout.row()
row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
sub = row.row()
sub.active = not lamp.auto_clip_start
sub.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
row = layout.row()
row.itemR(lamp, "auto_clip_end", text="Autoclip End")
sub = row.row()
sub.active = not lamp.auto_clip_end
sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
class DATA_PT_area(DataButtonsPanel):
__label__ = "Area Shape"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type == 'AREA')
def draw(self, context):
layout = self.layout
lamp = context.lamp
split = layout.split()
col = split.column()
col.row().itemR(lamp, "shape", expand=True)
sub = col.column(align=True)
if (lamp.shape == 'SQUARE'):
sub.itemR(lamp, "size")
elif (lamp.shape == 'RECTANGLE'):
sub.itemR(lamp, "size", text="Size X")
sub.itemR(lamp, "size_y", text="Size Y")
class DATA_PT_spot(DataButtonsPanel):
__label__ = "Spot Shape"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type == 'SPOT')
def draw(self, context):
layout = self.layout
lamp = context.lamp
split = layout.split()
col = split.column()
sub = col.column()
sub.itemR(lamp, "spot_size", text="Size")
sub.itemR(lamp, "spot_blend", text="Blend", slider=True)
col.itemR(lamp, "square")
col = split.column()
col.itemR(lamp, "halo")
sub = col.column(align=True)
sub.active = lamp.halo
sub.itemR(lamp, "halo_intensity", text="Intensity")
if lamp.shadow_method == 'BUFFER_SHADOW':
sub.itemR(lamp, "halo_step", text="Step")
class DATA_PT_falloff_curve(DataButtonsPanel):
__label__ = "Falloff Curve"
__default_closed__ = True
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
def draw(self, context):
lamp = context.lamp
self.layout.template_curve_mapping(lamp, "falloff_curve")
bpy.types.register(DATA_PT_context_lamp)
bpy.types.register(DATA_PT_preview)
bpy.types.register(DATA_PT_lamp)
bpy.types.register(DATA_PT_falloff_curve)
bpy.types.register(DATA_PT_area)
bpy.types.register(DATA_PT_spot)
bpy.types.register(DATA_PT_shadow)
bpy.types.register(DATA_PT_sunsky)

View File

@@ -1,56 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return context.lattice
class DATA_PT_context_lattice(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
lat = context.lattice
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif lat:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_lattice(DataButtonsPanel):
__label__ = "Lattice"
def draw(self, context):
layout = self.layout
lat = context.lattice
row = layout.row()
row.itemR(lat, "points_u")
row.itemR(lat, "interpolation_type_u", expand=True)
row = layout.row()
row.itemR(lat, "points_v")
row.itemR(lat, "interpolation_type_v", expand=True)
row = layout.row()
row.itemR(lat, "points_w")
row.itemR(lat, "interpolation_type_w", expand=True)
row = layout.row()
row.itemO("lattice.make_regular")
row.itemR(lat, "outside")
bpy.types.register(DATA_PT_context_lattice)
bpy.types.register(DATA_PT_lattice)

View File

@@ -1,242 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return context.mesh
class DATA_PT_context_mesh(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
mesh = context.mesh
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif mesh:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_normals(DataButtonsPanel):
__label__ = "Normals"
def draw(self, context):
layout = self.layout
mesh = context.mesh
split = layout.split()
col = split.column()
col.itemR(mesh, "autosmooth")
sub = col.column()
sub.active = mesh.autosmooth
sub.itemR(mesh, "autosmooth_angle", text="Angle")
col = split.column()
col.itemR(mesh, "vertex_normal_flip")
col.itemR(mesh, "double_sided")
class DATA_PT_settings(DataButtonsPanel):
__label__ = "Settings"
def draw(self, context):
layout = self.layout
mesh = context.mesh
split = layout.split()
col = split.column()
col.itemR(mesh, "texture_mesh")
class DATA_PT_vertex_groups(DataButtonsPanel):
__label__ = "Vertex Groups"
def poll(self, context):
return (context.object and context.object.type in ('MESH', 'LATTICE'))
def draw(self, context):
layout = self.layout
ob = context.object
group = ob.active_vertex_group
rows = 2
if group:
rows= 5
row = layout.row()
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
col = row.column(align=True)
col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
col.itemO("object.vertex_group_copy", icon='ICON_COPY_ID', text="")
if ob.data.users > 1:
col.itemO("object.vertex_group_copy_to_linked", icon='ICON_LINK_AREA', text="")
if group:
row = layout.row()
row.itemR(group, "name")
if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
row = layout.row()
sub = row.row(align=True)
sub.itemO("object.vertex_group_assign", text="Assign")
sub.itemO("object.vertex_group_remove_from", text="Remove")
sub = row.row(align=True)
sub.itemO("object.vertex_group_select", text="Select")
sub.itemO("object.vertex_group_deselect", text="Deselect")
layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
class DATA_PT_shape_keys(DataButtonsPanel):
__label__ = "Shape Keys"
def poll(self, context):
return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE'))
def draw(self, context):
layout = self.layout
ob = context.object
key = ob.data.shape_keys
kb = ob.active_shape_key
enable_edit = ob.mode != 'EDIT'
enable_edit_value = False
if ob.shape_key_lock == False:
if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
enable_edit_value = True
row = layout.row()
rows = 2
if kb:
rows= 5
row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows)
col = row.column()
subcol = col.column(align=True)
subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
if kb:
col.itemS()
subcol = col.column(align=True)
subcol.item_enumO("object.shape_key_move", "type", 'UP', icon='ICON_TRIA_UP', text="")
subcol.item_enumO("object.shape_key_move", "type", 'DOWN', icon='ICON_TRIA_DOWN', text="")
split = layout.split(percentage=0.4)
sub = split.row()
sub.enabled = enable_edit
sub.itemR(key, "relative")
sub = split.row()
sub.alignment = 'RIGHT'
subrow = sub.row(align=True)
subrow.active= enable_edit_value
subrow.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
subrow.itemR(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
subrow.itemO("object.shape_key_clear", icon='ICON_X', text="")
sub.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
sub.itemR(ob, "shape_key_edit_mode", text="")
row = layout.row()
row.itemR(kb, "name")
if key.relative:
if ob.active_shape_key_index != 0:
row = layout.row()
row.active = enable_edit_value
row.itemR(kb, "value")
split = layout.split()
sub = split.column(align=True)
sub.active = enable_edit_value
sub.itemL(text="Range:")
sub.itemR(kb, "slider_min", text="Min")
sub.itemR(kb, "slider_max", text="Max")
sub = split.column(align=True)
sub.active = enable_edit_value
sub.itemL(text="Blend:")
sub.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
sub.item_pointerR(kb, "relative_key", key, "keys", text="")
else:
row = layout.row()
row.active = enable_edit_value
row.itemR(key, "slurph")
class DATA_PT_uv_texture(DataButtonsPanel):
__label__ = "UV Texture"
def draw(self, context):
layout = self.layout
me = context.mesh
row = layout.row()
col = row.column()
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
col = row.column(align=True)
col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_uv_texture
if lay:
layout.itemR(lay, "name")
class DATA_PT_vertex_colors(DataButtonsPanel):
__label__ = "Vertex Colors"
def draw(self, context):
layout = self.layout
me = context.mesh
row = layout.row()
col = row.column()
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
col = row.column(align=True)
col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_vertex_color
if lay:
layout.itemR(lay, "name")
bpy.types.register(DATA_PT_context_mesh)
bpy.types.register(DATA_PT_normals)
bpy.types.register(DATA_PT_settings)
bpy.types.register(DATA_PT_vertex_groups)
bpy.types.register(DATA_PT_shape_keys)
bpy.types.register(DATA_PT_uv_texture)
bpy.types.register(DATA_PT_vertex_colors)

View File

@@ -1,106 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return context.meta_ball
class DATA_PT_context_metaball(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
mball = context.meta_ball
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif mball:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_metaball(DataButtonsPanel):
__label__ = "Metaball"
def draw(self, context):
layout = self.layout
mball = context.meta_ball
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(mball, "wire_size", text="View")
sub.itemR(mball, "render_size", text="Render")
col = split.column()
col.itemL(text="Settings:")
col.itemR(mball, "threshold", text="Threshold")
layout.itemL(text="Update:")
layout.itemR(mball, "flag", expand=True)
class DATA_PT_metaball_element(DataButtonsPanel):
__label__ = "Active Element"
def poll(self, context):
return (context.meta_ball and context.meta_ball.active_element)
def draw(self, context):
layout = self.layout
metaelem = context.meta_ball.active_element
split = layout.split(percentage=0.3)
split.itemL(text="Type:")
split.itemR(metaelem, "type", text="")
split = layout.split()
col = split.column()
col.itemL(text="Settings:")
col.itemR(metaelem, "stiffness", text="Stiffness")
col.itemR(metaelem, "negative", text="Negative")
col.itemR(metaelem, "hide", text="Hide")
if metaelem.type == 'BALL':
col = split.column(align=True)
elif metaelem.type == 'CUBE':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
col.itemR(metaelem, "size_y", text="Y")
col.itemR(metaelem, "size_z", text="Z")
elif metaelem.type == 'TUBE':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
elif metaelem.type == 'PLANE':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
col.itemR(metaelem, "size_y", text="Y")
elif metaelem.type == 'ELLIPSOID':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
col.itemR(metaelem, "size_y", text="Y")
col.itemR(metaelem, "size_z", text="Z")
bpy.types.register(DATA_PT_context_metaball)
bpy.types.register(DATA_PT_metaball)
bpy.types.register(DATA_PT_metaball_element)

View File

@@ -1,449 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "modifier"
class DATA_PT_modifiers(DataButtonsPanel):
__label__ = "Modifiers"
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.item_menu_enumO("object.modifier_add", "type")
row.itemL()
for md in ob.modifiers:
box = layout.template_modifier(md)
if box:
# match enum type to our functions, avoids a lookup table.
getattr(self, md.type)(box, ob, md)
# the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements
# so each type must have a function here.
def ARMATURE(self, layout, ob, md):
layout.itemR(md, "object")
split = layout.split(percentage=0.5)
split.itemL(text="Vertex Group:")
sub = split.split(percentage=0.7)
sub.item_pointerR(md, "vertex_group", ob, "vertex_groups", text="")
subsub = sub.row()
subsub.active = md.vertex_group
subsub.itemR(md, "invert")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Bind To:")
col.itemR(md, "use_vertex_groups", text="Vertex Groups")
col.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
col = split.column()
col.itemL(text="Deformation:")
col.itemR(md, "quaternion")
col.itemR(md, "multi_modifier")
def ARRAY(self, layout, ob, md):
layout.itemR(md, "fit_type")
if md.fit_type == 'FIXED_COUNT':
layout.itemR(md, "count")
elif md.fit_type == 'FIT_LENGTH':
layout.itemR(md, "length")
elif md.fit_type == 'FIT_CURVE':
layout.itemR(md, "curve")
layout.itemS()
split = layout.split()
col = split.column()
col.itemR(md, "constant_offset")
sub = col.column()
sub.active = md.constant_offset
sub.itemR(md, "constant_offset_displacement", text="")
col.itemS()
col.itemR(md, "merge_adjacent_vertices", text="Merge")
sub = col.column()
sub.active = md.merge_adjacent_vertices
sub.itemR(md, "merge_end_vertices", text="First Last")
sub.itemR(md, "merge_distance", text="Distance")
col = split.column()
col.itemR(md, "relative_offset")
sub = col.column()
sub.active = md.relative_offset
sub.itemR(md, "relative_offset_displacement", text="")
col.itemS()
col.itemR(md, "add_offset_object")
sub = col.column()
sub.active = md.add_offset_object
sub.itemR(md, "offset_object", text="")
layout.itemS()
col = layout.column()
col.itemR(md, "start_cap")
col.itemR(md, "end_cap")
def BEVEL(self, layout, ob, md):
row = layout.row()
row.itemR(md, "width")
row.itemR(md, "only_vertices")
layout.itemL(text="Limit Method:")
layout.row().itemR(md, "limit_method", expand=True)
if md.limit_method == 'ANGLE':
layout.itemR(md, "angle")
elif md.limit_method == 'WEIGHT':
layout.row().itemR(md, "edge_weight_method", expand=True)
def BOOLEAN(self, layout, ob, md):
layout.itemR(md, "operation")
layout.itemR(md, "object")
def BUILD(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemR(md, "start")
col.itemR(md, "length")
col = split.column()
col.itemR(md, "randomize")
sub = col.column()
sub.active = md.randomize
sub.itemR(md, "seed")
def CAST(self, layout, ob, md):
layout.itemR(md, "cast_type")
layout.itemR(md, "object")
if md.object:
layout.itemR(md, "use_transform")
flow = layout.column_flow()
flow.itemR(md, "x")
flow.itemR(md, "y")
flow.itemR(md, "z")
flow.itemR(md, "factor")
flow.itemR(md, "radius")
flow.itemR(md, "size")
layout.itemR(md, "from_radius")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
def CLOTH(self, layout, ob, md):
layout.itemL(text="See Cloth panel.")
def COLLISION(self, layout, ob, md):
layout.itemL(text="See Collision panel.")
def CURVE(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "deform_axis")
def DECIMATE(self, layout, ob, md):
layout.itemR(md, "ratio")
layout.itemR(md, "face_count")
def DISPLACE(self, layout, ob, md):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "texture")
layout.itemR(md, "midlevel")
layout.itemR(md, "strength")
layout.itemR(md, "direction")
layout.itemR(md, "texture_coordinates")
if md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinate_object", text="Object")
elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
def EDGE_SPLIT(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemR(md, "use_edge_angle", text="Edge Angle")
sub = col.column()
sub.active = md.use_edge_angle
sub.itemR(md, "split_angle")
col = split.column()
col.itemR(md, "use_sharp", text="Sharp Edges")
def EXPLODE(self, layout, ob, md):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "protect")
flow = layout.column_flow(2)
flow.itemR(md, "split_edges")
flow.itemR(md, "unborn")
flow.itemR(md, "alive")
flow.itemR(md, "dead")
layout.itemO("object.explode_refresh", text="Refresh");
def FLUID_SIMULATION(self, layout, ob, md):
layout.itemL(text="See Fluid panel.")
def HOOK(self, layout, ob, md):
col = layout.column()
col.itemR(md, "object")
if md.object and md.object.type == 'ARMATURE':
layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
split = layout.split()
split.itemR(md, "falloff")
split.itemR(md, "force", slider=True)
layout.itemS()
row = layout.row()
row.itemO("object.hook_reset", text="Reset")
row.itemO("object.hook_recenter", text="Recenter")
if ob.mode == 'EDIT':
row = layout.row()
row.itemO("object.hook_select", text="Select")
row.itemO("object.hook_assign", text="Assign")
def LATTICE(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
def MASK(self, layout, ob, md):
layout.itemR(md, "mode")
if md.mode == 'ARMATURE':
layout.itemR(md, "armature")
elif md.mode == 'VERTEX_GROUP':
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "inverse")
def MESH_DEFORM(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "invert")
layout.itemS()
if md.is_bound:
layout.itemO("object.meshdeform_bind", text="Unbind")
else:
layout.itemO("object.meshdeform_bind", text="Bind")
row = layout.row()
row.itemR(md, "precision")
row.itemR(md, "dynamic")
def MIRROR(self, layout, ob, md):
layout.itemR(md, "merge_limit")
split = layout.split()
col = split.column()
col.itemR(md, "x")
col.itemR(md, "y")
col.itemR(md, "z")
col = split.column()
col.itemL(text="Textures:")
col.itemR(md, "mirror_u")
col.itemR(md, "mirror_v")
col = split.column()
col.itemR(md, "clip", text="Do Clipping")
col.itemR(md, "mirror_vertex_groups", text="Vertex Group")
layout.itemR(md, "mirror_object")
def MULTIRES(self, layout, ob, md):
layout.itemR(md, "subdivision_type")
row = layout.row()
row.itemO("object.multires_subdivide", text="Subdivide")
row.itemO("object.multires_higher_levels_delete", text="Delete Higher")
layout.itemR(md, "level")
def PARTICLE_INSTANCE(self, layout, ob, md):
layout.itemR(md, "object")
layout.itemR(md, "particle_system_number")
flow = layout.column_flow()
flow.itemR(md, "normal")
flow.itemR(md, "children")
flow.itemR(md, "size")
flow.itemR(md, "path")
if md.path:
flow.itemR(md, "keep_shape")
flow.itemR(md, "unborn")
flow.itemR(md, "alive")
flow.itemR(md, "dead")
flow.itemL(md, "")
if md.path:
flow.itemR(md, "axis", text="")
if md.path:
row = layout.row()
row.itemR(md, "position", slider=True)
row.itemR(md, "random_position", text = "Random", slider=True)
def PARTICLE_SYSTEM(self, layout, ob, md):
layout.itemL(text="See Particle panel.")
def SHRINKWRAP(self, layout, ob, md):
layout.itemR(md, "target")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "offset")
layout.itemR(md, "subsurf_levels")
layout.itemR(md, "mode")
if md.mode == 'PROJECT':
layout.itemR(md, "subsurf_levels")
layout.itemR(md, "auxiliary_target")
row = layout.row()
row.itemR(md, "x")
row.itemR(md, "y")
row.itemR(md, "z")
flow = layout.column_flow()
flow.itemR(md, "negative")
flow.itemR(md, "positive")
flow.itemR(md, "cull_front_faces")
flow.itemR(md, "cull_back_faces")
elif md.mode == 'NEAREST_SURFACEPOINT':
layout.itemR(md, "keep_above_surface")
def SIMPLE_DEFORM(self, layout, ob, md):
layout.itemR(md, "mode")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "origin")
layout.itemR(md, "relative")
layout.itemR(md, "factor")
layout.itemR(md, "limits")
if md.mode in ('TAPER', 'STRETCH'):
layout.itemR(md, "lock_x_axis")
layout.itemR(md, "lock_y_axis")
def SMOKE(self, layout, ob, md):
layout.itemL(text="See Smoke panel.")
def SMOOTH(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemR(md, "x")
col.itemR(md, "y")
col.itemR(md, "z")
col = split.column()
col.itemR(md, "factor")
col.itemR(md, "repeat")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
def SOFT_BODY(self, layout, ob, md):
layout.itemL(text="See Soft Body panel.")
def SUBSURF(self, layout, ob, md):
layout.row().itemR(md, "subdivision_type", expand=True)
flow = layout.column_flow()
flow.itemR(md, "levels", text="Preview")
flow.itemR(md, "render_levels", text="Render")
flow.itemR(md, "optimal_draw", text="Optimal Display")
flow.itemR(md, "subsurf_uv")
def SURFACE(self, layout, ob, md):
layout.itemL(text="See Fields panel.")
def UV_PROJECT(self, layout, ob, md):
if ob.type == 'MESH':
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
layout.itemR(md, "image")
layout.itemR(md, "override_image")
split = layout.split()
col = split.column()
col.itemL(text="Aspect Ratio:")
sub = col.column(align=True)
sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
col = split.column()
col.itemL(text="Projectors:")
sub = col.column(align=True)
sub.itemR(md, "num_projectors", text="Number")
for proj in md.projectors:
sub.itemR(proj, "object", text="")
def WAVE(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemL(text="Motion:")
col.itemR(md, "x")
col.itemR(md, "y")
col.itemR(md, "cyclic")
col = split.column()
col.itemR(md, "normals")
sub = col.column()
sub.active = md.normals
sub.itemR(md, "x_normal", text="X")
sub.itemR(md, "y_normal", text="Y")
sub.itemR(md, "z_normal", text="Z")
split = layout.split()
col = split.column()
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(md, "time_offset", text="Offset")
sub.itemR(md, "lifetime", text="Life")
col.itemR(md, "damping_time", text="Damping")
col = split.column()
col.itemL(text="Position:")
sub = col.column(align=True)
sub.itemR(md, "start_position_x", text="X")
sub.itemR(md, "start_position_y", text="Y")
col.itemR(md, "falloff_radius", text="Falloff")
layout.itemS()
layout.itemR(md, "start_position_object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "texture")
layout.itemR(md, "texture_coordinates")
if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
elif md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinates_object")
layout.itemS()
flow = layout.column_flow()
flow.itemR(md, "speed", slider=True)
flow.itemR(md, "height", slider=True)
flow.itemR(md, "width", slider=True)
flow.itemR(md, "narrowness", slider=True)
bpy.types.register(DATA_PT_modifiers)

View File

@@ -1,179 +0,0 @@
import bpy
class DataButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "data"
def poll(self, context):
return (context.object and context.object.type == 'TEXT' and context.curve)
class DATA_PT_context_text(DataButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif curve:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_shape_text(DataButtonsPanel):
__label__ = "Shape Text"
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
split = layout.split()
col = split.column()
col.itemL(text="Caps:")
row = col.row()
row .itemR(curve, "front")
row .itemR(curve, "back")
# col = split.column()
col.itemL(text="Textures:")
col.itemR(curve, "uv_orco")
col.itemR(curve, "auto_texspace")
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(curve, "resolution_u", text="Preview")
sub.itemR(curve, "render_resolution_u", text="Render")
# resolution_v is not used for text
sub = col.column(align=True)
col.itemL(text="Display:")
col.itemR(curve, "fast", text="Fast Editing")
class DATA_PT_geometry_text(DataButtonsPanel):
__label__ = "Geometry"
def draw(self, context):
layout = self.layout
curve = context.curve
split = layout.split()
col = split.column()
col.itemL(text="Modification:")
col.itemR(curve, "width")
col.itemR(curve, "extrude")
col.itemL(text="Taper Object:")
col.itemR(curve, "taper_object", text="")
col = split.column()
col.itemL(text="Bevel:")
col.itemR(curve, "bevel_depth", text="Depth")
col.itemR(curve, "bevel_resolution", text="Resolution")
col.itemL(text="Bevel Object:")
col.itemR(curve, "bevel_object", text="")
class DATA_PT_font(DataButtonsPanel):
__label__ = "Font"
def draw(self, context):
layout = self.layout
text = context.curve
char = context.curve.edit_format
layout.itemR(text, "font")
row = layout.row()
row.itemR(text, "text_size", text="Size")
row.itemR(text, "shear")
split = layout.split()
col = split.column()
col.itemL(text="Object Font:")
col.itemR(text, "family", text="")
col = split.column()
col.itemL(text="Text on Curve:")
col.itemR(text, "text_on_curve", text="")
split = layout.split()
col = split.column()
col.itemL(text="Character:")
col.itemR(char, "bold")
col.itemR(char, "italic")
col.itemR(char, "underline")
# col.itemR(char, "style")
# col.itemR(char, "wrap")
col = split.column(align=True)
col.itemL(text="Underline:")
col.itemR(text, "ul_position", text="Position")
col.itemR(text, "ul_height", text="Thickness")
class DATA_PT_paragraph(DataButtonsPanel):
__label__ = "Paragraph"
def draw(self, context):
layout = self.layout
text = context.curve
layout.itemL(text="Align:")
layout.itemR(text, "spacemode", expand=True)
split = layout.split()
col = split.column(align=True)
col.itemL(text="Spacing:")
col.itemR(text, "spacing", text="Character")
col.itemR(text, "word_spacing", text="Word")
col.itemR(text, "line_dist", text="Line")
col = split.column(align=True)
col.itemL(text="Offset:")
col.itemR(text, "offset_x", text="X")
col.itemR(text, "offset_y", text="Y")
class DATA_PT_textboxes(DataButtonsPanel):
__label__ = "Text Boxes"
def draw(self, context):
layout = self.layout
text = context.curve
for box in text.textboxes:
split = layout.box().split()
col = split.column(align=True)
col.itemL(text="Dimensions:")
col.itemR(box, "width", text="Width")
col.itemR(box, "height", text="Height")
col = split.column(align=True)
col.itemL(text="Offset:")
col.itemR(box, "x", text="X")
col.itemR(box, "y", text="Y")
bpy.types.register(DATA_PT_context_text)
bpy.types.register(DATA_PT_shape_text)
bpy.types.register(DATA_PT_geometry_text)
bpy.types.register(DATA_PT_font)
bpy.types.register(DATA_PT_paragraph)
bpy.types.register(DATA_PT_textboxes)

View File

@@ -1,416 +0,0 @@
import bpy
class PhysicsButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
ob = context.active_object
rd = context.scene.render_data
return ob and ob.game and (rd.engine == 'BLENDER_GAME')
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
__label__ = "Physics"
def draw(self, context):
layout = self.layout
ob = context.active_object
game = ob.game
soft = ob.game.soft_body
layout.itemR(game, "physics_type")
layout.itemS()
#if game.physics_type == 'DYNAMIC':
if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
split = layout.split()
col = split.column()
col.itemR(game, "actor")
col.itemR(game, "ghost")
col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
col = split.column()
col.itemR(game, "material_physics")
col.itemR(game, "rotate_from_normal")
col.itemR(game, "no_sleeping")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Attributes:")
col.itemR(game, "mass")
col.itemR(game, "radius")
col.itemR(game, "form_factor")
col = split.column()
sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY')
sub.itemR(game, "anisotropic_friction")
subsub = sub.column()
subsub.active = game.anisotropic_friction
subsub.itemR(game, "friction_coefficients", text="", slider=True)
split = layout.split()
col = split.column()
col.itemL(text="Velocity:")
sub = col.column(align=True)
sub.itemR(game, "minimum_velocity", text="Minimum")
sub.itemR(game, "maximum_velocity", text="Maximum")
col = split.column()
col.itemL(text="Damping:")
sub = col.column(align=True)
sub.itemR(game, "damping", text="Translation", slider=True)
sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Lock Translation:")
col.itemR(game, "lock_x_axis", text="X")
col.itemR(game, "lock_y_axis", text="Y")
col.itemR(game, "lock_z_axis", text="Z")
col = split.column()
col.itemL(text="Lock Rotation:")
col.itemR(game, "lock_x_rot_axis", text="X")
col.itemR(game, "lock_y_rot_axis", text="Y")
col.itemR(game, "lock_z_rot_axis", text="Z")
elif game.physics_type == 'SOFT_BODY':
col = layout.column()
col.itemR(game, "actor")
col.itemR(game, "ghost")
col.itemR(ob, "restrict_render", text="Invisible")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Attributes:")
col.itemR(game, "mass")
col.itemR(soft, "welding")
col.itemR(soft, "position_iterations")
col.itemR(soft, "linstiff", slider=True)
col.itemR(soft, "dynamic_friction", slider=True)
col.itemR(soft, "margin", slider=True)
col.itemR(soft, "bending_const", text="Bending Constraints")
col = split.column()
col.itemR(soft, "shape_match")
sub = col.column()
sub.active = soft.shape_match
sub.itemR(soft, "threshold", slider=True)
col.itemS()
col.itemL(text="Cluster Collision:")
col.itemR(soft, "cluster_rigid_to_softbody")
col.itemR(soft, "cluster_soft_to_softbody")
sub = col.column()
sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
sub.itemR(soft, "cluster_iterations", text="Iterations")
elif game.physics_type == 'STATIC':
col = layout.column()
col.itemR(game, "actor")
col.itemR(game, "ghost")
col.itemR(ob, "restrict_render", text="Invisible")
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
layout.itemR(ob, "restrict_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
__label__ = "Collision Bounds"
def poll(self, context):
game = context.object.game
rd = context.scene.render_data
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
def draw_header(self, context):
game = context.active_object.game
self.layout.itemR(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
game = context.active_object.game
layout.active = game.use_collision_bounds
layout.itemR(game, "collision_bounds", text="Bounds")
row = layout.row()
row.itemR(game, "collision_compound", text="Compound")
row.itemR(game, "collision_margin", text="Margin", slider=True)
bpy.types.register(PHYSICS_PT_game_physics)
bpy.types.register(PHYSICS_PT_game_collision_bounds)
class RenderButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "render"
def poll(self, context):
rd = context.scene.render_data
return (rd.engine == 'BLENDER_GAME')
class RENDER_PT_game(RenderButtonsPanel):
__label__ = "Game"
def draw(self, context):
layout = self.layout
row = layout.row()
row.itemO("view3d.game_start", text="Start")
row.itemL()
class RENDER_PT_game_player(RenderButtonsPanel):
__label__ = "Standalone Player"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemR(gs, "fullscreen")
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(gs, "resolution_x", slider=False, text="X")
sub.itemR(gs, "resolution_y", slider=False, text="Y")
col = split.column()
col.itemL(text="Quality:")
sub = col.column(align=True)
sub.itemR(gs, "depth", text="Bit Depth", slider=False)
sub.itemR(gs, "frequency", text="FPS", slider=False)
# framing:
col = layout.column()
col.itemL(text="Framing:")
col.row().itemR(gs, "framing_type", expand=True)
if gs.framing_type == 'LETTERBOX':
col.itemR(gs, "framing_color", text="")
class RENDER_PT_game_stereo(RenderButtonsPanel):
__label__ = "Stereo"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
stereo_mode = gs.stereo
# stereo options:
layout.itemR(gs, "stereo", expand=True)
# stereo:
if stereo_mode == 'STEREO':
layout.itemR(gs, "stereo_mode")
layout.itemL(text="To do: Focal Length")
layout.itemL(text="To do: Eye Separation")
# dome:
elif stereo_mode == 'DOME':
layout.itemR(gs, "dome_mode", text="Dome Type")
dome_type = gs.dome_mode
split=layout.split()
if dome_type == 'FISHEYE' or \
dome_type == 'TRUNCATED_REAR' or \
dome_type == 'TRUNCATED_FRONT':
col=split.column()
col.itemR(gs, "dome_angle", slider=True)
col.itemR(gs, "dome_tilt")
col=split.column()
col.itemR(gs, "dome_tesselation", text="Tesselation")
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
elif dome_type == 'PANORAM_SPH':
col=split.column()
col.itemR(gs, "dome_tesselation", text="Tesselation")
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
else: # cube map
col=split.column()
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
layout.itemR(gs, "dome_text")
class RENDER_PT_game_shading(RenderButtonsPanel):
__label__ = "Shading"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemR(gs, "material_mode", expand=True)
if gs.material_mode == 'GLSL':
split = layout.split()
col = split.column()
col.itemR(gs, "glsl_lights", text="Lights")
col.itemR(gs, "glsl_shaders", text="Shaders")
col.itemR(gs, "glsl_shadows", text="Shadows")
col = split.column()
col.itemR(gs, "glsl_ramps", text="Ramps")
col.itemR(gs, "glsl_nodes", text="Nodes")
col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
class RENDER_PT_game_performance(RenderButtonsPanel):
__label__ = "Performance"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
split = layout.split()
col = split.column()
col.itemL(text="Show:")
col.itemR(gs, "show_debug_properties", text="Debug Properties")
col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
col.itemR(gs, "deprecation_warnings")
col = split.column()
col.itemL(text="Render:")
col.itemR(gs, "all_frames")
col.itemR(gs, "display_lists")
class RENDER_PT_game_sound(RenderButtonsPanel):
__label__ = "Sound"
def draw(self, context):
layout = self.layout
scene = context.scene
layout.itemR(scene, "distance_model")
layout.itemR(scene, "speed_of_sound", text="Speed")
layout.itemR(scene, "doppler_factor")
bpy.types.register(RENDER_PT_game)
bpy.types.register(RENDER_PT_game_player)
bpy.types.register(RENDER_PT_game_stereo)
bpy.types.register(RENDER_PT_game_shading)
bpy.types.register(RENDER_PT_game_performance)
bpy.types.register(RENDER_PT_game_sound)
class WorldButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "world"
def poll(self, context):
rd = context.scene.render_data
return (rd.engine == 'BLENDER_GAME')
class WORLD_PT_game_context_world(WorldButtonsPanel):
__show_header__ = False
def poll(self, context):
rd = context.scene.render_data
return (context.scene) and (rd.use_game_engine)
def draw(self, context):
layout = self.layout
scene = context.scene
world = context.world
space = context.space_data
split = layout.split(percentage=0.65)
if scene:
split.template_ID(scene, "world", new="world.new")
elif world:
split.template_ID(space, "pin_id")
class WORLD_PT_game_world(WorldButtonsPanel):
__label__ = "World"
def draw(self, context):
layout = self.layout
world = context.world
row = layout.row()
row.column().itemR(world, "horizon_color")
row.column().itemR(world, "ambient_color")
layout.itemR(world.mist, "enabled", text="Mist")
row = layout.column_flow()
row.active = world.mist.enabled
row.itemR(world.mist, "start")
row.itemR(world.mist, "depth")
class WORLD_PT_game_physics(WorldButtonsPanel):
__label__ = "Physics"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemR(gs, "physics_engine")
if gs.physics_engine != 'NONE':
layout.itemR(gs, "physics_gravity", text="Gravity")
split = layout.split()
col = split.column()
col.itemL(text="Physics Steps:")
sub = col.column(align=True)
sub.itemR(gs, "physics_step_max", text="Max")
sub.itemR(gs, "physics_step_sub", text="Substeps")
col.itemR(gs, "fps", text="FPS")
col = split.column()
col.itemL(text="Logic Steps:")
col.itemR(gs, "logic_step_max", text="Max")
col = layout.column()
col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
sub = col.column()
sub.active = gs.use_occlusion_culling
sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
else:
split = layout.split()
col = split.column()
col.itemL(text="Physics Steps:")
col.itemR(gs, "fps", text="FPS")
col = split.column()
col.itemL(text="Logic Steps:")
col.itemR(gs, "logic_step_max", text="Max")
bpy.types.register(WORLD_PT_game_context_world)
bpy.types.register(WORLD_PT_game_world)
bpy.types.register(WORLD_PT_game_physics)

View File

@@ -1,747 +0,0 @@
import bpy
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
# which settings from node-materials are used
if mat:
mat_node = mat.active_node_material
if mat_node:
return mat_node
else:
return mat
return None
class MaterialButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "material"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_preview(MaterialButtonsPanel):
__label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def draw(self, context):
self.layout.template_preview(context.material)
class MATERIAL_PT_context_material(MaterialButtonsPanel):
__show_header__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
# An exception, dont call the parent poll func because
# this manages materials for all engine types
engine = context.scene.render_data.engine
return (context.material or context.object) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
ob = context.object
slot = context.material_slot
space = context.space_data
if ob:
row = layout.row()
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
col = row.column(align=True)
col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
col.itemO("object.material_slot_copy", icon='ICON_COPY_ID', text="")
if ob.mode == 'EDIT':
row = layout.row(align=True)
row.itemO("object.material_slot_assign", text="Assign")
row.itemO("object.material_slot_select", text="Select")
row.itemO("object.material_slot_deselect", text="Deselect")
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "active_material", new="material.new")
row = split.row()
if slot:
row.itemR(slot, "link", text="")
else:
row.itemL()
elif mat:
split.template_ID(space, "pin_id")
split.itemS()
if mat:
layout.itemR(mat, "type", expand=True)
class MATERIAL_PT_shading(MaterialButtonsPanel):
__label__ = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
if mat.type in ('SURFACE', 'WIRE'):
split = layout.split()
col = split.column()
sub = col.column()
sub.active = not mat.shadeless
sub.itemR(mat, "emit")
sub.itemR(mat, "ambient")
sub = col.column()
sub.itemR(mat, "translucency")
col = split.column()
col.itemR(mat, "shadeless")
sub = col.column()
sub.active = not mat.shadeless
sub.itemR(mat, "tangent_shading")
sub.itemR(mat, "cubic")
elif mat.type == 'HALO':
layout.itemR(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
__label__ = "Strand"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
tan = mat.strand
split = layout.split()
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(tan, "root_size", text="Root")
col.itemR(tan, "tip_size", text="Tip")
col.itemR(tan, "min_size", text="Minimum")
col.itemR(tan, "blender_units")
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(tan, "tangent_shading")
col.itemR(tan, "shape")
col = split.column()
col.itemL(text="Shading:")
col.itemR(tan, "width_fade")
ob = context.object
if ob and ob.type == 'MESH': col.item_pointerR(tan, "uv_layer", ob.data, "uv_textures", text="")
else: col.itemR(tan, "uv_layer", text="")
col.itemS()
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(tan, "surface_diffuse")
sub = col.column()
sub.active = tan.surface_diffuse
sub.itemR(tan, "blend_distance", text="Distance")
class MATERIAL_PT_physics(MaterialButtonsPanel):
__label__ = "Physics"
COMPAT_ENGINES = set(['BLENDER_GAME'])
def draw(self, context):
layout = self.layout
phys = context.material.physics # dont use node material
split = layout.split()
col = split.column()
col.itemR(phys, "distance")
col.itemR(phys, "friction")
col.itemR(phys, "align_to_normal")
col = split.column()
col.itemR(phys, "force", slider=True)
col.itemR(phys, "elasticity", slider=True)
col.itemR(phys, "damp", slider=True)
class MATERIAL_PT_options(MaterialButtonsPanel):
__label__ = "Options"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
split = layout.split()
col = split.column()
col.itemR(mat, "traceable")
col.itemR(mat, "full_oversampling")
col.itemR(mat, "sky")
col.itemR(mat, "exclude_mist")
col.itemR(mat, "invert_z")
sub = col.row()
sub.itemR(mat, "z_offset")
sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
sub = col.column(align=True)
sub.itemL(text="Light Group:")
sub.itemR(mat, "light_group", text="")
row = sub.row()
row.active = mat.light_group
row.itemR(mat, "light_group_exclusive", text="Exclusive")
col = split.column()
col.itemR(mat, "face_texture")
sub = col.column()
sub.active = mat.face_texture
sub.itemR(mat, "face_texture_alpha")
col.itemS()
col.itemR(mat, "vertex_color_paint")
col.itemR(mat, "vertex_color_light")
col.itemR(mat, "object_color")
class MATERIAL_PT_shadow(MaterialButtonsPanel):
__label__ = "Shadow"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
split = layout.split()
col = split.column()
col.itemR(mat, "shadows", text="Receive")
col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
col.itemR(mat, "only_shadow", text="Shadows Only")
col.itemR(mat, "cast_shadows_only", text="Cast Only")
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
col = split.column()
col.itemR(mat, "cast_buffer_shadows")
sub = col.column()
sub.active = mat.cast_buffer_shadows
sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
sub = col.column()
sub.active = (not mat.ray_shadow_bias)
sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
__label__ = "Diffuse"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
split = layout.split()
col = split.column()
col.itemR(mat, "diffuse_color", text="")
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(mat, "diffuse_intensity", text="Intensity")
col = split.column()
col.active = (not mat.shadeless)
col.itemR(mat, "diffuse_shader", text="")
col.itemR(mat, "use_diffuse_ramp", text="Ramp")
col = layout.column()
col.active = (not mat.shadeless)
if mat.diffuse_shader == 'OREN_NAYAR':
col.itemR(mat, "roughness")
elif mat.diffuse_shader == 'MINNAERT':
col.itemR(mat, "darkness")
elif mat.diffuse_shader == 'TOON':
row = col.row()
row.itemR(mat, "diffuse_toon_size", text="Size")
row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL':
row = col.row()
row.itemR(mat, "diffuse_fresnel", text="Fresnel")
row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
if mat.use_diffuse_ramp:
layout.itemS()
layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
layout.itemS()
row = layout.row()
split = row.split(percentage=0.3)
split.itemL(text="Input:")
split.itemR(mat, "diffuse_ramp_input", text="")
split = row.split(percentage=0.3)
split.itemL(text="Blend:")
split.itemR(mat, "diffuse_ramp_blend", text="")
row = layout.row()
row.itemR(mat, "diffuse_ramp_factor", text="Factor")
class MATERIAL_PT_specular(MaterialButtonsPanel):
__label__ = "Specular"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
layout.active = (not mat.shadeless)
split = layout.split()
col = split.column()
col.itemR(mat, "specular_color", text="")
col.itemR(mat, "specular_intensity", text="Intensity")
col = split.column()
col.itemR(mat, "specular_shader", text="")
col.itemR(mat, "use_specular_ramp", text="Ramp")
col = layout.column()
if mat.specular_shader in ('COOKTORR', 'PHONG'):
col.itemR(mat, "specular_hardness", text="Hardness")
elif mat.specular_shader == 'BLINN':
row = col.row()
row.itemR(mat, "specular_hardness", text="Hardness")
row.itemR(mat, "specular_ior", text="IOR")
elif mat.specular_shader == 'WARDISO':
col.itemR(mat, "specular_slope", text="Slope")
elif mat.specular_shader == 'TOON':
row = col.row()
row.itemR(mat, "specular_toon_size", text="Size")
row.itemR(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
layout.itemS()
layout.template_color_ramp(mat, "specular_ramp", expand=True)
layout.itemS()
row = layout.row()
split = row.split(percentage=0.3)
split.itemL(text="Input:")
split.itemR(mat, "specular_ramp_input", text="")
split = row.split(percentage=0.3)
split.itemL(text="Blend:")
split.itemR(mat, "specular_ramp_blend", text="")
row = layout.row()
row.itemR(mat, "specular_ramp_factor", text="Factor")
class MATERIAL_PT_sss(MaterialButtonsPanel):
__label__ = "Subsurface Scattering"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
self.layout.active = (not mat.shadeless)
self.layout.itemR(sss, "enabled", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
layout.active = sss.enabled
split = layout.split()
split.active = (not mat.shadeless)
col = split.column()
col.itemR(sss, "ior")
col.itemR(sss, "scale")
col.itemR(sss, "color", text="")
col.itemR(sss, "radius", text="RGB Radius")
col = split.column()
sub = col.column(align=True)
sub.itemL(text="Blend:")
sub.itemR(sss, "color_factor", text="Color")
sub.itemR(sss, "texture_factor", text="Texture")
sub.itemL(text="Scattering Weight:")
sub.itemR(sss, "front")
sub.itemR(sss, "back")
col.itemS()
col.itemR(sss, "error_tolerance", text="Error")
class MATERIAL_PT_mirror(MaterialButtonsPanel):
__label__ = "Mirror"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
raym = active_node_mat(context.material).raytrace_mirror
self.layout.itemR(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
raym = mat.raytrace_mirror
layout.active = raym.enabled
split = layout.split()
col = split.column()
col.itemR(raym, "reflect_factor")
col.itemR(mat, "mirror_color", text="")
col = split.column()
col.itemR(raym, "fresnel")
sub = col.column()
sub.active = raym.fresnel > 0
sub.itemR(raym, "fresnel_factor", text="Blend")
split = layout.split()
col = split.column()
col.itemS()
col.itemR(raym, "distance", text="Max Dist")
col.itemR(raym, "depth")
col.itemS()
sub = col.split(percentage=0.4)
sub.itemL(text="Fade To:")
sub.itemR(raym, "fade_to", text="")
col = split.column()
col.itemL(text="Gloss:")
col.itemR(raym, "gloss_factor", text="Amount")
sub = col.column()
sub.active = raym.gloss_factor < 1.0
sub.itemR(raym, "gloss_threshold", text="Threshold")
sub.itemR(raym, "gloss_samples", text="Samples")
sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_transp(MaterialButtonsPanel):
__label__= "Transparency"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
mat = active_node_mat(context.material)
self.layout.itemR(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
row = layout.row()
row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "transparency_method", expand=True)
split = layout.split()
col = split.column()
col.itemR(mat, "alpha")
row = col.row()
row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "specular_alpha", text="Specular")
col = split.column()
col.active = (not mat.shadeless)
col.itemR(rayt, "fresnel")
sub = col.column()
sub.active = rayt.fresnel > 0
sub.itemR(rayt, "fresnel_factor", text="Blend")
if mat.transparency_method == 'RAYTRACE':
layout.itemS()
split = layout.split()
split.active = mat.transparency
col = split.column()
col.itemR(rayt, "ior")
col.itemR(rayt, "filter")
col.itemR(rayt, "falloff")
col.itemR(rayt, "limit")
col.itemR(rayt, "depth")
col = split.column()
col.itemL(text="Gloss:")
col.itemR(rayt, "gloss_factor", text="Amount")
sub = col.column()
sub.active = rayt.gloss_factor < 1.0
sub.itemR(rayt, "gloss_threshold", text="Threshold")
sub.itemR(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_halo(MaterialButtonsPanel):
__label__= "Halo"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
halo = mat.halo
split = layout.split()
col = split.column()
col.itemR(mat, "diffuse_color", text="")
col.itemR(halo, "size")
col.itemR(halo, "hardness")
col.itemR(halo, "add")
col.itemL(text="Options:")
col.itemR(halo, "texture")
col.itemR(halo, "vertex_normal")
col.itemR(halo, "xalpha")
col.itemR(halo, "shaded")
col.itemR(halo, "soft")
col = split.column()
col.itemR(halo, "ring")
sub = col.column()
sub.active = halo.ring
sub.itemR(halo, "rings")
sub.itemR(mat, "mirror_color", text="")
col.itemS()
col.itemR(halo, "lines")
sub = col.column()
sub.active = halo.lines
sub.itemR(halo, "line_number", text="Lines")
sub.itemR(mat, "specular_color", text="")
col.itemS()
col.itemR(halo, "star")
sub = col.column()
sub.active = halo.star
sub.itemR(halo, "star_tips")
class MATERIAL_PT_flare(MaterialButtonsPanel):
__label__= "Flare"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
halo = context.material.halo
self.layout.itemR(halo, "flare_mode", text="")
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
halo = mat.halo
layout.active = halo.flare_mode
split = layout.split()
col = split.column()
col.itemR(halo, "flare_size", text="Size")
col.itemR(halo, "flare_boost", text="Boost")
col.itemR(halo, "flare_seed", text="Seed")
col = split.column()
col.itemR(halo, "flares_sub", text="Subflares")
col.itemR(halo, "flare_subsize", text="Subsize")
bpy.types.register(MATERIAL_PT_context_material)
bpy.types.register(MATERIAL_PT_preview)
bpy.types.register(MATERIAL_PT_diffuse)
bpy.types.register(MATERIAL_PT_specular)
bpy.types.register(MATERIAL_PT_shading)
bpy.types.register(MATERIAL_PT_transp)
bpy.types.register(MATERIAL_PT_mirror)
bpy.types.register(MATERIAL_PT_sss)
bpy.types.register(MATERIAL_PT_halo)
bpy.types.register(MATERIAL_PT_flare)
bpy.types.register(MATERIAL_PT_physics)
bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options)
bpy.types.register(MATERIAL_PT_shadow)
# Volumetrics
class VolumeButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "material"
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_volume_density(VolumeButtonsPanel):
__label__ = "Density"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
row = split.row()
row.itemR(vol, "density")
row.itemR(vol, "density_scale")
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
__label__ = "Shading"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
col = split.column()
col.itemR(vol, "scattering")
col.itemR(vol, "asymmetry")
col.itemR(vol, "transmission_color")
col = split.column()
sub = col.column(align=True)
sub.itemR(vol, "emission")
sub.itemR(vol, "emission_color", text="")
sub = col.column(align=True)
sub.itemR(vol, "reflection")
sub.itemR(vol, "reflection_color", text="")
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
__label__ = "Lighting"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
col = split.column()
col.itemR(vol, "lighting_mode", text="")
col = split.column()
if vol.lighting_mode == 'SHADED':
col.itemR(vol, "external_shadows")
col.itemR(vol, "light_cache")
sub = col.column()
sub.active = vol.light_cache
sub.itemR(vol, "cache_resolution")
elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
sub = col.column()
sub.enabled = True
sub.active = False
sub.itemR(vol, "light_cache")
col.itemR(vol, "cache_resolution")
sub = col.column(align=True)
sub.itemR(vol, "ms_diffusion")
sub.itemR(vol, "ms_spread")
sub.itemR(vol, "ms_intensity")
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
__label__= "Transparency"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
layout.itemR(mat, "transparency_method", expand=True)
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
__label__ = "Integration"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
col = split.column()
col.itemL(text="Step Calculation:")
col.itemR(vol, "step_calculation", text="")
col = col.column(align=True)
col.itemR(vol, "step_size")
col = split.column()
col.itemL()
col.itemR(vol, "depth_cutoff")
bpy.types.register(MATERIAL_PT_volume_density)
bpy.types.register(MATERIAL_PT_volume_shading)
bpy.types.register(MATERIAL_PT_volume_lighting)
bpy.types.register(MATERIAL_PT_volume_transp)
bpy.types.register(MATERIAL_PT_volume_integration)

View File

@@ -1,225 +0,0 @@
import bpy
class ObjectButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "object"
class OBJECT_PT_context_object(ObjectButtonsPanel):
__show_header__ = False
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.itemL(text="", icon='ICON_OBJECT_DATA')
row.itemR(ob, "name", text="")
class OBJECT_PT_transform(ObjectButtonsPanel):
__label__ = "Transform"
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.column().itemR(ob, "location")
if ob.rotation_mode == 'QUATERNION':
row.column().itemR(ob, "rotation_quaternion", text="Rotation")
elif ob.rotation_mode == 'AXIS_ANGLE':
#row.column().itemL(text="Rotation")
#row.column().itemR(pchan, "rotation_angle", text="Angle")
#row.column().itemR(pchan, "rotation_axis", text="Axis")
row.column().itemR(ob, "rotation_axis_angle", text="Rotation")
else:
row.column().itemR(ob, "rotation_euler", text="Rotation")
row.column().itemR(ob, "scale")
layout.itemR(ob, "rotation_mode")
class OBJECT_PT_transform_locks(ObjectButtonsPanel):
__label__ = "Transform Locks"
__default_closed__ = True
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
col = row.column()
col.itemR(ob, "lock_location")
col = row.column()
if ob.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
col.itemR(ob, "lock_rotations_4d", text="Lock Rotation")
if ob.lock_rotations_4d:
col.itemR(ob, "lock_rotation_w", text="W")
col.itemR(ob, "lock_rotation", text="")
else:
col.itemR(ob, "lock_rotation", text="Rotation")
row.column().itemR(ob, "lock_scale")
class OBJECT_PT_relations(ObjectButtonsPanel):
__label__ = "Relations"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
col = split.column()
col.itemR(ob, "layers")
col.itemS()
col.itemR(ob, "pass_index")
col = split.column()
col.itemL(text="Parent:")
col.itemR(ob, "parent", text="")
sub = col.column()
split = sub.split(percentage=0.3)
split.itemL(text="Type:")
split.itemR(ob, "parent_type", text="")
parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")
sub.active = parent != None
class OBJECT_PT_groups(ObjectButtonsPanel):
__label__ = "Groups"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
split.item_menu_enumO("object.group_add", "group", text="Add to Group")
split.itemL()
for group in bpy.data.groups:
if ob.name in group.objects:
col = layout.column(align=True)
col.set_context_pointer("group", group)
row = col.box().row()
row.itemR(group, "name", text="")
row.itemO("object.group_remove", text="", icon='VICON_X')
split = col.box().split()
split.column().itemR(group, "layer", text="Dupli")
split.column().itemR(group, "dupli_offset", text="")
class OBJECT_PT_display(ObjectButtonsPanel):
__label__ = "Display"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
col = split.column()
col.itemR(ob, "max_draw_type", text="Type")
col = split.column()
row = col.row()
row.itemR(ob, "draw_bounds", text="Bounds")
sub = row.row()
sub.active = ob.draw_bounds
sub.itemR(ob, "draw_bounds_type", text="")
flow = layout.column_flow()
flow.itemR(ob, "draw_name", text="Name")
flow.itemR(ob, "draw_axis", text="Axis")
flow.itemR(ob, "draw_wire", text="Wire")
flow.itemR(ob, "draw_texture_space", text="Texture Space")
flow.itemR(ob, "x_ray", text="X-Ray")
flow.itemR(ob, "draw_transparent", text="Transparency")
class OBJECT_PT_duplication(ObjectButtonsPanel):
__label__ = "Duplication"
def draw(self, context):
layout = self.layout
ob = context.object
layout.itemR(ob, "dupli_type", expand=True)
if ob.dupli_type == 'FRAMES':
split = layout.split()
col = split.column(align=True)
col.itemR(ob, "dupli_frames_start", text="Start")
col.itemR(ob, "dupli_frames_end", text="End")
col = split.column(align=True)
col.itemR(ob, "dupli_frames_on", text="On")
col.itemR(ob, "dupli_frames_off", text="Off")
layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
elif ob.dupli_type == 'VERTS':
layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
elif ob.dupli_type == 'FACES':
row = layout.row()
row.itemR(ob, "dupli_faces_scale", text="Scale")
row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
elif ob.dupli_type == 'GROUP':
layout.itemR(ob, "dupli_group", text="Group")
class OBJECT_PT_animation(ObjectButtonsPanel):
__label__ = "Animation"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
col = split.column()
col.itemL(text="Time Offset:")
col.itemR(ob, "time_offset_edit", text="Edit")
row = col.row()
row.itemR(ob, "time_offset_particle", text="Particle")
row.active = len(ob.particle_systems) != 0
row = col.row()
row.itemR(ob, "time_offset_parent", text="Parent")
row.active = ob.parent != None
row = col.row()
row.itemR(ob, "slow_parent")
row.active = ob.parent != None
col.itemR(ob, "time_offset", text="Offset")
col = split.column()
col.itemL(text="Track:")
col.itemR(ob, "track", text="")
col.itemR(ob, "track_axis", text="Axis")
col.itemR(ob, "up_axis", text="Up Axis")
row = col.row()
row.itemR(ob, "track_override_parent", text="Override Parent")
row.active = ob.parent != None
bpy.types.register(OBJECT_PT_context_object)
bpy.types.register(OBJECT_PT_transform)
bpy.types.register(OBJECT_PT_transform_locks)
bpy.types.register(OBJECT_PT_relations)
bpy.types.register(OBJECT_PT_groups)
bpy.types.register(OBJECT_PT_display)
bpy.types.register(OBJECT_PT_duplication)
bpy.types.register(OBJECT_PT_animation)

View File

@@ -1,753 +0,0 @@
import bpy
class ConstraintButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "constraint"
def draw_constraint(self, context, con):
layout = self.layout
box = layout.template_constraint(con)
if box:
# match enum type to our functions, avoids a lookup table.
getattr(self, con.type)(context, box, con)
# show/key buttons here are most likely obsolete now, with
# keyframing functionality being part of every button
if con.type not in ('RIGID_BODY_JOINT', 'NULL'):
box.itemR(con, "influence")
def space_template(self, layout, con, target=True, owner=True):
if target or owner:
row = layout.row()
row.itemL(text="Convert:")
if target:
row.itemR(con, "target_space", text="")
if target and owner:
row.itemL(icon='ICON_ARROW_LEFTRIGHT')
if owner:
row.itemR(con, "owner_space", text="")
def target_template(self, layout, con, subtargets=True):
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
if con.target and subtargets:
if con.target.type == 'ARMATURE':
layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
if con.type == 'COPY_LOCATION':
row = layout.row()
row.itemL(text="Head/Tail:")
row.itemR(con, "head_tail", text="")
elif con.target.type in ('MESH', 'LATTICE'):
layout.item_pointerR(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
def ik_template(self, layout, con):
# only used for iTaSC
layout.itemR(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target:
row = layout.row()
row.itemL()
row.itemR(con, "pole_angle")
split = layout.split(percentage=0.33)
col = split.column()
col.itemR(con, "tail")
col.itemR(con, "stretch")
col = split.column()
col.itemR(con, "chain_length")
col.itemR(con, "targetless")
def CHILD_OF(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemL(text="Location:")
col.itemR(con, "locationx", text="X")
col.itemR(con, "locationy", text="Y")
col.itemR(con, "locationz", text="Z")
col = split.column()
col.itemL(text="Rotation:")
col.itemR(con, "rotationx", text="X")
col.itemR(con, "rotationy", text="Y")
col.itemR(con, "rotationz", text="Z")
col = split.column()
col.itemL(text="Scale:")
col.itemR(con, "sizex", text="X")
col.itemR(con, "sizey", text="Y")
col.itemR(con, "sizez", text="Z")
row = layout.row()
row.itemO("constraint.childof_set_inverse")
row.itemO("constraint.childof_clear_inverse")
def TRACK_TO(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="To:")
row.itemR(con, "track", expand=True)
row = layout.row()
#row.itemR(con, "up", text="Up", expand=True) # XXX: up and expand don't play nice together
row.itemR(con, "up", text="Up")
row.itemR(con, "target_z")
self.space_template(layout, con)
def IK(self, context, layout, con):
if context.object.pose.ik_solver == "ITASC":
layout.itemR(con, "ik_type")
getattr(self, "IK_"+con.ik_type)(context, layout, con)
else:
# Legacy IK constraint
self.target_template(layout, con)
layout.itemR(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target:
row = layout.row()
row.itemL()
row.itemR(con, "pole_angle")
split = layout.split()
col = split.column()
col.itemR(con, "tail")
col.itemR(con, "stretch")
col = split.column()
col.itemR(con, "iterations")
col.itemR(con, "chain_length")
split = layout.split()
col = split.column()
col.itemL()
col.itemR(con, "targetless")
col.itemR(con, "rotation")
col = split.column()
col.itemL(text="Weight:")
col.itemR(con, "weight", text="Position", slider=True)
sub = col.column()
sub.active = con.rotation
sub.itemR(con, "orient_weight", text="Rotation", slider=True)
def IK_COPY_POSE(self, context, layout, con):
self.target_template(layout, con)
self.ik_template(layout, con)
row = layout.row()
row.itemL(text="Axis Ref:")
row.itemR(con, "axis_reference", expand=True)
split = layout.split(percentage=0.33)
split.row().itemR(con, "position")
row = split.row()
row.itemR(con, "weight", text="Weight", slider=True)
row.active = con.position
split = layout.split(percentage=0.33)
row = split.row()
row.itemL(text="Lock:")
row = split.row()
row.itemR(con, "pos_lock_x", text="X")
row.itemR(con, "pos_lock_y", text="Y")
row.itemR(con, "pos_lock_z", text="Z")
split.active = con.position
split = layout.split(percentage=0.33)
split.row().itemR(con, "rotation")
row = split.row()
row.itemR(con, "orient_weight", text="Weight", slider=True)
row.active = con.rotation
split = layout.split(percentage=0.33)
row = split.row()
row.itemL(text="Lock:")
row = split.row()
row.itemR(con, "rot_lock_x", text="X")
row.itemR(con, "rot_lock_y", text="Y")
row.itemR(con, "rot_lock_z", text="Z")
split.active = con.rotation
def IK_DISTANCE(self, context, layout, con):
self.target_template(layout, con)
self.ik_template(layout, con)
layout.itemR(con, "limit_mode")
row = layout.row()
row.itemR(con, "weight", text="Weight", slider=True)
row.itemR(con, "distance", text="Distance", slider=True)
def FOLLOW_PATH(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "use_curve_follow")
col.itemR(con, "use_curve_radius")
col = split.column()
col.itemR(con, "use_fixed_position")
if con.use_fixed_position:
col.itemR(con, "offset_factor", text="Offset")
else:
col.itemR(con, "offset")
row = layout.row()
row.itemL(text="Forward:")
row.itemR(con, "forward", expand=True)
row = layout.row()
row.itemR(con, "up", text="Up")
row.itemL()
def LIMIT_ROTATION(self, context, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_limit_x")
sub = col.column()
sub.active = con.use_limit_x
sub.itemR(con, "minimum_x", text="Min")
sub.itemR(con, "maximum_x", text="Max")
col = split.column()
col.itemR(con, "use_limit_y")
sub = col.column()
sub.active = con.use_limit_y
sub.itemR(con, "minimum_y", text="Min")
sub.itemR(con, "maximum_y", text="Max")
col = split.column()
col.itemR(con, "use_limit_z")
sub = col.column()
sub.active = con.use_limit_z
sub.itemR(con, "minimum_z", text="Min")
sub.itemR(con, "maximum_z", text="Max")
row = layout.row()
row.itemR(con, "limit_transform")
row.itemL()
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def LIMIT_LOCATION(self, context, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_minimum_x")
sub = col.column()
sub.active = con.use_minimum_x
sub.itemR(con, "minimum_x", text="")
col.itemR(con, "use_maximum_x")
sub = col.column()
sub.active = con.use_maximum_x
sub.itemR(con, "maximum_x", text="")
col = split.column()
col.itemR(con, "use_minimum_y")
sub = col.column()
sub.active = con.use_minimum_y
sub.itemR(con, "minimum_y", text="")
col.itemR(con, "use_maximum_y")
sub = col.column()
sub.active = con.use_maximum_y
sub.itemR(con, "maximum_y", text="")
col = split.column()
col.itemR(con, "use_minimum_z")
sub = col.column()
sub.active = con.use_minimum_z
sub.itemR(con, "minimum_z", text="")
col.itemR(con, "use_maximum_z")
sub = col.column()
sub.active = con.use_maximum_z
sub.itemR(con, "maximum_z", text="")
row = layout.row()
row.itemR(con, "limit_transform")
row.itemL()
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def LIMIT_SCALE(self, context, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_minimum_x")
sub = col.column()
sub.active = con.use_minimum_x
sub.itemR(con, "minimum_x", text="")
col.itemR(con, "use_maximum_x")
sub = col.column()
sub.active = con.use_maximum_x
sub.itemR(con, "maximum_x", text="")
col = split.column()
col.itemR(con, "use_minimum_y")
sub = col.column()
sub.active = con.use_minimum_y
sub.itemR(con, "minimum_y", text="")
col.itemR(con, "use_maximum_y")
sub = col.column()
sub.active = con.use_maximum_y
sub.itemR(con, "maximum_y", text="")
col = split.column()
col.itemR(con, "use_minimum_z")
sub = col.column()
sub.active = con.use_minimum_z
sub.itemR(con, "minimum_z", text="")
col.itemR(con, "use_maximum_z")
sub = col.column()
sub.active = con.use_maximum_z
sub.itemR(con, "maximum_z", text="")
row = layout.row()
row.itemR(con, "limit_transform")
row.itemL()
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def COPY_ROTATION(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "rotate_like_x", text="X")
sub = col.column()
sub.active = con.rotate_like_x
sub.itemR(con, "invert_x", text="Invert")
col = split.column()
col.itemR(con, "rotate_like_y", text="Y")
sub = col.column()
sub.active = con.rotate_like_y
sub.itemR(con, "invert_y", text="Invert")
col = split.column()
col.itemR(con, "rotate_like_z", text="Z")
sub = col.column()
sub.active = con.rotate_like_z
sub.itemR(con, "invert_z", text="Invert")
layout.itemR(con, "offset")
self.space_template(layout, con)
def COPY_LOCATION(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "locate_like_x", text="X")
sub = col.column()
sub.active = con.locate_like_x
sub.itemR(con, "invert_x", text="Invert")
col = split.column()
col.itemR(con, "locate_like_y", text="Y")
sub = col.column()
sub.active = con.locate_like_y
sub.itemR(con, "invert_y", text="Invert")
col = split.column()
col.itemR(con, "locate_like_z", text="Z")
sub = col.column()
sub.active = con.locate_like_z
sub.itemR(con, "invert_z", text="Invert")
layout.itemR(con, "offset")
self.space_template(layout, con)
def COPY_SCALE(self, context, layout, con):
self.target_template(layout, con)
row = layout.row(align=True)
row.itemR(con, "size_like_x", text="X")
row.itemR(con, "size_like_y", text="Y")
row.itemR(con, "size_like_z", text="Z")
layout.itemR(con, "offset")
self.space_template(layout, con)
#def SCRIPT(self, context, layout, con):
def ACTION(self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "action")
layout.itemR(con, "transform_channel")
split = layout.split()
col = split.column(align=True)
col.itemR(con, "start_frame", text="Start")
col.itemR(con, "end_frame", text="End")
col = split.column(align=True)
col.itemR(con, "minimum", text="Min")
col.itemR(con, "maximum", text="Max")
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def LOCKED_TRACK(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="To:")
row.itemR(con, "track", expand=True)
row = layout.row()
row.itemL(text="Lock:")
row.itemR(con, "locked", expand=True)
def LIMIT_DISTANCE(self, context, layout, con):
self.target_template(layout, con)
col = layout.column(align=True);
col.itemR(con, "distance")
col.itemO("constraint.limitdistance_reset")
row = layout.row()
row.itemL(text="Clamp Region:")
row.itemR(con, "limit_mode", text="")
def STRETCH_TO(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemR(con, "original_length", text="Rest Length")
row.itemO("constraint.stretchto_reset", text="Reset")
col = layout.column()
col.itemR(con, "bulge", text="Volume Variation")
row = layout.row()
row.itemL(text="Volume:")
row.itemR(con, "volume", expand=True)
row.itemL(text="Plane:")
row.itemR(con, "keep_axis", expand=True)
def FLOOR(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemR(con, "sticky")
row.itemR(con, "use_rotation")
layout.itemR(con, "offset")
row = layout.row()
row.itemL(text="Min/Max:")
row.itemR(con, "floor_location", expand=True)
def RIGID_BODY_JOINT(self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "pivot_type")
layout.itemR(con, "child")
row = layout.row()
row.itemR(con, "disable_linked_collision", text="No Collision")
row.itemR(con, "draw_pivot", text="Display Pivot")
split = layout.split()
col = split.column(align=True)
col.itemL(text="Pivot:")
col.itemR(con, "pivot_x", text="X")
col.itemR(con, "pivot_y", text="Y")
col.itemR(con, "pivot_z", text="Z")
col = split.column(align=True)
col.itemL(text="Axis:")
col.itemR(con, "axis_x", text="X")
col.itemR(con, "axis_y", text="Y")
col.itemR(con, "axis_z", text="Z")
#Missing: Limit arrays (not wrapped in RNA yet)
def CLAMP_TO(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="Main Axis:")
row.itemR(con, "main_axis", expand=True)
row = layout.row()
row.itemR(con, "cyclic")
def TRANSFORM(self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "extrapolate_motion", text="Extrapolate")
split = layout.split()
col = split.column()
col.itemL(text="Source:")
col.row().itemR(con, "map_from", expand=True)
sub = col.row(align=True)
sub.itemL(text="X:")
sub.itemR(con, "from_min_x", text="")
sub.itemR(con, "from_max_x", text="")
sub = col.row(align=True)
sub.itemL(text="Y:")
sub.itemR(con, "from_min_y", text="")
sub.itemR(con, "from_max_y", text="")
sub = col.row(align=True)
sub.itemL(text="Z:")
sub.itemR(con, "from_min_z", text="")
sub.itemR(con, "from_max_z", text="")
split = layout.split()
col = split.column()
col.itemL(text="Destination:")
col.row().itemR(con, "map_to", expand=True)
sub = col.row(align=True)
sub.itemR(con, "map_to_x_from", text="")
sub.itemR(con, "to_min_x", text="")
sub.itemR(con, "to_max_x", text="")
sub = col.row(align=True)
sub.itemR(con, "map_to_y_from", text="")
sub.itemR(con, "to_min_y", text="")
sub.itemR(con, "to_max_y", text="")
sub = col.row(align=True)
sub.itemR(con, "map_to_z_from", text="")
sub.itemR(con, "to_min_z", text="")
sub.itemR(con, "to_max_z", text="")
self.space_template(layout, con)
def SHRINKWRAP (self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "distance")
layout.itemR(con, "shrinkwrap_type")
if con.shrinkwrap_type == 'PROJECT':
row = layout.row(align=True)
row.itemR(con, "axis_x")
row.itemR(con, "axis_y")
row.itemR(con, "axis_z")
def DAMPED_TRACK(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="To:")
row.itemR(con, "track", expand=True)
class OBJECT_PT_constraints(ConstraintButtonsPanel):
__label__ = "Constraints"
__context__ = "constraint"
def poll(self, context):
return (context.object)
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.item_menu_enumO("object.constraint_add", "type")
row.itemL();
for con in ob.constraints:
self.draw_constraint(context, con)
class BONE_PT_inverse_kinematics(ConstraintButtonsPanel):
__label__ = "Inverse Kinematics"
__default_closed__ = True
__context__ = "bone_constraint"
def poll(self, context):
ob = context.object
bone = context.bone
if ob and bone:
pchan = ob.pose.pose_channels[bone.name]
return pchan.has_ik
return False
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
pchan = ob.pose.pose_channels[bone.name]
row = layout.row()
row.itemR(ob.pose, "ik_solver")
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_x", text="X")
row = split.row()
row.itemR(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
row.active = pchan.ik_dof_x
split = layout.split(percentage=0.25)
row = split.row()
row.itemR(pchan, "ik_limit_x", text="Limit")
row.active = pchan.ik_dof_x
row = split.row(align=True)
row.itemR(pchan, "ik_min_x", text="")
row.itemR(pchan, "ik_max_x", text="")
row.active = pchan.ik_dof_x and pchan.ik_limit_x
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_y", text="Y")
row = split.row()
row.itemR(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
row.active = pchan.ik_dof_y
split = layout.split(percentage=0.25)
row = split.row()
row.itemR(pchan, "ik_limit_y", text="Limit")
row.active = pchan.ik_dof_y
row = split.row(align=True)
row.itemR(pchan, "ik_min_y", text="")
row.itemR(pchan, "ik_max_y", text="")
row.active = pchan.ik_dof_y and pchan.ik_limit_y
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_z", text="Z")
row = split.row()
row.itemR(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
row.active = pchan.ik_dof_z
split = layout.split(percentage=0.25)
row = split.row()
row.itemR(pchan, "ik_limit_z", text="Limit")
row.active = pchan.ik_dof_z
row = split.row(align=True)
row.itemR(pchan, "ik_min_z", text="")
row.itemR(pchan, "ik_max_z", text="")
row.active = pchan.ik_dof_z and pchan.ik_limit_z
split = layout.split()
split.itemR(pchan, "ik_stretch", text="Stretch", slider=True)
split.itemL()
if ob.pose.ik_solver == "ITASC":
row = layout.row()
row.itemR(pchan, "ik_rot_control", text="Control Rotation")
row.itemR(pchan, "ik_rot_weight", text="Weight", slider=True)
# not supported yet
#row = layout.row()
#row.itemR(pchan, "ik_lin_control", text="Joint Size")
#row.itemR(pchan, "ik_lin_weight", text="Weight", slider=True)
class BONE_PT_iksolver_itasc(ConstraintButtonsPanel):
__label__ = "iTaSC parameters"
__default_closed__ = True
__context__ = "bone_constraint"
def poll(self, context):
ob = context.object
bone = context.bone
if ob and bone:
pchan = ob.pose.pose_channels[bone.name]
return pchan.has_ik and ob.pose.ik_solver == "ITASC" and ob.pose.ik_param
return False
def draw(self, context):
layout = self.layout
ob = context.object
itasc = ob.pose.ik_param
layout.itemR(itasc, "mode", expand=True)
simulation = itasc.mode == "SIMULATION"
if simulation:
layout.itemL(text="Reiteration:")
layout.itemR(itasc, "reiteration", expand=True)
flow = layout.column_flow()
flow.itemR(itasc, "precision", text="Prec")
flow.itemR(itasc, "num_iter", text="Iter")
flow.active = not simulation or itasc.reiteration != "NEVER"
if simulation:
layout.itemR(itasc, "auto_step")
row = layout.row()
if itasc.auto_step:
row.itemR(itasc, "min_step", text="Min")
row.itemR(itasc, "max_step", text="Max")
else:
row.itemR(itasc, "num_step")
layout.itemR(itasc, "solver")
if simulation:
layout.itemR(itasc, "feedback")
layout.itemR(itasc, "max_velocity")
if itasc.solver == "DLS":
row = layout.row()
row.itemR(itasc, "dampmax", text="Damp", slider=True)
row.itemR(itasc, "dampeps", text="Eps", slider=True)
class BONE_PT_constraints(ConstraintButtonsPanel):
__label__ = "Constraints"
__context__ = "bone_constraint"
def poll(self, context):
ob = context.object
return (ob and ob.type == 'ARMATURE' and context.bone)
def draw(self, context):
layout = self.layout
ob = context.object
pchan = ob.pose.pose_channels[context.bone.name]
row = layout.row()
row.item_menu_enumO("pose.constraint_add", "type")
row.itemL();
for con in pchan.constraints:
self.draw_constraint(context, con)
bpy.types.register(OBJECT_PT_constraints)
bpy.types.register(BONE_PT_iksolver_itasc)
bpy.types.register(BONE_PT_inverse_kinematics)
bpy.types.register(BONE_PT_constraints)

View File

@@ -1,954 +0,0 @@
import bpy
from buttons_physics_common import point_cache_ui
from buttons_physics_common import effector_weights_ui
from buttons_physics_common import basic_force_field_settings_ui
from buttons_physics_common import basic_force_field_falloff_ui
def particle_panel_enabled(context, psys):
return psys.point_cache.baked==False and psys.edited==False and (not context.particle_system_editable)
def particle_panel_poll(context):
psys = context.particle_system
if psys==None: return False
if psys.settings==None: return False
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
class ParticleButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "particle"
def poll(self, context):
return particle_panel_poll(context)
class PARTICLE_PT_particles(ParticleButtonsPanel):
__show_header__ = False
def poll(self, context):
return (context.particle_system or context.object)
def draw(self, context):
layout = self.layout
ob = context.object
psys = context.particle_system
if ob:
row = layout.row()
row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
col = row.column(align=True)
col.itemO("object.particle_system_add", icon='ICON_ZOOMIN', text="")
col.itemO("object.particle_system_remove", icon='ICON_ZOOMOUT', text="")
if psys and not psys.settings:
split = layout.split(percentage=0.32)
col = split.column()
col.itemL(text="Name:")
col.itemL(text="Settings:")
col = split.column()
col.itemR(psys, "name", text="")
col.template_ID(psys, "settings", new="particle.new")
elif psys:
part = psys.settings
split = layout.split(percentage=0.32)
col = split.column()
col.itemL(text="Name:")
if part.type in ('EMITTER', 'REACTOR', 'HAIR'):
col.itemL(text="Settings:")
col.itemL(text="Type:")
col = split.column()
col.itemR(psys, "name", text="")
if part.type in ('EMITTER', 'REACTOR', 'HAIR'):
col.template_ID(psys, "settings", new="particle.new")
#row = layout.row()
#row.itemL(text="Viewport")
#row.itemL(text="Render")
if part:
if part.type not in ('EMITTER', 'REACTOR', 'HAIR'):
layout.itemL(text="No settings for fluid particles")
return
row=col.row()
row.enabled = particle_panel_enabled(context, psys)
row.itemR(part, "type", text="")
row.itemR(psys, "seed")
split = layout.split(percentage=0.65)
if part.type=='HAIR':
if psys.edited==True:
split.itemO("particle.edited_clear", text="Free Edit")
else:
split.itemL(text="")
row = split.row()
row.enabled = particle_panel_enabled(context, psys)
row.itemR(part, "hair_step")
if psys.edited==True:
if psys.global_hair:
layout.itemO("particle.connect_hair")
layout.itemL(text="Hair is disconnected.")
else:
layout.itemO("particle.disconnect_hair")
layout.itemL(text="")
elif part.type=='REACTOR':
split.enabled = particle_panel_enabled(context, psys)
split.itemR(psys, "reactor_target_object")
split.itemR(psys, "reactor_target_particle_system", text="Particle System")
class PARTICLE_PT_emission(ParticleButtonsPanel):
__label__ = "Emission"
def poll(self, context):
if particle_panel_poll(context):
return not context.particle_system.point_cache.external
else:
return False
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
layout.enabled = particle_panel_enabled(context, psys) and not psys.multiple_caches
row = layout.row()
row.active = part.distribution != 'GRID'
row.itemR(part, "amount")
if part.type != 'HAIR':
split = layout.split()
col = split.column(align=True)
col.itemR(part, "start")
col.itemR(part, "end")
col = split.column(align=True)
col.itemR(part, "lifetime")
col.itemR(part, "random_lifetime", slider=True)
layout.row().itemL(text="Emit From:")
row = layout.row()
row.itemR(part, "emit_from", expand=True)
row = layout.row()
row.itemR(part, "trand")
if part.distribution!='GRID':
row.itemR(part, "even_distribution")
if part.emit_from=='FACE' or part.emit_from=='VOLUME':
row = layout.row()
row.itemR(part, "distribution", expand=True)
row = layout.row()
if part.distribution=='JIT':
row.itemR(part, "userjit", text="Particles/Face")
row.itemR(part, "jitter_factor", text="Jittering Amount", slider=True)
elif part.distribution=='GRID':
row.itemR(part, "grid_resolution")
class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
__label__ = "Hair dynamics"
__default_closed__ = True
def poll(self, context):
psys = context.particle_system
if psys==None: return False
if psys.settings==None: return False
return psys.settings.type == 'HAIR'
def draw_header(self, context):
#cloth = context.cloth.collision_settings
#self.layout.active = cloth_panel_enabled(context.cloth)
#self.layout.itemR(cloth, "enable_collision", text="")
psys = context.particle_system
self.layout.itemR(psys, "hair_dynamics", text="")
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
cloth = psys.cloth.settings
layout.enabled = psys.hair_dynamics
split = layout.split()
col = split.column()
col.itemL(text="Material:")
sub = col.column(align=True)
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
sub.itemR(cloth, "mass")
sub.itemR(cloth, "bending_stiffness", text="Bending")
sub.itemR(cloth, "internal_friction", slider="True")
col = split.column()
col.itemL(text="Damping:")
sub = col.column(align=True)
sub.itemR(cloth, "spring_damping", text="Spring")
sub.itemR(cloth, "air_damping", text="Air")
col.itemL(text="Quality:")
col.itemR(cloth, "quality", text="Steps",slider=True)
class PARTICLE_PT_cache(ParticleButtonsPanel):
__label__ = "Cache"
__default_closed__ = True
def poll(self, context):
psys = context.particle_system
if psys==None: return False
if psys.settings==None: return False
phystype = psys.settings.physics_type
if phystype == 'NO' or phystype == 'KEYED':
return False
return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
def draw(self, context):
layout = self.layout
psys = context.particle_system
point_cache_ui(self, psys.point_cache, particle_panel_enabled(context, psys), not psys.hair_dynamics, 0)
class PARTICLE_PT_velocity(ParticleButtonsPanel):
__label__ = "Velocity"
def poll(self, context):
if particle_panel_poll(context):
psys = context.particle_system
return psys.settings.physics_type != 'BOIDS' and not psys.point_cache.external
else:
return False
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
layout.enabled = particle_panel_enabled(context, psys)
split = layout.split()
sub = split.column()
sub.itemL(text="Emitter Geometry:")
sub.itemR(part, "normal_factor")
subsub = sub.column(align=True)
subsub.itemR(part, "tangent_factor")
subsub.itemR(part, "tangent_phase", slider=True)
sub = split.column()
sub.itemL(text="Emitter Object")
sub.itemR(part, "object_aligned_factor", text="")
layout.row().itemL(text="Other:")
split = layout.split()
sub = split.column()
if part.emit_from=='PARTICLE':
sub.itemR(part, "particle_factor")
else:
sub.itemR(part, "object_factor", slider=True)
sub = split.column()
sub.itemR(part, "random_factor")
#if part.type=='REACTOR':
# sub.itemR(part, "reactor_factor")
# sub.itemR(part, "reaction_shape", slider=True)
class PARTICLE_PT_rotation(ParticleButtonsPanel):
__label__ = "Rotation"
def poll(self, context):
if particle_panel_poll(context):
psys = context.particle_system
return psys.settings.physics_type != 'BOIDS' and not psys.point_cache.external
else:
return False
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
layout.enabled = particle_panel_enabled(context, psys)
split = layout.split()
split.itemL(text="Initial Rotation:")
split.itemR(part, "rotation_dynamic")
split = layout.split()
sub = split.column(align=True)
sub.itemR(part, "rotation_mode", text="")
sub.itemR(part, "random_rotation_factor", slider=True, text="Random")
sub = split.column(align=True)
sub.itemR(part, "phase_factor", slider=True)
sub.itemR(part, "random_phase_factor", text="Random", slider=True)
layout.row().itemL(text="Angular Velocity:")
layout.row().itemR(part, "angular_velocity_mode", expand=True)
split = layout.split()
sub = split.column()
sub.itemR(part, "angular_velocity_factor", text="")
class PARTICLE_PT_physics(ParticleButtonsPanel):
__label__ = "Physics"
def poll(self, context):
if particle_panel_poll(context):
return not context.particle_system.point_cache.external
else:
return False
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
layout.enabled = particle_panel_enabled(context, psys)
row = layout.row()
row.itemR(part, "physics_type", expand=True)
if part.physics_type != 'NO':
row = layout.row()
col = row.column(align=True)
col.itemR(part, "particle_size")
col.itemR(part, "random_size", slider=True)
col = row.column(align=True)
col.itemR(part, "mass")
col.itemR(part, "sizemass", text="Multiply mass with size")
if part.physics_type == 'NEWTON':
split = layout.split()
sub = split.column()
sub.itemL(text="Forces:")
sub.itemR(part, "brownian_factor")
sub.itemR(part, "drag_factor", slider=True)
sub.itemR(part, "damp_factor", slider=True)
sub = split.column()
sub.itemR(part, "size_deflect")
sub.itemR(part, "die_on_collision")
sub.itemR(part, "integrator")
sub.itemR(part, "time_tweak")
elif part.physics_type == 'KEYED':
split = layout.split()
sub = split.column()
row = layout.row()
col = row.column()
col.active = not psys.keyed_timing
col.itemR(part, "keyed_loops", text="Loops")
row.itemR(psys, "keyed_timing", text="Use Timing")
layout.itemL(text="Keys:")
elif part.physics_type=='BOIDS':
boids = part.boids
row = layout.row()
row.itemR(boids, "allow_flight")
row.itemR(boids, "allow_land")
row.itemR(boids, "allow_climb")
split = layout.split()
sub = split.column()
col = sub.column(align=True)
col.active = boids.allow_flight
col.itemR(boids, "air_max_speed")
col.itemR(boids, "air_min_speed", slider="True")
col.itemR(boids, "air_max_acc", slider="True")
col.itemR(boids, "air_max_ave", slider="True")
col.itemR(boids, "air_personal_space")
row = col.row()
row.active = (boids.allow_land or boids.allow_climb) and boids.allow_flight
row.itemR(boids, "landing_smoothness")
sub = split.column()
col = sub.column(align=True)
col.active = boids.allow_land or boids.allow_climb
col.itemR(boids, "land_max_speed")
col.itemR(boids, "land_jump_speed")
col.itemR(boids, "land_max_acc", slider="True")
col.itemR(boids, "land_max_ave", slider="True")
col.itemR(boids, "land_personal_space")
col.itemR(boids, "land_stick_force")
row = layout.row()
col = row.column(align=True)
col.itemL(text="Battle:")
col.itemR(boids, "health")
col.itemR(boids, "strength")
col.itemR(boids, "aggression")
col.itemR(boids, "accuracy")
col.itemR(boids, "range")
col = row.column()
col.itemL(text="Misc:")
col.itemR(boids, "banking", slider=True)
col.itemR(boids, "height", slider=True)
if part.physics_type=='KEYED' or part.physics_type=='BOIDS':
if part.physics_type=='BOIDS':
layout.itemL(text="Relations:")
row = layout.row()
row.template_list(psys, "targets", psys, "active_particle_target_index")
col = row.column()
subrow = col.row()
subcol = subrow.column(align=True)
subcol.itemO("particle.new_target", icon='ICON_ZOOMIN', text="")
subcol.itemO("particle.remove_target", icon='ICON_ZOOMOUT', text="")
subrow = col.row()
subcol = subrow.column(align=True)
subcol.itemO("particle.target_move_up", icon='VICON_MOVE_UP', text="")
subcol.itemO("particle.target_move_down", icon='VICON_MOVE_DOWN', text="")
key = psys.active_particle_target
if key:
row = layout.row()
if part.physics_type=='KEYED':
col = row.column()
#doesn't work yet
#col.red_alert = key.valid
col.itemR(key, "object", text="")
col.itemR(key, "system", text="System")
col = row.column();
col.active = psys.keyed_timing
col.itemR(key, "time")
col.itemR(key, "duration")
else:
subrow = row.row()
#doesn't work yet
#subrow.red_alert = key.valid
subrow.itemR(key, "object", text="")
subrow.itemR(key, "system", text="System")
layout.itemR(key, "mode", expand=True)
class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
__label__ = "Boid Brain"
def poll(self, context):
psys = context.particle_system
if psys==None: return False
if psys.settings==None: return False
if psys.point_cache.external: return False
return psys.settings.physics_type=='BOIDS'
def draw(self, context):
layout = self.layout
boids = context.particle_system.settings.boids
layout.enabled = particle_panel_enabled(context, context.particle_system)
# Currently boids can only use the first state so these are commented out for now.
#row = layout.row()
#row.template_list(boids, "states", boids, "active_boid_state_index", compact="True")
#col = row.row()
#subrow = col.row(align=True)
#subrow.itemO("boid.state_add", icon='ICON_ZOOMIN', text="")
#subrow.itemO("boid.state_del", icon='ICON_ZOOMOUT', text="")
#subrow = row.row(align=True)
#subrow.itemO("boid.state_move_up", icon='VICON_MOVE_UP', text="")
#subrow.itemO("boid.state_move_down", icon='VICON_MOVE_DOWN', text="")
state = boids.active_boid_state
#layout.itemR(state, "name", text="State name")
row = layout.row()
row.itemR(state, "ruleset_type")
if state.ruleset_type=='FUZZY':
row.itemR(state, "rule_fuzziness", slider=True)
else:
row.itemL(text="")
row = layout.row()
row.template_list(state, "rules", state, "active_boid_rule_index")
col = row.column()
subrow = col.row()
subcol = subrow.column(align=True)
subcol.item_menu_enumO("boid.rule_add", "type", icon='ICON_ZOOMIN', text="")
subcol.itemO("boid.rule_del", icon='ICON_ZOOMOUT', text="")
subrow = col.row()
subcol = subrow.column(align=True)
subcol.itemO("boid.rule_move_up", icon='VICON_MOVE_UP', text="")
subcol.itemO("boid.rule_move_down", icon='VICON_MOVE_DOWN', text="")
rule = state.active_boid_rule
if rule:
row = layout.row()
row.itemR(rule, "name", text="")
#somebody make nice icons for boids here please! -jahka
row.itemR(rule, "in_air", icon='VICON_MOVE_UP', text="")
row.itemR(rule, "on_land", icon='VICON_MOVE_DOWN', text="")
row = layout.row()
if rule.type == 'GOAL':
row.itemR(rule, "object")
row = layout.row()
row.itemR(rule, "predict")
elif rule.type == 'AVOID':
row.itemR(rule, "object")
row = layout.row()
row.itemR(rule, "predict")
row.itemR(rule, "fear_factor")
elif rule.type == 'FOLLOW_PATH':
row.itemL(text="Not yet functional.")
elif rule.type == 'AVOID_COLLISION':
row.itemR(rule, "boids")
row.itemR(rule, "deflectors")
row.itemR(rule, "look_ahead")
elif rule.type == 'FOLLOW_LEADER':
row.itemR(rule, "object", text="")
row.itemR(rule, "distance")
row = layout.row()
row.itemR(rule, "line")
subrow = row.row()
subrow.active = rule.line
subrow.itemR(rule, "queue_size")
elif rule.type == 'AVERAGE_SPEED':
row.itemR(rule, "speed", slider=True)
row.itemR(rule, "wander", slider=True)
row.itemR(rule, "level", slider=True)
elif rule.type == 'FIGHT':
row.itemR(rule, "distance")
row.itemR(rule, "flee_distance")
class PARTICLE_PT_render(ParticleButtonsPanel):
__label__ = "Render"
def poll(self, context):
psys = context.particle_system
if psys==None: return False
if psys.settings==None: return False
return True;
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
row = layout.row()
row.itemR(part, "material")
row.itemR(psys, "parent");
split = layout.split()
sub = split.column()
sub.itemR(part, "emitter");
sub.itemR(part, "parent");
sub = split.column()
sub.itemR(part, "unborn");
sub.itemR(part, "died");
row = layout.row()
row.itemR(part, "ren_as", expand=True)
split = layout.split()
sub = split.column()
if part.ren_as == 'LINE':
sub.itemR(part, "line_length_tail")
sub.itemR(part, "line_length_head")
sub = split.column()
sub.itemR(part, "velocity_length")
elif part.ren_as == 'PATH':
if (part.type!='HAIR' and part.physics_type!='KEYED' and psys.point_cache.baked==False):
box = layout.box()
box.itemL(text="Baked or keyed particles needed for correct rendering.")
return
sub.itemR(part, "render_strand")
colsub = sub.column()
colsub.active = part.render_strand == False
colsub.itemR(part, "render_adaptive")
colsub = sub.column()
colsub.active = part.render_adaptive or part.render_strand == True
colsub.itemR(part, "adaptive_angle")
colsub = sub.column()
colsub.active = part.render_adaptive == True and part.render_strand == False
colsub.itemR(part, "adaptive_pix")
sub.itemR(part, "hair_bspline")
sub.itemR(part, "render_step", text="Steps")
sub = split.column()
sub.itemL(text="Timing:")
sub.itemR(part, "abs_path_time")
sub.itemR(part, "path_start", text="Start", slider= not part.abs_path_time)
sub.itemR(part, "path_end", text="End", slider= not part.abs_path_time)
sub.itemR(part, "random_length", text="Random", slider=True)
row = layout.row()
col = row.column()
if part.type=='HAIR' and part.render_strand==True and part.child_type=='FACES':
layout.itemR(part, "enable_simplify")
if part.enable_simplify==True:
row = layout.row()
row.itemR(part, "simplify_refsize")
row.itemR(part, "simplify_rate")
row.itemR(part, "simplify_transition")
row = layout.row()
row.itemR(part, "viewport")
subrow = row.row()
subrow.active = part.viewport==True
subrow.itemR(part, "simplify_viewport")
elif part.ren_as == 'OBJECT':
sub.itemR(part, "dupli_object")
sub.itemR(part, "use_global_dupli")
elif part.ren_as == 'GROUP':
sub.itemR(part, "dupli_group")
split = layout.split()
sub = split.column()
sub.itemR(part, "whole_group")
colsub = sub.column()
colsub.active = part.whole_group == False
colsub.itemR(part, "use_group_count")
sub = split.column()
colsub = sub.column()
colsub.active = part.whole_group == False
colsub.itemR(part, "use_global_dupli")
colsub.itemR(part, "rand_group")
if part.use_group_count and not part.whole_group:
row = layout.row()
row.template_list(part, "dupliweights", part, "active_dupliweight_index")
col = row.column()
subrow = col.row()
subcol = subrow.column(align=True)
subcol.itemO("particle.dupliob_copy", icon='ICON_ZOOMIN', text="")
subcol.itemO("particle.dupliob_remove", icon='ICON_ZOOMOUT', text="")
subcol.itemO("particle.dupliob_move_up", icon='VICON_MOVE_UP', text="")
subcol.itemO("particle.dupliob_move_down", icon='VICON_MOVE_DOWN', text="")
weight = part.active_dupliweight
if weight:
row = layout.row()
row.itemR(weight, "count")
elif part.ren_as == 'BILLBOARD':
sub.itemL(text="Align:")
row = layout.row()
row.itemR(part, "billboard_align", expand=True)
row.itemR(part, "billboard_lock", text="Lock")
row = layout.row()
row.itemR(part, "billboard_object")
row = layout.row()
col = row.column(align=True)
col.itemL(text="Tilt:")
col.itemR(part, "billboard_tilt", text="Angle", slider=True)
col.itemR(part, "billboard_random_tilt", slider=True)
col = row.column()
col.itemR(part, "billboard_offset")
row = layout.row()
row.itemR(psys, "billboard_normal_uv")
row = layout.row()
row.itemR(psys, "billboard_time_index_uv")
row = layout.row()
row.itemL(text="Split uv's:")
row.itemR(part, "billboard_uv_split", text="Number of splits")
row = layout.row()
row.itemR(psys, "billboard_split_uv")
row = layout.row()
row.itemL(text="Animate:")
row.itemR(part, "billboard_animation", expand=True)
row.itemL(text="Offset:")
row.itemR(part, "billboard_split_offset", expand=True)
if part.ren_as == 'HALO' or part.ren_as == 'LINE' or part.ren_as=='BILLBOARD':
row = layout.row()
col = row.column()
col.itemR(part, "trail_count")
if part.trail_count > 1:
col.itemR(part, "abs_path_time", text="Length in frames")
col = row.column()
col.itemR(part, "path_end", text="Length", slider=not part.abs_path_time)
col.itemR(part, "random_length", text="Random", slider=True)
else:
col = row.column()
col.itemL(text="")
class PARTICLE_PT_draw(ParticleButtonsPanel):
__label__ = "Display"
__default_closed__ = True
def poll(self, context):
psys = context.particle_system
if psys==None: return False
if psys.settings==None: return False
return True;
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
row = layout.row()
row.itemR(part, "draw_as", expand=True)
if part.draw_as=='NONE' or (part.ren_as=='NONE' and part.draw_as=='RENDER'):
return
path = (part.ren_as=='PATH' and part.draw_as=='RENDER') or part.draw_as=='PATH'
if path and part.type!='HAIR' and part.physics_type!='KEYED' and psys.point_cache.baked==False:
box = layout.box()
box.itemL(text="Baked or keyed particles needed for correct drawing.")
return
row = layout.row()
row.itemR(part, "display", slider=True)
if part.draw_as!='RENDER' or part.ren_as=='HALO':
row.itemR(part, "draw_size")
else:
row.itemL(text="")
row = layout.row()
col = row.column()
col.itemR(part, "show_size")
col.itemR(part, "velocity")
col.itemR(part, "num")
if part.physics_type == 'BOIDS':
col.itemR(part, "draw_health")
col = row.column()
col.itemR(part, "material_color", text="Use material color")
if (path):
col.itemR(part, "draw_step")
else:
subcol = col.column()
subcol.active = part.material_color==False
#subcol.itemL(text="color")
#subcol.itemL(text="Override material color")
class PARTICLE_PT_children(ParticleButtonsPanel):
__label__ = "Children"
__default_closed__ = True
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
layout.row().itemR(part, "child_type", expand=True)
if part.child_type=='NONE':
return
row = layout.row()
col = row.column(align=True)
col.itemR(part, "child_nbr", text="Display")
col.itemR(part, "rendered_child_nbr", text="Render")
col = row.column(align=True)
if part.child_type=='FACES':
col.itemR(part, "virtual_parents", slider=True)
else:
col.itemR(part, "child_radius", text="Radius")
col.itemR(part, "child_roundness", text="Roundness", slider=True)
col = row.column(align=True)
col.itemR(part, "child_size", text="Size")
col.itemR(part, "child_random_size", text="Random")
layout.row().itemL(text="Effects:")
row = layout.row()
col = row.column(align=True)
col.itemR(part, "clump_factor", slider=True)
col.itemR(part, "clumppow", slider=True)
col = row.column(align=True)
col.itemR(part, "rough_endpoint")
col.itemR(part, "rough_end_shape")
row = layout.row()
col = row.column(align=True)
col.itemR(part, "rough1")
col.itemR(part, "rough1_size")
col = row.column(align=True)
col.itemR(part, "rough2")
col.itemR(part, "rough2_size")
col.itemR(part, "rough2_thres", slider=True)
row = layout.row()
col = row.column(align=True)
col.itemR(part, "child_length", slider=True)
col.itemR(part, "child_length_thres", slider=True)
col = row.column(align=True)
col.itemL(text="Space reserved for")
col.itemL(text="hair parting controls")
layout.row().itemL(text="Kink:")
layout.row().itemR(part, "kink", expand=True)
split = layout.split()
sub = split.column()
sub.itemR(part, "kink_amplitude")
sub.itemR(part, "kink_frequency")
sub = split.column()
sub.itemR(part, "kink_shape", slider=True)
class PARTICLE_PT_field_weights(ParticleButtonsPanel):
__label__ = "Field Weights"
__default_closed__ = True
def draw(self, context):
part = context.particle_system.settings
effector_weights_ui(self, part.effector_weights)
if part.type == 'HAIR':
self.layout.itemR(part.effector_weights, "do_growing_hair")
class PARTICLE_PT_force_fields(ParticleButtonsPanel):
__label__ = "Force Field Settings"
__default_closed__ = True
def draw(self, context):
layout = self.layout
part = context.particle_system.settings
layout.itemR(part, "self_effect")
split = layout.split(percentage=0.2)
split.itemL(text="Type 1:")
split.itemR(part.force_field_1, "type",text="")
basic_force_field_settings_ui(self, part.force_field_1)
basic_force_field_falloff_ui(self, part.force_field_1)
if part.force_field_1.type != 'NONE':
layout.itemL(text="")
split = layout.split(percentage=0.2)
split.itemL(text="Type 2:")
split.itemR(part.force_field_2, "type",text="")
basic_force_field_settings_ui(self, part.force_field_2)
basic_force_field_falloff_ui(self, part.force_field_2)
class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
__label__ = "Vertexgroups"
__default_closed__ = True
def draw(self, context):
layout = self.layout
psys = context.particle_system
part = psys.settings
layout.itemL(text="Nothing here yet.")
#row = layout.row()
#row.itemL(text="Vertex Group")
#row.itemL(text="Negate")
#row = layout.row()
#row.itemR(psys, "vertex_group_density")
#row.itemR(psys, "vertex_group_density_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_velocity")
#row.itemR(psys, "vertex_group_velocity_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_length")
#row.itemR(psys, "vertex_group_length_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_clump")
#row.itemR(psys, "vertex_group_clump_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_kink")
#row.itemR(psys, "vertex_group_kink_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_roughness1")
#row.itemR(psys, "vertex_group_roughness1_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_roughness2")
#row.itemR(psys, "vertex_group_roughness2_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_roughness_end")
#row.itemR(psys, "vertex_group_roughness_end_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_size")
#row.itemR(psys, "vertex_group_size_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_tangent")
#row.itemR(psys, "vertex_group_tangent_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_rotation")
#row.itemR(psys, "vertex_group_rotation_negate", text="")
#row = layout.row()
#row.itemR(psys, "vertex_group_field")
#row.itemR(psys, "vertex_group_field_negate", text="")
bpy.types.register(PARTICLE_PT_particles)
bpy.types.register(PARTICLE_PT_hair_dynamics)
bpy.types.register(PARTICLE_PT_cache)
bpy.types.register(PARTICLE_PT_emission)
bpy.types.register(PARTICLE_PT_velocity)
bpy.types.register(PARTICLE_PT_rotation)
bpy.types.register(PARTICLE_PT_physics)
bpy.types.register(PARTICLE_PT_boidbrain)
bpy.types.register(PARTICLE_PT_render)
bpy.types.register(PARTICLE_PT_draw)
bpy.types.register(PARTICLE_PT_children)
bpy.types.register(PARTICLE_PT_field_weights)
bpy.types.register(PARTICLE_PT_force_fields)
bpy.types.register(PARTICLE_PT_vertexgroups)

View File

@@ -1,187 +0,0 @@
import bpy
from buttons_physics_common import point_cache_ui
from buttons_physics_common import effector_weights_ui
def cloth_panel_enabled(md):
return md.point_cache.baked==False
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_cloth(PhysicButtonsPanel):
__label__ = "Cloth"
def draw(self, context):
layout = self.layout
md = context.cloth
ob = context.object
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add")
split.itemL()
if md:
cloth = md.settings
layout.active = cloth_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemL(text="Quality:")
col.itemR(cloth, "quality", text="Steps",slider=True)
col.itemL(text="Material:")
sub = col.column(align=True)
sub.itemR(cloth, "mass")
sub.itemR(cloth, "structural_stiffness", text="Structural")
sub.itemR(cloth, "bending_stiffness", text="Bending")
col = split.column()
col.itemL(text="Presets:")
col.itemL(text="TODO!")
col.itemL(text="Damping:")
sub = col.column(align=True)
sub.itemR(cloth, "spring_damping", text="Spring")
sub.itemR(cloth, "air_damping", text="Air")
col.itemR(cloth, "pin_cloth", text="Pin")
sub = col.column(align=True)
sub.active = cloth.pin_cloth
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
# Disabled for now
"""
if cloth.mass_vertex_group:
layout.itemL(text="Goal:")
col = layout.column_flow()
col.itemR(cloth, "goal_default", text="Default")
col.itemR(cloth, "goal_spring", text="Stiffness")
col.itemR(cloth, "goal_friction", text="Friction")
"""
class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
__label__ = "Cloth Cache"
__default_closed__ = True
def poll(self, context):
return context.cloth
def draw(self, context):
md = context.cloth
point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0)
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
__label__ = "Cloth Collision"
__default_closed__ = True
def poll(self, context):
return context.cloth
def draw_header(self, context):
cloth = context.cloth.collision_settings
self.layout.active = cloth_panel_enabled(context.cloth)
self.layout.itemR(cloth, "enable_collision", text="")
def draw(self, context):
layout = self.layout
cloth = context.cloth.collision_settings
md = context.cloth
layout.active = cloth.enable_collision and cloth_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
col.itemR(cloth, "min_distance", slider=True, text="Distance")
col.itemR(cloth, "friction")
col = split.column()
col.itemR(cloth, "enable_self_collision", text="Self Collision")
sub = col.column()
sub.active = cloth.enable_self_collision
sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
sub.itemR(cloth, "self_min_distance", slider=True, text="Distance")
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
__label__ = "Cloth Stiffness Scaling"
__default_closed__ = True
def poll(self, context):
return context.cloth
def draw_header(self, context):
cloth = context.cloth.settings
self.layout.active = cloth_panel_enabled(context.cloth)
self.layout.itemR(cloth, "stiffness_scaling", text="")
def draw(self, context):
layout = self.layout
md = context.cloth
ob = context.object
cloth = context.cloth.settings
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemL(text="Structural Stiffness:")
sub = col.column(align=True)
sub.itemR(cloth, "structural_stiffness_max", text="Max")
sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.itemL(text="Bending Stiffness:")
sub = col.column(align=True)
sub.itemR(cloth, "bending_stiffness_max", text="Max")
sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
__label__ = "Cloth Field Weights"
__default_closed__ = True
def poll(self, context):
return (context.cloth)
def draw(self, context):
cloth = context.cloth.settings
effector_weights_ui(self, cloth.effector_weights)
bpy.types.register(PHYSICS_PT_cloth)
bpy.types.register(PHYSICS_PT_cloth_cache)
bpy.types.register(PHYSICS_PT_cloth_collision)
bpy.types.register(PHYSICS_PT_cloth_stiffness)
bpy.types.register(PHYSICS_PT_cloth_field_weights)

View File

@@ -1,159 +0,0 @@
import bpy
def point_cache_ui(self, cache, enabled, particles, smoke):
layout = self.layout
layout.set_context_pointer("PointCache", cache)
row = layout.row()
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 )
col = row.column(align=True)
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
row = layout.row()
row.itemL(text="File Name:")
if particles:
row.itemR(cache, "external")
if cache.external:
split = layout.split(percentage=0.80)
split.itemR(cache, "name", text="")
split.itemR(cache, "index", text="")
layout.itemL(text="File Path:")
layout.itemR(cache, "filepath", text="")
layout.itemL(text=cache.info)
else:
layout.itemR(cache, "name", text="")
if not particles:
row = layout.row()
row.enabled = enabled
row.itemR(cache, "start_frame")
row.itemR(cache, "end_frame")
row = layout.row()
if cache.baked == True:
row.itemO("ptcache.free_bake", text="Free Bake")
else:
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
sub = row.row()
sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
row = layout.row()
row.enabled = enabled
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
if not smoke:
row.itemR(cache, "step");
if not smoke:
row = layout.row()
sub = row.row()
sub.enabled = enabled
sub.itemR(cache, "quick_cache")
row.itemR(cache, "disk_cache")
layout.itemL(text=cache.info)
layout.itemS()
row = layout.row()
row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
def effector_weights_ui(self, weights):
layout = self.layout
layout.itemR(weights, "group")
split = layout.split()
split.itemR(weights, "gravity", slider=True)
split.itemR(weights, "all", slider=True)
layout.itemS()
flow = layout.column_flow()
flow.itemR(weights, "force", slider=True)
flow.itemR(weights, "vortex", slider=True)
flow.itemR(weights, "magnetic", slider=True)
flow.itemR(weights, "wind", slider=True)
flow.itemR(weights, "curveguide", slider=True)
flow.itemR(weights, "texture", slider=True)
flow.itemR(weights, "harmonic", slider=True)
flow.itemR(weights, "charge", slider=True)
flow.itemR(weights, "lennardjones", slider=True)
flow.itemR(weights, "turbulence", slider=True)
flow.itemR(weights, "drag", slider=True)
flow.itemR(weights, "boid", slider=True)
def basic_force_field_settings_ui(self, field):
layout = self.layout
split = layout.split()
if not field or field.type == 'NONE':
return
col = split.column()
if field.type == 'DRAG':
col.itemR(field, "linear_drag", text="Linear")
else:
col.itemR(field, "strength")
if field.type == 'TURBULENCE':
col.itemR(field, "size")
col.itemR(field, "flow")
elif field.type == 'HARMONIC':
col.itemR(field, "harmonic_damping", text="Damping")
elif field.type == 'VORTEX' and field.shape != 'POINT':
col.itemR(field, "inflow")
elif field.type == 'DRAG':
col.itemR(field, "quadratic_drag", text="Quadratic")
else:
col.itemR(field, "flow")
col = split.column()
col.itemR(field, "noise")
col.itemR(field, "seed")
if field.type == 'TURBULENCE':
col.itemR(field, "global_coordinates", text="Global")
split = layout.split()
col = split.column()
col.itemL(text="Effect point:")
col.itemR(field, "do_location")
col.itemR(field, "do_rotation")
sub = split.column()
sub.itemL(text="Collision:")
sub.itemR(field, "do_absorption")
def basic_force_field_falloff_ui(self, field):
layout = self.layout
split = layout.split(percentage=0.35)
if not field or field.type == 'NONE':
return
col = split.column()
col.itemR(field, "z_direction", text="")
col.itemR(field, "use_min_distance", text="Use Minimum")
col.itemR(field, "use_max_distance", text="Use Maximum")
col = split.column()
col.itemR(field, "falloff_power", text="Power")
sub = col.column()
sub.active = field.use_min_distance
sub.itemR(field, "minimum_distance", text="Distance")
sub = col.column()
sub.active = field.use_max_distance
sub.itemR(field, "maximum_distance", text="Distance")

View File

@@ -1,202 +0,0 @@
import bpy
from buttons_physics_common import basic_force_field_settings_ui
from buttons_physics_common import basic_force_field_falloff_ui
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
rd = context.scene.render_data
return (context.object) and (not rd.use_game_engine)
class PHYSICS_PT_field(PhysicButtonsPanel):
__label__ = "Force Fields"
def draw(self, context):
layout = self.layout
ob = context.object
field = ob.field
split = layout.split(percentage=0.2)
split.itemL(text="Type:")
split.itemR(field, "type",text="")
if field.type not in ('NONE', 'GUIDE', 'TEXTURE'):
split = layout.split(percentage=0.2)
#split = layout.row()
split.itemL(text="Shape:")
split.itemR(field, "shape", text="")
split = layout.split()
if field.type == 'NONE':
return # nothing to draw
elif field.type == 'GUIDE':
col = split.column()
col.itemR(field, "guide_minimum")
col.itemR(field, "guide_free")
col.itemR(field, "falloff_power")
col.itemR(field, "guide_path_add")
col = split.column()
col.itemL(text="Clumping:")
col.itemR(field, "guide_clump_amount")
col.itemR(field, "guide_clump_shape")
row = layout.row()
row.itemR(field, "use_max_distance")
sub = row.row()
sub.active = field.use_max_distance
sub.itemR(field, "maximum_distance")
layout.itemS()
layout.itemR(field, "guide_kink_type")
if (field.guide_kink_type != "NONE"):
layout.itemR(field, "guide_kink_axis")
flow = layout.column_flow()
flow.itemR(field, "guide_kink_frequency")
flow.itemR(field, "guide_kink_shape")
flow.itemR(field, "guide_kink_amplitude")
elif field.type == 'TEXTURE':
col = split.column()
col.itemR(field, "strength")
col.itemR(field, "texture", text="")
col.itemR(field, "texture_mode", text="")
col.itemR(field, "texture_nabla")
col = split.column()
col.itemR(field, "use_coordinates")
col.itemR(field, "root_coordinates")
col.itemR(field, "force_2d")
else :
basic_force_field_settings_ui(self, field)
if field.type not in ('NONE', 'GUIDE'):
layout.itemL(text="Falloff:")
layout.itemR(field, "falloff_type", expand=True)
basic_force_field_falloff_ui(self, field)
if field.falloff_type == 'CONE':
layout.itemS()
split = layout.split(percentage=0.35)
col = split.column()
col.itemL(text="Angular:")
col.itemR(field, "use_radial_min", text="Use Minimum")
col.itemR(field, "use_radial_max", text="Use Maximum")
col = split.column()
col.itemR(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
sub.itemR(field, "radial_minimum", text="Angle")
sub = col.column()
sub.active = field.use_radial_max
sub.itemR(field, "radial_maximum", text="Angle")
elif field.falloff_type == 'TUBE':
layout.itemS()
split = layout.split(percentage=0.35)
col = split.column()
col.itemL(text="Radial:")
col.itemR(field, "use_radial_min", text="Use Minimum")
col.itemR(field, "use_radial_max", text="Use Maximum")
col = split.column()
col.itemR(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
sub.itemR(field, "radial_minimum", text="Distance")
sub = col.column()
sub.active = field.use_radial_max
sub.itemR(field, "radial_maximum", text="Distance")
class PHYSICS_PT_collision(PhysicButtonsPanel):
__label__ = "Collision"
#__default_closed__ = True
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
def draw(self, context):
layout = self.layout
md = context.collision
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
col = split.column()
#row = split.row(align=True)
#row.itemR(md, "render", text="")
#row.itemR(md, "realtime", text="")
coll = md.settings
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
split.itemL()
coll = None
if coll:
settings = context.object.collision
layout.active = settings.enabled
split = layout.split()
col = split.column()
col.itemL(text="Particle:")
col.itemR(settings, "permeability", slider=True)
col.itemL(text="Particle Damping:")
sub = col.column(align=True)
sub.itemR(settings, "damping_factor", text="Factor", slider=True)
sub.itemR(settings, "random_damping", text="Random", slider=True)
col.itemL(text="Soft Body and Cloth:")
sub = col.column(align=True)
sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
layout.itemL(text="Force Fields:")
layout.itemR(settings, "absorption", text="Absorption")
col = split.column()
col.itemL(text="")
col.itemR(settings, "kill_particles")
col.itemL(text="Particle Friction:")
sub = col.column(align=True)
sub.itemR(settings, "friction_factor", text="Factor", slider=True)
sub.itemR(settings, "random_friction", text="Random", slider=True)
col.itemL(text="Soft Body Damping:")
col.itemR(settings, "damping", text="Factor", slider=True)
bpy.types.register(PHYSICS_PT_field)
bpy.types.register(PHYSICS_PT_collision)

View File

@@ -1,257 +0,0 @@
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_fluid(PhysicButtonsPanel):
__label__ = "Fluid"
def draw(self, context):
layout = self.layout
md = context.fluid
ob = context.object
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
fluid = md.settings
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add")
split.itemL()
fluid = None
if fluid:
layout.itemR(fluid, "type")
if fluid.type == 'DOMAIN':
layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(fluid, "resolution", text="Final")
col.itemL(text="Render Display:")
col.itemR(fluid, "render_display_mode", text="")
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(fluid, "start_time", text="Start")
sub.itemR(fluid, "end_time", text="End")
col = split.column()
col.itemL(text="Required Memory: " + fluid.memory_estimate)
col.itemR(fluid, "preview_resolution", text="Preview")
col.itemL(text="Viewport Display:")
col.itemR(fluid, "viewport_display_mode", text="")
col.itemL()
col.itemR(fluid, "generate_speed_vectors")
col.itemR(fluid, "reverse_frames")
layout.itemR(fluid, "path", text="")
elif fluid.type == 'FLUID':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col = split.column()
col.itemL(text="Initial Velocity:")
col.itemR(fluid, "initial_velocity", text="")
elif fluid.type == 'OBSTACLE':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col = split.column()
col.itemL(text="Slip Type:")
col.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
col.itemL(text="Impact:")
col.itemR(fluid, "impact_factor", text="Factor")
elif fluid.type == 'INFLOW':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col.itemR(fluid, "local_coordinates")
col = split.column()
col.itemL(text="Inflow Velocity:")
col.itemR(fluid, "inflow_velocity", text="")
elif fluid.type == 'OUTFLOW':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
split.column()
elif fluid.type == 'PARTICLE':
split = layout.split(percentage=0.5)
col = split.column()
col.itemL(text="Influence:")
col.itemR(fluid, "particle_influence", text="Size")
col.itemR(fluid, "alpha_influence", text="Alpha")
col = split.column()
col.itemL(text="Type:")
col.itemR(fluid, "drops")
col.itemR(fluid, "floats")
col = split.column()
col.itemL()
col.itemR(fluid, "tracer")
layout.itemR(fluid, "path", text="")
elif fluid.type == 'CONTROL':
split = layout.split()
col = split.column()
col.itemL(text="")
col.itemR(fluid, "quality", slider=True)
col.itemR(fluid, "reverse_frames")
col = split.column()
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(fluid, "start_time", text="Start")
sub.itemR(fluid, "end_time", text="End")
split = layout.split()
col = split.column()
col.itemL(text="Attraction Force:")
sub = col.column(align=True)
sub.itemR(fluid, "attraction_strength", text="Strength")
sub.itemR(fluid, "attraction_radius", text="Radius")
col = split.column()
col.itemL(text="Velocity Force:")
sub = col.column(align=True)
sub.itemR(fluid, "velocity_strength", text="Strength")
sub.itemR(fluid, "velocity_radius", text="Radius")
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
__label__ = "Domain World"
__default_closed__ = True
def poll(self, context):
md = context.fluid
return md and (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
fluid = context.fluid.settings
split = layout.split()
col = split.column()
col.itemL(text="Gravity:")
col.itemR(fluid, "gravity", text="")
col.itemL(text="Real World Size:")
col.itemR(fluid, "real_world_size", text="Metres")
col = split.column()
col.itemL(text="Viscosity Presets:")
sub = col.column(align=True)
sub.itemR(fluid, "viscosity_preset", text="")
if fluid.viscosity_preset == 'MANUAL':
sub.itemR(fluid, "viscosity_base", text="Base")
sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
else:
sub.itemL()
sub.itemL()
col.itemL(text="Optimization:")
sub = col.column(align=True)
sub.itemR(fluid, "grid_levels", slider=True)
sub.itemR(fluid, "compressibility", slider=True)
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
__label__ = "Domain Boundary"
__default_closed__ = True
def poll(self, context):
md = context.fluid
return md and (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
fluid = context.fluid.settings
split = layout.split()
col = split.column()
col.itemL(text="Slip Type:")
sub = col.column(align=True)
sub.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
col = split.column()
col.itemL(text="Surface:")
sub = col.column(align=True)
sub.itemR(fluid, "surface_smoothing", text="Smoothing")
sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")
class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
__label__ = "Domain Particles"
__default_closed__ = True
def poll(self, context):
md = context.fluid
return md and (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
fluid = context.fluid.settings
col = layout.column(align=True)
col.itemR(fluid, "tracer_particles")
col.itemR(fluid, "generate_particles")
bpy.types.register(PHYSICS_PT_fluid)
bpy.types.register(PHYSICS_PT_domain_gravity)
bpy.types.register(PHYSICS_PT_domain_boundary)
bpy.types.register(PHYSICS_PT_domain_particles)

View File

@@ -1,193 +0,0 @@
import bpy
from buttons_physics_common import point_cache_ui
from buttons_physics_common import effector_weights_ui
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_smoke(PhysicButtonsPanel):
__label__ = "Smoke"
def draw(self, context):
layout = self.layout
md = context.smoke
ob = context.object
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
split.itemL()
if md:
layout.itemR(md, "smoke_type", expand=True)
if md.smoke_type == 'TYPE_DOMAIN':
domain = md.domain_settings
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(domain, "maxres", text="Divisions")
col = split.column()
col.itemL(text="Behavior:")
col.itemR(domain, "alpha")
col.itemR(domain, "beta")
col.itemR(domain, "dissolve_smoke", text="Dissolve")
sub = col.column()
sub.active = domain.dissolve_smoke
sub.itemR(domain, "dissolve_speed", text="Time")
sub.itemR(domain, "dissolve_smoke_log", text="Slow")
elif md.smoke_type == 'TYPE_FLOW':
flow = md.flow_settings
split = layout.split()
col = split.column()
col.itemR(flow, "outflow")
col.itemL(text="Particle System:")
col.item_pointerR(flow, "psys", ob, "particle_systems", text="")
if md.flow_settings.outflow:
col = split.column()
else:
col = split.column()
col.itemL(text="Behavior:")
col.itemR(flow, "temperature")
col.itemR(flow, "density")
#elif md.smoke_type == 'TYPE_COLL':
# layout.itemS()
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
__label__ = "Smoke Groups"
__default_closed__ = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
layout = self.layout
group = context.smoke.domain_settings
split = layout.split()
col = split.column()
col.itemL(text="Flow Group:")
col.itemR(group, "fluid_group", text="")
#col.itemL(text="Effector Group:")
#col.itemR(group, "eff_group", text="")
col = split.column()
col.itemL(text="Collision Group:")
col.itemR(group, "coll_group", text="")
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
__label__ = "Smoke Cache"
__default_closed__ = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
cache = md.point_cache_low
point_cache_ui(self, cache, cache.baked==False, 0, 1)
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
__label__ = "Smoke High Resolution"
__default_closed__ = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw_header(self, context):
high = context.smoke.domain_settings
self.layout.itemR(high, "highres", text="")
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(md, "amplify", text="Divisions")
col = split.column()
col.itemL(text="Noise Method:")
col.row().itemR(md, "noise_type", text="")
col.itemR(md, "strength")
col.itemR(md, "viewhighres")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
__label__ = "Smoke High Resolution Cache"
__default_closed__ = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
cache = md.point_cache_high
point_cache_ui(self, cache, cache.baked==False, 0, 1)
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
__label__ = "Smoke Field Weights"
__default_closed__ = True
def poll(self, context):
smoke = context.smoke
return (smoke and smoke.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
domain = context.smoke.domain_settings
effector_weights_ui(self, domain.effector_weights)
bpy.types.register(PHYSICS_PT_smoke)
bpy.types.register(PHYSICS_PT_smoke_field_weights)
bpy.types.register(PHYSICS_PT_smoke_cache)
bpy.types.register(PHYSICS_PT_smoke_highres)
bpy.types.register(PHYSICS_PT_smoke_groups)
bpy.types.register(PHYSICS_PT_smoke_cache_highres)

View File

@@ -1,244 +0,0 @@
import bpy
from buttons_physics_common import point_cache_ui
from buttons_physics_common import effector_weights_ui
def softbody_panel_enabled(md):
return md.point_cache.baked==False
class PhysicButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_softbody(PhysicButtonsPanel):
__label__ = "Soft Body"
def draw(self, context):
layout = self.layout
md = context.soft_body
ob = context.object
split = layout.split()
split.operator_context = "EXEC_DEFAULT"
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
split.itemL("")
if md:
softbody = md.settings
# General
split = layout.split()
split.enabled = softbody_panel_enabled(md)
col = split.column()
col.itemL(text="Object:")
col.itemR(softbody, "mass")
col.itemR(softbody, "friction")
col = split.column()
col.itemL(text="Simulation:")
col.itemR(softbody, "speed")
class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
__label__ = "Soft Body Cache"
__default_closed__ = True
def poll(self, context):
return context.soft_body
def draw(self, context):
md = context.soft_body
point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0)
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
__label__ = "Soft Body Goal"
__default_closed__ = True
def poll(self, context):
return context.soft_body
def draw_header(self, context):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
self.layout.itemR(softbody, "use_goal", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody.use_goal and softbody_panel_enabled(md)
split = layout.split()
# Goal
split = layout.split()
col = split.column()
col.itemL(text="Goal Strengths:")
col.itemR(softbody, "goal_default", text="Default")
sub = col.column(align=True)
sub.itemR(softbody, "goal_min", text="Minimum")
sub.itemR(softbody, "goal_max", text="Maximum")
col = split.column()
col.itemL(text="Goal Settings:")
col.itemR(softbody, "goal_spring", text="Stiffness")
col.itemR(softbody, "goal_friction", text="Damping")
layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
__label__ = "Soft Body Edges"
__default_closed__ = True
def poll(self, context):
return context.soft_body
def draw_header(self, context):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
self.layout.itemR(softbody, "use_edges", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody.use_edges and softbody_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemL(text="Springs:")
col.itemR(softbody, "pull")
col.itemR(softbody, "push")
col.itemR(softbody, "damp")
col.itemR(softbody, "plastic")
col.itemR(softbody, "bending")
col.itemR(softbody, "spring_length", text="Length")
col = split.column()
col.itemR(softbody, "stiff_quads")
sub = col.column()
sub.active = softbody.stiff_quads
sub.itemR(softbody, "shear")
col.itemR(softbody, "new_aero", text="Aero")
sub = col.column()
sub.enabled = softbody.new_aero
sub.itemR(softbody, "aero", text="Factor")
col.itemL(text="Collision:")
col.itemR(softbody, "edge_collision", text="Edge")
col.itemR(softbody, "face_collision", text="Face")
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
__label__ = "Soft Body Collision"
__default_closed__ = True
def poll(self, context):
return context.soft_body
def draw_header(self, context):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
self.layout.itemR(softbody, "self_collision", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody.self_collision and softbody_panel_enabled(md)
layout.itemL(text="Collision Type:")
layout.itemR(softbody, "collision_type", expand=True)
col = layout.column(align=True)
col.itemL(text="Ball:")
col.itemR(softbody, "ball_size", text="Size")
col.itemR(softbody, "ball_stiff", text="Stiffness")
col.itemR(softbody, "ball_damp", text="Dampening")
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
__label__ = "Soft Body Solver"
__default_closed__ = True
def poll(self, context):
return context.soft_body
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody_panel_enabled(md)
# Solver
split = layout.split()
col = split.column(align=True)
col.itemL(text="Step Size:")
col.itemR(softbody, "minstep")
col.itemR(softbody, "maxstep")
col.itemR(softbody, "auto_step", text="Auto-Step")
col = split.column()
col.itemR(softbody, "error_limit")
col.itemL(text="Helpers:")
col.itemR(softbody, "choke")
col.itemR(softbody, "fuzzy")
layout.itemL(text="Diagnostics:")
layout.itemR(softbody, "diagnose")
class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
__label__ = "Soft Body Field Weights"
__default_closed__ = True
def poll(self, context):
return (context.soft_body)
def draw(self, context):
md = context.soft_body
softbody = md.settings
effector_weights_ui(self, softbody.effector_weights)
bpy.types.register(PHYSICS_PT_softbody)
bpy.types.register(PHYSICS_PT_softbody_cache)
bpy.types.register(PHYSICS_PT_softbody_goal)
bpy.types.register(PHYSICS_PT_softbody_edge)
bpy.types.register(PHYSICS_PT_softbody_collision)
bpy.types.register(PHYSICS_PT_softbody_solver)
bpy.types.register(PHYSICS_PT_softbody_field_weights)

View File

@@ -1,454 +0,0 @@
import bpy
class RenderButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "render"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
rd = context.scene.render_data
return (context.scene and rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
class RENDER_PT_render(RenderButtonsPanel):
__label__ = "Render"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
row = layout.row()
row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
layout.itemR(rd, "display_mode", text="Display")
class RENDER_PT_layers(RenderButtonsPanel):
__label__ = "Layers"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render_data
row = layout.row()
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
col = row.column(align=True)
col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
rl = rd.layers[rd.active_layer_index]
if rl:
layout.itemR(rl, "name")
split = layout.split()
col = split.column()
col.itemR(scene, "visible_layers", text="Scene")
col = split.column()
col.itemR(rl, "visible_layers", text="Layer")
layout.itemR(rl, "light_override", text="Light")
layout.itemR(rl, "material_override", text="Material")
layout.itemS()
layout.itemL(text="Include:")
split = layout.split()
col = split.column()
col.itemR(rl, "zmask")
row = col.row()
row.itemR(rl, "zmask_negate", text="Negate")
row.active = rl.zmask
col.itemR(rl, "all_z")
col = split.column()
col.itemR(rl, "solid")
col.itemR(rl, "halo")
col.itemR(rl, "ztransp")
col = split.column()
col.itemR(rl, "sky")
col.itemR(rl, "edge")
col.itemR(rl, "strand")
if rl.zmask:
split = layout.split()
split.itemL(text="Zmask Layers:")
split.column().itemR(rl, "zmask_layers", text="")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Passes:")
col.itemR(rl, "pass_combined")
col.itemR(rl, "pass_z")
col.itemR(rl, "pass_vector")
col.itemR(rl, "pass_normal")
col.itemR(rl, "pass_uv")
col.itemR(rl, "pass_mist")
col.itemR(rl, "pass_object_index")
col = split.column()
col.itemL()
col.itemR(rl, "pass_color")
col.itemR(rl, "pass_diffuse")
row = col.row()
row.itemR(rl, "pass_specular")
row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_shadow")
row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_ao")
row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_reflection")
row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_refraction")
row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
class RENDER_PT_shading(RenderButtonsPanel):
__label__ = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column()
col.itemR(rd, "render_textures", text="Textures")
col.itemR(rd, "render_shadows", text="Shadows")
col.itemR(rd, "render_sss", text="Subsurface Scattering")
col.itemR(rd, "render_envmaps", text="Environment Map")
col = split.column()
col.itemR(rd, "render_raytracing", text="Ray Tracing")
col.itemR(rd, "color_management")
col.itemR(rd, "alpha_mode", text="Alpha")
class RENDER_PT_performance(RenderButtonsPanel):
__label__ = "Performance"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column(align=True)
col.itemL(text="Threads:")
col.row().itemR(rd, "threads_mode", expand=True)
sub = col.column()
sub.enabled = rd.threads_mode == 'THREADS_FIXED'
sub.itemR(rd, "threads")
col.itemL(text="Tiles:")
col.itemR(rd, "parts_x", text="X")
col.itemR(rd, "parts_y", text="Y")
col = split.column()
col.itemL(text="Memory:")
sub = col.column()
sub.itemR(rd, "save_buffers")
sub.enabled = not rd.full_sample
sub = col.column()
sub.active = rd.use_compositing
sub.itemR(rd, "free_image_textures")
sub = col.column()
sub.active = rd.render_raytracing
sub.itemL(text="Acceleration structure:")
sub.itemR(rd, "raytrace_structure", text="")
if rd.raytrace_structure == "OCTREE":
sub.itemR(rd, "octree_resolution", text="Resolution")
else:
sub.itemR(rd, "use_instances", text="Instances")
sub.itemR(rd, "use_local_coords", text="Local Coordinates")
class RENDER_PT_post_processing(RenderButtonsPanel):
__label__ = "Post Processing"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column()
col.itemR(rd, "use_compositing")
col.itemR(rd, "use_sequencer")
col = split.column()
col.itemR(rd, "dither_intensity", text="Dither", slider=True)
layout.itemS()
split = layout.split()
col = split.column()
col.itemR(rd, "fields", text="Fields")
sub = col.column()
sub.active = rd.fields
sub.row().itemR(rd, "field_order", expand=True)
sub.itemR(rd, "fields_still", text="Still")
col = split.column()
col.itemR(rd, "edge")
sub = col.column()
sub.active = rd.edge
sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
sub.itemR(rd, "edge_color", text="")
class RENDER_PT_output(RenderButtonsPanel):
__label__ = "Output"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.itemR(rd, "output_path", text="")
split = layout.split()
col = split.column()
col.itemR(rd, "file_format", text="")
col.row().itemR(rd, "color_mode", text="Color", expand=True)
col = split.column()
col.itemR(rd, "file_extensions")
col.itemR(rd, "use_overwrite")
col.itemR(rd, "use_placeholder")
if rd.file_format in ('AVIJPEG', 'JPEG'):
split = layout.split()
split.itemR(rd, "quality", slider=True)
elif rd.file_format == 'OPENEXR':
split = layout.split()
col = split.column()
col.itemL(text="Codec:")
col.itemR(rd, "exr_codec", text="")
subsplit = split.split()
col = subsplit.column()
col.itemR(rd, "exr_half")
col.itemR(rd, "exr_zbuf")
col = subsplit.column()
col.itemR(rd, "exr_preview")
elif rd.file_format == 'JPEG2000':
split = layout.split()
col = split.column()
col.itemL(text="Depth:")
col.row().itemR(rd, "jpeg2k_depth", expand=True)
col = split.column()
col.itemR(rd, "jpeg2k_preset", text="")
col.itemR(rd, "jpeg2k_ycc")
elif rd.file_format in ('CINEON', 'DPX'):
split = layout.split()
col = split.column()
col.itemR(rd, "cineon_log", text="Convert to Log")
col = split.column(align=True)
col.active = rd.cineon_log
col.itemR(rd, "cineon_black", text="Black")
col.itemR(rd, "cineon_white", text="White")
col.itemR(rd, "cineon_gamma", text="Gamma")
elif rd.file_format == 'TIFF':
split = layout.split()
split.itemR(rd, "tiff_bit")
class RENDER_PT_encoding(RenderButtonsPanel):
__label__ = "Encoding"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
rd = context.scene.render_data
return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
split.itemR(rd, "ffmpeg_format")
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
split.itemR(rd, "ffmpeg_codec")
else:
split.itemL()
split = layout.split()
col = split.column()
col.itemR(rd, "ffmpeg_video_bitrate")
col.itemL(text="Rate:")
col.itemR(rd, "ffmpeg_minrate", text="Minimum")
col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
col = split.column()
col.itemR(rd, "ffmpeg_gopsize")
col.itemR(rd, "ffmpeg_autosplit")
col.itemL(text="Mux:")
col.itemR(rd, "ffmpeg_muxrate", text="Rate")
col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
row = layout.row()
row.itemL(text="Audio:")
row = layout.row()
row.itemR(rd, "ffmpeg_audio_codec")
split = layout.split()
col = split.column()
col.itemR(rd, "ffmpeg_audio_bitrate")
col.itemR(rd, "ffmpeg_audio_mixrate")
col = split.column()
col.itemR(rd, "ffmpeg_multiplex_audio")
col.itemR(rd, "ffmpeg_audio_volume")
class RENDER_PT_antialiasing(RenderButtonsPanel):
__label__ = "Anti-Aliasing"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
rd = context.scene.render_data
self.layout.itemR(rd, "antialiasing", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.active = rd.antialiasing
split = layout.split()
col = split.column()
col.row().itemR(rd, "antialiasing_samples", expand=True)
col.itemR(rd, "full_sample")
col = split.column()
col.itemR(rd, "pixel_filter", text="")
col.itemR(rd, "filter_size", text="Size", slider=True)
class RENDER_PT_dimensions(RenderButtonsPanel):
__label__ = "Dimensions"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render_data
split = layout.split()
col = split.column()
sub = col.column(align=True)
sub.itemL(text="Resolution:")
sub.itemR(rd, "resolution_x", text="X")
sub.itemR(rd, "resolution_y", text="Y")
sub.itemR(rd, "resolution_percentage", text="")
sub.itemL(text="Aspect Ratio:")
sub.itemR(rd, "pixel_aspect_x", text="X")
sub.itemR(rd, "pixel_aspect_y", text="Y")
row = col.row()
row.itemR(rd, "use_border", text="Border")
rowsub = row.row()
rowsub.active = rd.use_border
rowsub.itemR(rd, "crop_to_border", text="Crop")
col = split.column(align=True)
col.itemL(text="Frame Range:")
col.itemR(scene, "start_frame", text="Start")
col.itemR(scene, "end_frame", text="End")
col.itemR(scene, "frame_step", text="Step")
col.itemL(text="Frame Rate:")
col.itemR(rd, "fps")
col.itemR(rd, "fps_base",text="/")
class RENDER_PT_stamp(RenderButtonsPanel):
__label__ = "Stamp"
__default_closed__ = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
rd = context.scene.render_data
self.layout.itemR(rd, "render_stamp", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.active = rd.render_stamp
split = layout.split()
col = split.column()
col.itemR(rd, "stamp_time", text="Time")
col.itemR(rd, "stamp_date", text="Date")
col.itemR(rd, "stamp_render_time", text="RenderTime")
col.itemR(rd, "stamp_frame", text="Frame")
col.itemR(rd, "stamp_scene", text="Scene")
col.itemR(rd, "stamp_camera", text="Camera")
col.itemR(rd, "stamp_filename", text="Filename")
col.itemR(rd, "stamp_marker", text="Marker")
col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
col = split.column()
col.active = rd.render_stamp
col.itemR(rd, "stamp_foreground", slider=True)
col.itemR(rd, "stamp_background", slider=True)
col.itemR(rd, "stamp_font_size", text="Font Size")
row = layout.split(percentage=0.2)
row.itemR(rd, "stamp_note", text="Note")
sub = row.row()
sub.active = rd.stamp_note
sub.itemR(rd, "stamp_note_text", text="")
bpy.types.register(RENDER_PT_render)
bpy.types.register(RENDER_PT_layers)
bpy.types.register(RENDER_PT_dimensions)
bpy.types.register(RENDER_PT_antialiasing)
bpy.types.register(RENDER_PT_shading)
bpy.types.register(RENDER_PT_output)
bpy.types.register(RENDER_PT_encoding)
bpy.types.register(RENDER_PT_performance)
bpy.types.register(RENDER_PT_post_processing)
bpy.types.register(RENDER_PT_stamp)

View File

@@ -1,137 +0,0 @@
import bpy
class SceneButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "scene"
def poll(self, context):
return context.scene
class SCENE_PT_scene(SceneButtonsPanel):
__label__ = "Scene"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
layout.itemR(scene, "camera")
layout.itemR(scene, "set", text="Background")
class SCENE_PT_unit(SceneButtonsPanel):
__label__ = "Units"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
unit = context.scene.unit_settings
col = layout.column()
col.row().itemR(unit, "system", expand=True)
row = layout.row()
row.active = (unit.system != 'NONE')
row.itemR(unit, "scale_length", text="Scale")
row.itemR(unit, "use_separate")
class SCENE_PT_keying_sets(SceneButtonsPanel):
__label__ = "Keying Sets"
def draw(self, context):
layout = self.layout
scene = context.scene
row = layout.row()
col = row.column()
col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
col = row.column(align=True)
col.itemO("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
col.itemO("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
ks = scene.active_keying_set
if ks:
row = layout.row()
col = row.column()
col.itemR(ks, "name")
col.itemR(ks, "absolute")
col = row.column()
col.itemL(text="Keyframing Settings:")
col.itemR(ks, "insertkey_needed", text="Needed")
col.itemR(ks, "insertkey_visual", text="Visual")
class SCENE_PT_keying_set_paths(SceneButtonsPanel):
__label__ = "Active Keying Set"
def poll(self, context):
return (context.scene != None) and (context.scene.active_keying_set != None)
def draw(self, context):
layout = self.layout
scene = context.scene
ks = scene.active_keying_set
row = layout.row()
row.itemL(text="Paths:")
row = layout.row()
col = row.column()
col.template_list(ks, "paths", ks, "active_path_index", rows=2)
col = row.column(align=True)
col.itemO("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
col.itemO("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
ksp = ks.active_path
if ksp:
col = layout.column()
col.itemL(text="Target:")
col.template_any_ID(ksp, "id", "id_type")
col.template_path_builder(ksp, "rna_path", ksp.id)
row = layout.row()
col = row.column()
col.itemL(text="Array Target:")
col.itemR(ksp, "entire_array")
if ksp.entire_array == False:
col.itemR(ksp, "array_index")
col = row.column()
col.itemL(text="F-Curve Grouping:")
col.itemR(ksp, "grouping")
if ksp.grouping == 'NAMED':
col.itemR(ksp, "group")
class SCENE_PT_physics(SceneButtonsPanel):
__label__ = "Gravity"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
self.layout.itemR(context.scene, "use_gravity", text="")
def draw(self, context):
layout = self.layout
scene = context.scene
layout.active = scene.use_gravity
layout.itemR(scene, "gravity", text="")
bpy.types.register(SCENE_PT_scene)
bpy.types.register(SCENE_PT_unit)
bpy.types.register(SCENE_PT_keying_sets)
bpy.types.register(SCENE_PT_keying_set_paths)
bpy.types.register(SCENE_PT_physics)

View File

@@ -1,789 +0,0 @@
import bpy
def active_node_mat(mat):
if mat:
mat_node = mat.active_node_material
if mat_node:
return mat_node
else:
return mat
return None
def context_tex_datablock(context):
idblock = active_node_mat(context.material)
if idblock: return idblock
idblock = context.lamp
if idblock: return idblock
idblock = context.world
if idblock: return idblock
idblock = context.brush
return idblock
class TextureButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "texture"
def poll(self, context):
tex = context.texture
return (tex and (tex.type != 'NONE' or tex.use_nodes))
class TEXTURE_PT_preview(TextureButtonsPanel):
__label__ = "Preview"
def draw(self, context):
layout = self.layout
tex = context.texture
slot = context.texture_slot
idblock = context_tex_datablock(context)
if idblock:
layout.template_preview(tex, parent=idblock, slot=slot)
else:
layout.template_preview(tex, slot=slot)
class TEXTURE_PT_context_texture(TextureButtonsPanel):
__show_header__ = False
def poll(self, context):
return (context.material or context.world or context.lamp or context.brush or context.texture)
def draw(self, context):
layout = self.layout
tex = context.texture
idblock = context_tex_datablock(context)
space = context.space_data
if idblock:
row = layout.row()
row.template_list(idblock, "textures", idblock, "active_texture_index", rows=2)
col = row.column(align=True)
col.item_enumO("texture.slot_move", "type", 'UP', text="", icon='ICON_TRIA_UP')
col.item_enumO("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN')
split = layout.split(percentage=0.65)
if idblock:
split.template_ID(idblock, "active_texture", new="texture.new")
elif tex:
split.template_ID(space, "pin_id")
if (not space.pin_id) and (
context.sculpt_object or
context.vertex_paint_object or
context.weight_paint_object or
context.texture_paint_object
):
split.itemR(space, "brush_texture", text="Brush", toggle=True)
if tex:
layout.itemR(tex, "use_nodes")
split = layout.split(percentage=0.2)
if tex.use_nodes:
slot = context.texture_slot
if slot:
split.itemL(text="Output:")
split.itemR(slot, "output_node", text="")
else:
split.itemL(text="Type:")
split.itemR(tex, "type", text="")
class TEXTURE_PT_colors(TextureButtonsPanel):
__label__ = "Colors"
__default_closed__ = True
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp:
layout.template_color_ramp(tex, "color_ramp", expand=True)
split = layout.split()
col = split.column()
col.itemL(text="RGB Multiply:")
sub = col.column(align=True)
sub.itemR(tex, "factor_red", text="R")
sub.itemR(tex, "factor_green", text="G")
sub.itemR(tex, "factor_blue", text="B")
col = split.column()
col.itemL(text="Adjust:")
col.itemR(tex, "brightness")
col.itemR(tex, "contrast")
# Texture Slot Panels #
class TextureSlotPanel(TextureButtonsPanel):
def poll(self, context):
return (
context.texture_slot and
TextureButtonsPanel.poll(self, context)
)
class TEXTURE_PT_mapping(TextureSlotPanel):
__label__ = "Mapping"
def draw(self, context):
layout = self.layout
idblock = context_tex_datablock(context)
tex = context.texture_slot
textype = context.texture
if type(idblock) != bpy.types.Brush:
split = layout.split(percentage=0.3)
col = split.column()
col.itemL(text="Coordinates:")
col = split.column()
col.itemR(tex, "texture_coordinates", text="")
if tex.texture_coordinates == 'ORCO':
"""
ob = context.object
if ob and ob.type == 'MESH':
split = layout.split(percentage=0.3)
split.itemL(text="Mesh:")
split.itemR(ob.data, "texco_mesh", text="")
"""
elif tex.texture_coordinates == 'UV':
split = layout.split(percentage=0.3)
split.itemL(text="Layer:")
ob = context.object
if ob and ob.type == 'MESH': split.item_pointerR(tex, "uv_layer", ob.data, "uv_textures", text="")
else: split.itemR(tex, "uv_layer", text="")
elif tex.texture_coordinates == 'OBJECT':
split = layout.split(percentage=0.3)
split.itemL(text="Object:")
split.itemR(tex, "object", text="")
if type(idblock) == bpy.types.Brush:
layout.itemR(tex, "map_mode", expand=True)
row = layout.row()
row.active = tex.map_mode in ('FIXED', 'TILED')
row.itemR(tex, "angle")
row = layout.row()
row.active = tex.map_mode in ('TILED', '3D')
row.column().itemR(tex, "size")
else:
if type(idblock) == bpy.types.Material:
split = layout.split(percentage=0.3)
split.itemL(text="Projection:")
split.itemR(tex, "mapping", text="")
split = layout.split()
col = split.column()
if tex.texture_coordinates in ('ORCO', 'UV'):
col.itemR(tex, "from_dupli")
elif tex.texture_coordinates == 'OBJECT':
col.itemR(tex, "from_original")
else:
col.itemL()
col = split.column()
row = col.row()
row.itemR(tex, "x_mapping", text="")
row.itemR(tex, "y_mapping", text="")
row.itemR(tex, "z_mapping", text="")
# any non brush
row = layout.row()
row.column().itemR(tex, "offset")
row.column().itemR(tex, "size")
class TEXTURE_PT_influence(TextureSlotPanel):
__label__ = "Influence"
def poll(self, context):
return context.texture_slot
def draw(self, context):
layout = self.layout
idblock = context_tex_datablock(context)
textype = context.texture
tex = context.texture_slot
def factor_but(layout, active, toggle, factor, name):
row = layout.row(align=True)
row.itemR(tex, toggle, text="")
sub = row.row()
sub.active = active
sub.itemR(tex, factor, text=name, slider=True)
if type(idblock) == bpy.types.Material:
if idblock.type in ('SURFACE', 'HALO', 'WIRE'):
split = layout.split()
col = split.column()
col.itemL(text="Diffuse:")
factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
col.itemL(text="Specular:")
factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
col = split.column()
col.itemL(text="Shading:")
factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
col.itemL(text="Geometry:")
factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
#sub = col.column()
#sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
#sub.itemR(tex, "default_value", text="Amount", slider=True)
elif idblock.type == 'VOLUME':
split = layout.split()
col = split.column()
factor_but(col, tex.map_density, "map_density", "density_factor", "Density")
factor_but(col, tex.map_emission, "map_emission", "emission_factor", "Emission")
factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection")
col = split.column()
col.itemL(text=" ")
factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color")
factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color")
factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color")
elif type(idblock) == bpy.types.Lamp:
row = layout.row()
factor_but(row, tex.map_color, "map_color", "color_factor", "Color")
factor_but(row, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
elif type(idblock) == bpy.types.World:
split = layout.split()
col = split.column()
factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend")
factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon")
col = split.column()
factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up")
factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
layout.itemS()
split = layout.split()
col = split.column()
col.itemR(tex, "blend_type", text="Blend")
col.itemR(tex, "rgb_to_intensity")
sub = col.column()
sub.active = tex.rgb_to_intensity
sub.itemR(tex, "color", text="")
col = split.column()
col.itemR(tex, "negate", text="Negative")
col.itemR(tex, "stencil")
if type(idblock) in (bpy.types.Material, bpy.types.World):
col.itemR(tex, "default_value", text="DVar", slider=True)
# Texture Type Panels #
class TextureTypePanel(TextureButtonsPanel):
def poll(self, context):
tex = context.texture
return (tex and tex.type == self.tex_type and not tex.use_nodes)
class TEXTURE_PT_clouds(TextureTypePanel):
__label__ = "Clouds"
tex_type = 'CLOUDS'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "stype", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "noise_depth", text="Depth")
flow.itemR(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureTypePanel):
__label__ = "Wood"
tex_type = 'WOOD'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "noisebasis2", expand=True)
layout.itemR(tex, "stype", expand=True)
col = layout.column()
col.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
col.itemL(text="Noise:")
col.row().itemR(tex, "noise_type", text="Type", expand=True)
col.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
class TEXTURE_PT_marble(TextureTypePanel):
__label__ = "Marble"
tex_type = 'MARBLE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "stype", expand=True)
layout.itemR(tex, "noisebasis2", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "noise_depth", text="Depth")
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
class TEXTURE_PT_magic(TextureTypePanel):
__label__ = "Magic"
tex_type = 'MAGIC'
def draw(self, context):
layout = self.layout
tex = context.texture
row = layout.row()
row.itemR(tex, "noise_depth", text="Depth")
row.itemR(tex, "turbulence")
class TEXTURE_PT_blend(TextureTypePanel):
__label__ = "Blend"
tex_type = 'BLEND'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "progression")
sub = layout.row()
sub.active = (tex.progression in ('LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'))
sub.itemR(tex, "flip_axis", expand=True)
class TEXTURE_PT_stucci(TextureTypePanel):
__label__ = "Stucci"
tex_type = 'STUCCI'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "stype", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "turbulence")
class TEXTURE_PT_image(TextureTypePanel):
__label__ = "Image"
tex_type = 'IMAGE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.template_image(tex, "image", tex.image_user)
class TEXTURE_PT_image_sampling(TextureTypePanel):
__label__ = "Image Sampling"
__default_closed__ = True
tex_type = 'IMAGE'
def draw(self, context):
layout = self.layout
tex = context.texture
slot = context.texture_slot
split = layout.split()
col = split.column()
col.itemL(text="Alpha:")
col.itemR(tex, "use_alpha", text="Use")
col.itemR(tex, "calculate_alpha", text="Calculate")
col.itemR(tex, "invert_alpha", text="Invert")
col.itemL(text="Flip:")
col.itemR(tex, "flip_axis", text="X/Y Axis")
col = split.column()
col.itemR(tex, "normal_map")
row = col.row()
row.active = tex.normal_map
row.itemR(tex, "normal_space", text="")
col.itemL(text="Filter:")
col.itemR(tex, "filter", text="")
col.itemR(tex, "mipmap")
row = col.row()
row.active = tex.mipmap
row.itemR(tex, "mipmap_gauss", text="Gauss")
col.itemR(tex, "interpolation")
if tex.mipmap and tex.filter != 'DEFAULT':
if tex.filter == 'FELINE':
col.itemR(tex, "filter_probes", text="Probes")
else:
col.itemR(tex, "filter_eccentricity", text="Eccentricity")
class TEXTURE_PT_image_mapping(TextureTypePanel):
__label__ = "Image Mapping"
__default_closed__ = True
tex_type = 'IMAGE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "extension")
split = layout.split()
if tex.extension == 'REPEAT':
col = split.column(align=True)
col.itemL(text="Repeat:")
col.itemR(tex, "repeat_x", text="X")
col.itemR(tex, "repeat_y", text="Y")
col = split.column(align=True)
col.itemL(text="Mirror:")
col.itemR(tex, "mirror_x", text="X")
col.itemR(tex, "mirror_y", text="Y")
layout.itemS()
elif tex.extension == 'CHECKER':
col = split.column(align=True)
row = col.row()
row.itemR(tex, "checker_even", text="Even")
row.itemR(tex, "checker_odd", text="Odd")
split.itemR(tex, "checker_distance", text="Distance")
layout.itemS()
split = layout.split()
col = split.column(align=True)
#col.itemR(tex, "crop_rectangle")
col.itemL(text="Crop Minimum:")
col.itemR(tex, "crop_min_x", text="X")
col.itemR(tex, "crop_min_y", text="Y")
col = split.column(align=True)
col.itemL(text="Crop Maximum:")
col.itemR(tex, "crop_max_x", text="X")
col.itemR(tex, "crop_max_y", text="Y")
class TEXTURE_PT_plugin(TextureTypePanel):
__label__ = "Plugin"
tex_type = 'PLUGIN'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemL(text="Nothing yet")
class TEXTURE_PT_envmap(TextureTypePanel):
__label__ = "Environment Map"
tex_type = 'ENVIRONMENT_MAP'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemL(text="Nothing yet")
class TEXTURE_PT_musgrave(TextureTypePanel):
__label__ = "Musgrave"
tex_type = 'MUSGRAVE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "musgrave_type")
split = layout.split()
col = split.column()
col.itemR(tex, "highest_dimension", text="Dimension")
col.itemR(tex, "lacunarity")
col.itemR(tex, "octaves")
col = split.column()
if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
col.itemR(tex, "offset")
if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
col.itemR(tex, "gain")
col.itemR(tex, "noise_intensity", text="Intensity")
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_basis", text="Basis")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
class TEXTURE_PT_voronoi(TextureTypePanel):
__label__ = "Voronoi"
tex_type = 'VORONOI'
def draw(self, context):
layout = self.layout
tex = context.texture
split = layout.split()
col = split.column()
col.itemL(text="Distance Metric:")
col.itemR(tex, "distance_metric", text="")
sub = col.column()
sub.active = tex.distance_metric == 'MINKOVSKY'
sub.itemR(tex, "minkovsky_exponent", text="Exponent")
col.itemL(text="Coloring:")
col.itemR(tex, "coloring", text="")
col.itemR(tex, "noise_intensity", text="Intensity")
col = split.column(align=True)
col.itemL(text="Feature Weights:")
col.itemR(tex, "weight_1", text="1", slider=True)
col.itemR(tex, "weight_2", text="2", slider=True)
col.itemR(tex, "weight_3", text="3", slider=True)
col.itemR(tex, "weight_4", text="4", slider=True)
layout.itemL(text="Noise:")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
class TEXTURE_PT_distortednoise(TextureTypePanel):
__label__ = "Distorted Noise"
tex_type = 'DISTORTED_NOISE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "noise_distortion")
layout.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.itemR(tex, "distortion", text="Distortion")
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "nabla")
class TEXTURE_PT_voxeldata(TextureButtonsPanel):
__label__ = "Voxel Data"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'VOXEL_DATA')
def draw(self, context):
layout = self.layout
tex = context.texture
vd = tex.voxeldata
layout.itemR(vd, "file_format")
if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']:
layout.itemR(vd, "source_path")
if vd.file_format == 'RAW_8BIT':
layout.itemR(vd, "resolution")
elif vd.file_format == 'SMOKE':
layout.itemR(vd, "domain_object")
layout.itemR(vd, "still")
row = layout.row()
row.active = vd.still
row.itemR(vd, "still_frame_number")
layout.itemR(vd, "interpolation")
layout.itemR(vd, "extension")
layout.itemR(vd, "intensity")
class TEXTURE_PT_pointdensity(TextureButtonsPanel):
__label__ = "Point Density"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'POINT_DENSITY')
def draw(self, context):
layout = self.layout
tex = context.texture
pd = tex.pointdensity
layout.itemR(pd, "point_source", expand=True)
split = layout.split()
col = split.column()
if pd.point_source == 'PARTICLE_SYSTEM':
col.itemL(text="Object:")
col.itemR(pd, "object", text="")
sub = col.column()
sub.enabled = pd.object
if pd.object:
sub.itemL(text="System:")
sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="")
sub.itemL(text="Cache:")
sub.itemR(pd, "particle_cache", text="")
else:
col.itemL(text="Object:")
col.itemR(pd, "object", text="")
col.itemL(text="Cache:")
col.itemR(pd, "vertices_cache", text="")
col.itemS()
col.itemL(text="Color Source:")
col.itemR(pd, "color_source", text="")
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'):
col.itemR(pd, "speed_scale")
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
layout.template_color_ramp(pd, "color_ramp", expand=True)
col = split.column()
col.itemL()
col.itemR(pd, "radius")
col.itemL(text="Falloff:")
col.itemR(pd, "falloff", text="")
if pd.falloff == 'SOFT':
col.itemR(pd, "falloff_softness")
class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
__label__ = "Turbulence"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'POINT_DENSITY')
def draw_header(self, context):
layout = self.layout
tex = context.texture
pd = tex.pointdensity
layout.itemR(pd, "turbulence", text="")
def draw(self, context):
layout = self.layout
tex = context.texture
pd = tex.pointdensity
layout.active = pd.turbulence
split = layout.split()
col = split.column()
col.itemL(text="Influence:")
col.itemR(pd, "turbulence_influence", text="")
col.itemL(text="Noise Basis:")
col.itemR(pd, "noise_basis", text="")
col = split.column()
col.itemL()
col.itemR(pd, "turbulence_size")
col.itemR(pd, "turbulence_depth")
col.itemR(pd, "turbulence_strength")
bpy.types.register(TEXTURE_PT_context_texture)
bpy.types.register(TEXTURE_PT_preview)
bpy.types.register(TEXTURE_PT_clouds) # Texture Type Panels
bpy.types.register(TEXTURE_PT_wood)
bpy.types.register(TEXTURE_PT_marble)
bpy.types.register(TEXTURE_PT_magic)
bpy.types.register(TEXTURE_PT_blend)
bpy.types.register(TEXTURE_PT_stucci)
bpy.types.register(TEXTURE_PT_image)
bpy.types.register(TEXTURE_PT_image_sampling)
bpy.types.register(TEXTURE_PT_image_mapping)
bpy.types.register(TEXTURE_PT_plugin)
bpy.types.register(TEXTURE_PT_envmap)
bpy.types.register(TEXTURE_PT_musgrave)
bpy.types.register(TEXTURE_PT_voronoi)
bpy.types.register(TEXTURE_PT_distortednoise)
bpy.types.register(TEXTURE_PT_voxeldata)
bpy.types.register(TEXTURE_PT_pointdensity)
bpy.types.register(TEXTURE_PT_pointdensity_turbulence)
bpy.types.register(TEXTURE_PT_colors)
bpy.types.register(TEXTURE_PT_mapping)
bpy.types.register(TEXTURE_PT_influence)

View File

@@ -1,183 +0,0 @@
import bpy
class WorldButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "world"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
rd = context.scene.render_data
return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
class WORLD_PT_preview(WorldButtonsPanel):
__label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
self.layout.template_preview(context.world)
class WORLD_PT_context_world(WorldButtonsPanel):
__show_header__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
rd = context.scene.render_data
return (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
scene = context.scene
world = context.world
space = context.space_data
split = layout.split(percentage=0.65)
if scene:
split.template_ID(scene, "world", new="world.new")
elif world:
split.template_ID(space, "pin_id")
class WORLD_PT_world(WorldButtonsPanel):
__label__ = "World"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
world = context.world
row = layout.row()
row.itemR(world, "paper_sky")
row.itemR(world, "blend_sky")
row.itemR(world, "real_sky")
row = layout.row()
row.column().itemR(world, "horizon_color")
col = row.column()
col.itemR(world, "zenith_color")
col.active = world.blend_sky
row.column().itemR(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
__label__ = "Mist"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
world = context.world
self.layout.itemR(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
world = context.world
layout.active = world.mist.enabled
flow = layout.column_flow()
flow.itemR(world.mist, "intensity", slider=True)
flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height")
layout.itemR(world.mist, "falloff")
class WORLD_PT_stars(WorldButtonsPanel):
__label__ = "Stars"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
world = context.world
self.layout.itemR(world.stars, "enabled", text="")
def draw(self, context):
layout = self.layout
world = context.world
layout.active = world.stars.enabled
flow = layout.column_flow()
flow.itemR(world.stars, "size")
flow.itemR(world.stars, "color_randomization", text="Colors")
flow.itemR(world.stars, "min_distance", text="Min. Dist")
flow.itemR(world.stars, "average_separation", text="Separation")
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
__label__ = "Ambient Occlusion"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
world = context.world
self.layout.itemR(world.ambient_occlusion, "enabled", text="")
def draw(self, context):
layout = self.layout
ao = context.world.ambient_occlusion
layout.active = ao.enabled
layout.itemR(ao, "gather_method", expand=True)
split = layout.split()
col = split.column()
col.itemL(text="Attenuation:")
if ao.gather_method == 'RAYTRACE':
col.itemR(ao, "distance")
col.itemR(ao, "falloff")
sub = col.row()
sub.active = ao.falloff
sub.itemR(ao, "falloff_strength", text="Strength")
if ao.gather_method == 'RAYTRACE':
col = split.column()
col.itemL(text="Sampling:")
col.itemR(ao, "sample_method", text="")
sub = col.column()
sub.itemR(ao, "samples")
if ao.sample_method == 'ADAPTIVE_QMC':
sub.itemR(ao, "threshold")
sub.itemR(ao, "adapt_to_speed", slider=True)
elif ao.sample_method == 'CONSTANT_JITTERED':
sub.itemR(ao, "bias")
if ao.gather_method == 'APPROXIMATE':
col = split.column()
col.itemL(text="Sampling:")
col.itemR(ao, "passes")
col.itemR(ao, "error_tolerance", text="Error")
col.itemR(ao, "pixel_cache")
col.itemR(ao, "correction")
col = layout.column()
col.itemL(text="Influence:")
col.row().itemR(ao, "blend_mode", expand=True)
split = layout.split()
col = split.column()
col.itemR(ao, "energy")
col = split.column()
sub = col.split(percentage=0.3)
sub.itemL(text="Color:")
sub.itemR(ao, "color", text="")
bpy.types.register(WORLD_PT_context_world)
bpy.types.register(WORLD_PT_preview)
bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion)
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)

View File

@@ -0,0 +1,209 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return context.armature
class DATA_PT_context_arm(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
arm = context.armature
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif arm:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_skeleton(DataButtonsPanel):
bl_label = "Skeleton"
def draw(self, context):
layout = self.layout
ob = context.object
arm = context.armature
space = context.space_data
layout.itemR(arm, "pose_position", expand=True)
split = layout.split()
col = split.column()
col.itemL(text="Layers:")
col.itemR(arm, "layer", text="")
col.itemL(text="Protected Layers:")
col.itemR(arm, "layer_protection", text="")
col = split.column()
col.itemL(text="Deform:")
col.itemR(arm, "deform_vertexgroups", text="Vertex Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
col.itemR(arm, "deform_quaternion", text="Quaternion")
col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
class DATA_PT_display(DataButtonsPanel):
bl_label = "Display"
def draw(self, context):
layout = self.layout
arm = context.armature
layout.row().itemR(arm, "drawtype", expand=True)
flow = layout.column_flow()
flow.itemR(arm, "draw_names", text="Names")
flow.itemR(arm, "draw_axes", text="Axes")
flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
flow.itemR(arm, "draw_group_colors", text="Colors")
flow.itemR(arm, "delay_deform", text="Delay Refresh")
class DATA_PT_bone_groups(DataButtonsPanel):
bl_label = "Bone Groups"
def poll(self, context):
return (context.object and context.object.type == 'ARMATURE' and context.object.pose)
def draw(self, context):
layout = self.layout
ob = context.object
pose = ob.pose
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index", rows=2)
col = row.column(align=True)
col.active = (ob.proxy == None)
col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
group = pose.active_bone_group
if group:
col = layout.column()
col.active = (ob.proxy == None)
col.itemR(group, "name")
split = layout.split(0.5)
split.active = (ob.proxy == None)
split.itemR(group, "color_set")
if group.color_set:
split.template_triColorSet(group, "colors")
row = layout.row(align=True)
row.active = (ob.proxy == None)
row.itemO("pose.group_assign", text="Assign")
row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
#row.itemO("object.bone_group_select", text="Select")
#row.itemO("object.bone_group_deselect", text="Deselect")
class DATA_PT_paths(DataButtonsPanel):
bl_label = "Paths"
def draw(self, context):
layout = self.layout
arm = context.armature
layout.itemR(arm, "paths_type", expand=True)
split = layout.split()
col = split.column()
sub = col.column(align=True)
if (arm.paths_type == 'CURRENT_FRAME'):
sub.itemR(arm, "path_before_current", text="Before")
sub.itemR(arm, "path_after_current", text="After")
elif (arm.paths_type == 'RANGE'):
sub.itemR(arm, "path_start_frame", text="Start")
sub.itemR(arm, "path_end_frame", text="End")
sub.itemR(arm, "path_size", text="Step")
col.row().itemR(arm, "paths_location", expand=True)
col = split.column()
col.itemL(text="Display:")
col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
layout.itemS()
row = layout.row()
row.itemO("pose.paths_calculate", text="Calculate Paths")
row.itemO("pose.paths_clear", text="Clear Paths")
class DATA_PT_ghost(DataButtonsPanel):
bl_label = "Ghost"
def draw(self, context):
layout = self.layout
arm = context.armature
layout.itemR(arm, "ghost_type", expand=True)
split = layout.split()
col = split.column()
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':
sub.itemR(arm, "ghost_start_frame", text="Start")
sub.itemR(arm, "ghost_end_frame", text="End")
sub.itemR(arm, "ghost_size", text="Step")
elif arm.ghost_type == 'CURRENT_FRAME':
sub.itemR(arm, "ghost_step", text="Range")
sub.itemR(arm, "ghost_size", text="Step")
col = split.column()
col.itemL(text="Display:")
col.itemR(arm, "ghost_only_selected", text="Selected Only")
bpy.types.register(DATA_PT_context_arm)
bpy.types.register(DATA_PT_skeleton)
bpy.types.register(DATA_PT_display)
bpy.types.register(DATA_PT_bone_groups)
bpy.types.register(DATA_PT_paths)
bpy.types.register(DATA_PT_ghost)

View File

@@ -0,0 +1,254 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class BoneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "bone"
def poll(self, context):
return (context.bone or context.edit_bone)
class BONE_PT_context_bone(BoneButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
bone = context.bone
if not bone:
bone = context.edit_bone
row = layout.row()
row.itemL(text="", icon='ICON_BONE_DATA')
row.itemR(bone, "name", text="")
class BONE_PT_transform(BoneButtonsPanel):
bl_label = "Transform"
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
if not bone:
bone = context.edit_bone
row = layout.row()
row.column().itemR(bone, "head")
row.column().itemR(bone, "tail")
col = row.column()
sub = col.column(align=True)
sub.itemL(text="Roll:")
sub.itemR(bone, "roll", text="")
sub.itemL()
sub.itemR(bone, "locked")
else:
pchan = ob.pose.pose_channels[context.bone.name]
row = layout.row()
col = row.column()
col.itemR(pchan, "location")
col.active = not (bone.parent and bone.connected)
col = row.column()
if pchan.rotation_mode == 'QUATERNION':
col.itemR(pchan, "rotation_quaternion", text="Rotation")
elif pchan.rotation_mode == 'AXIS_ANGLE':
#col.itemL(text="Rotation")
#col.itemR(pchan, "rotation_angle", text="Angle")
#col.itemR(pchan, "rotation_axis", text="Axis")
col.itemR(pchan, "rotation_axis_angle", text="Rotation")
else:
col.itemR(pchan, "rotation_euler", text="Rotation")
row.column().itemR(pchan, "scale")
layout.itemR(pchan, "rotation_mode")
class BONE_PT_transform_locks(BoneButtonsPanel):
bl_label = "Transform Locks"
bl_default_closed = True
def poll(self, context):
return context.bone
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
pchan = ob.pose.pose_channels[context.bone.name]
row = layout.row()
col = row.column()
col.itemR(pchan, "lock_location")
col.active = not (bone.parent and bone.connected)
col = row.column()
if pchan.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
col.itemR(pchan, "lock_rotations_4d", text="Lock Rotation")
if pchan.lock_rotations_4d:
col.itemR(pchan, "lock_rotation_w", text="W")
col.itemR(pchan, "lock_rotation", text="")
else:
col.itemR(pchan, "lock_rotation", text="Rotation")
row.column().itemR(pchan, "lock_scale")
class BONE_PT_relations(BoneButtonsPanel):
bl_label = "Relations"
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
arm = context.armature
if not bone:
bone = context.edit_bone
pchan = None
else:
pchan = ob.pose.pose_channels[context.bone.name]
split = layout.split()
col = split.column()
col.itemL(text="Layers:")
col.itemR(bone, "layer", text="")
col.itemS()
if ob and pchan:
col.itemL(text="Bone Group:")
col.item_pointerR(pchan, "bone_group", ob.pose, "bone_groups", text="")
col = split.column()
col.itemL(text="Parent:")
if context.bone:
col.itemR(bone, "parent", text="")
else:
col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
sub = col.column()
sub.active = bone.parent != None
sub.itemR(bone, "connected")
sub.itemR(bone, "hinge", text="Inherit Rotation")
sub.itemR(bone, "inherit_scale", text="Inherit Scale")
class BONE_PT_display(BoneButtonsPanel):
bl_label = "Display"
def poll(self, context):
return context.bone
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
arm = context.armature
if not bone:
bone = context.edit_bone
pchan = None
else:
pchan = ob.pose.pose_channels[context.bone.name]
if ob and pchan:
split = layout.split()
col = split.column()
col.itemR(bone, "draw_wire", text="Wireframe")
col.itemR(bone, "hidden", text="Hide")
col = split.column()
col.itemL(text="Custom Shape:")
col.itemR(pchan, "custom_shape", text="")
class BONE_PT_deform(BoneButtonsPanel):
bl_label = "Deform"
bl_default_closed = True
def draw_header(self, context):
bone = context.bone
if not bone:
bone = context.edit_bone
self.layout.itemR(bone, "deform", text="")
def draw(self, context):
layout = self.layout
bone = context.bone
if not bone:
bone = context.edit_bone
layout.active = bone.deform
split = layout.split()
col = split.column()
col.itemL(text="Envelope:")
sub = col.column(align=True)
sub.itemR(bone, "envelope_distance", text="Distance")
sub.itemR(bone, "envelope_weight", text="Weight")
col.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
sub = col.column(align=True)
sub.itemL(text="Radius:")
sub.itemR(bone, "head_radius", text="Head")
sub.itemR(bone, "tail_radius", text="Tail")
col = split.column()
col.itemL(text="Curved Bones:")
sub = col.column(align=True)
sub.itemR(bone, "bbone_segments", text="Segments")
sub.itemR(bone, "bbone_in", text="Ease In")
sub.itemR(bone, "bbone_out", text="Ease Out")
col.itemL(text="Offset:")
col.itemR(bone, "cyclic_offset")
bpy.types.register(BONE_PT_context_bone)
bpy.types.register(BONE_PT_transform)
bpy.types.register(BONE_PT_transform_locks)
bpy.types.register(BONE_PT_relations)
bpy.types.register(BONE_PT_display)
bpy.types.register(BONE_PT_deform)

View File

@@ -0,0 +1,121 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return context.camera
class DATA_PT_context_camera(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
cam = context.camera
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif cam:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_camera(DataButtonsPanel):
bl_label = "Lens"
def draw(self, context):
layout = self.layout
cam = context.camera
layout.itemR(cam, "type", expand=True)
row = layout.row()
if cam.type == 'PERSP':
if cam.lens_unit == 'MILLIMETERS':
row.itemR(cam, "lens", text="Angle")
elif cam.lens_unit == 'DEGREES':
row.itemR(cam, "angle")
row.itemR(cam, "lens_unit", text="")
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
layout.itemR(cam, "panorama")
split = layout.split()
col = split.column(align=True)
col.itemL(text="Shift:")
col.itemR(cam, "shift_x", text="X")
col.itemR(cam, "shift_y", text="Y")
col = split.column(align=True)
col.itemL(text="Clipping:")
col.itemR(cam, "clip_start", text="Start")
col.itemR(cam, "clip_end", text="End")
layout.itemL(text="Depth of Field:")
row = layout.row()
row.itemR(cam, "dof_object", text="")
row.itemR(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(DataButtonsPanel):
bl_label = "Display"
def draw(self, context):
layout = self.layout
cam = context.camera
split = layout.split()
col = split.column()
col.itemR(cam, "show_limits", text="Limits")
col.itemR(cam, "show_mist", text="Mist")
col.itemR(cam, "show_title_safe", text="Title Safe")
col.itemR(cam, "show_name", text="Name")
col = split.column()
col.itemR(cam, "draw_size", text="Size")
col.itemS()
col.itemR(cam, "show_passepartout", text="Passepartout")
sub = col.column()
sub.active = cam.show_passepartout
sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
bpy.types.register(DATA_PT_context_camera)
bpy.types.register(DATA_PT_camera)
bpy.types.register(DATA_PT_camera_display)

View File

@@ -0,0 +1,250 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return (context.object and context.object.type in ('CURVE', 'SURFACE') and context.curve)
class DataButtonsPanelCurve(DataButtonsPanel):
'''Same as above but for curves only'''
def poll(self, context):
return (context.object and context.object.type == 'CURVE' and context.curve)
class DataButtonsPanelActive(DataButtonsPanel):
'''Same as above but for curves only'''
def poll(self, context):
curve = context.curve
return (curve and curve.active_spline)
class DATA_PT_context_curve(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif curve:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_shape_curve(DataButtonsPanel):
bl_label = "Shape"
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
is_surf = (ob.type == 'SURFACE')
if not is_surf:
row = layout.row()
row.itemR(curve, "dimensions", expand=True)
split = layout.split()
col = split.column()
if not is_surf:
sub = col.column()
sub.active = (curve.dimensions == '2D')
sub.itemL(text="Caps:")
row = sub.row()
row.itemR(curve, "front")
row.itemR(curve, "back")
col.itemL(text="Textures:")
# col.itemR(curve, "uv_orco")
col.itemR(curve, "auto_texspace")
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(curve, "resolution_u", text="Preview U")
sub.itemR(curve, "render_resolution_u", text="Render U")
if is_surf:
sub = col.column(align=True)
sub.itemR(curve, "resolution_v", text="Preview V")
sub.itemR(curve, "render_resolution_v", text="Render V")
# XXX - put somewhere nicer.
row = layout.row()
row.itemR(curve, "twist_mode")
row.itemR(curve, "twist_smooth") # XXX - may not be kept
# col.itemL(text="Display:")
# col.itemL(text="HANDLES")
# col.itemL(text="NORMALS")
# col.itemR(curve, "vertex_normal_flip")
class DATA_PT_geometry_curve(DataButtonsPanel):
bl_label = "Geometry"
def draw(self, context):
layout = self.layout
curve = context.curve
split = layout.split()
col = split.column()
col.itemL(text="Modification:")
col.itemR(curve, "width")
col.itemR(curve, "extrude")
col.itemL(text="Taper Object:")
col.itemR(curve, "taper_object", text="")
col = split.column()
col.itemL(text="Bevel:")
col.itemR(curve, "bevel_depth", text="Depth")
col.itemR(curve, "bevel_resolution", text="Resolution")
col.itemL(text="Bevel Object:")
col.itemR(curve, "bevel_object", text="")
class DATA_PT_pathanim(DataButtonsPanelCurve):
bl_label = "Path Animation"
def draw_header(self, context):
curve = context.curve
self.layout.itemR(curve, "use_path", text="")
def draw(self, context):
layout = self.layout
curve = context.curve
layout.active = curve.use_path
split = layout.split()
col = split.column()
col.itemR(curve, "path_length", text="Frames")
col.itemR(curve, "use_path_follow")
col = split.column()
col.itemR(curve, "use_stretch")
col.itemR(curve, "use_radius")
col.itemR(curve, "use_time_offset", text="Offset Children")
class DATA_PT_active_spline(DataButtonsPanelActive):
bl_label = "Active Spline"
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
act_spline = curve.active_spline
is_surf = (ob.type == 'SURFACE')
is_poly = (act_spline.type == 'POLY')
split = layout.split()
if is_poly:
# These settings are below but its easier to have
# poly's set aside since they use so few settings
col = split.column()
col.itemL(text="Cyclic:")
col.itemR(act_spline, "smooth")
col = split.column()
col.itemR(act_spline, "cyclic_u", text="U")
else:
col = split.column()
col.itemL(text="Cyclic:")
if act_spline.type == 'NURBS':
col.itemL(text="Bezier:")
col.itemL(text="Endpoint:")
col.itemL(text="Order:")
col.itemL(text="Resolution:")
col = split.column()
col.itemR(act_spline, "cyclic_u", text="U")
if act_spline.type == 'NURBS':
sub = col.column()
# sub.active = (not act_spline.cyclic_u)
sub.itemR(act_spline, "bezier_u", text="U")
sub.itemR(act_spline, "endpoint_u", text="U")
sub = col.column()
sub.itemR(act_spline, "order_u", text="U")
col.itemR(act_spline, "resolution_u", text="U")
if is_surf:
col = split.column()
col.itemR(act_spline, "cyclic_v", text="V")
# its a surface, assume its a nurb.
sub = col.column()
sub.active = (not act_spline.cyclic_v)
sub.itemR(act_spline, "bezier_v", text="V")
sub.itemR(act_spline, "endpoint_v", text="V")
sub = col.column()
sub.itemR(act_spline, "order_v", text="V")
sub.itemR(act_spline, "resolution_v", text="V")
if not is_surf:
split = layout.split()
col = split.column()
col.active = (curve.dimensions == '3D')
col.itemL(text="Interpolation:")
col.itemR(act_spline, "tilt_interpolation", text="Tilt")
col.itemR(act_spline, "radius_interpolation", text="Radius")
split = layout.split()
col = split.column()
col.itemR(act_spline, "smooth")
bpy.types.register(DATA_PT_context_curve)
bpy.types.register(DATA_PT_shape_curve)
bpy.types.register(DATA_PT_geometry_curve)
bpy.types.register(DATA_PT_pathanim)
bpy.types.register(DATA_PT_active_spline)

View File

@@ -0,0 +1,43 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return (context.object and context.object.type == 'EMPTY')
class DATA_PT_empty(DataButtonsPanel):
bl_label = "Empty"
def draw(self, context):
layout = self.layout
ob = context.object
layout.itemR(ob, "empty_draw_type", text="Display")
layout.itemR(ob, "empty_draw_size", text="Size")
bpy.types.register(DATA_PT_empty)

View File

@@ -0,0 +1,340 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return context.lamp
class DATA_PT_preview(DataButtonsPanel):
bl_label = "Preview"
def draw(self, context):
self.layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
lamp = context.lamp
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif lamp:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_lamp(DataButtonsPanel):
bl_label = "Lamp"
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.itemR(lamp, "type", expand=True)
split = layout.split()
col = split.column()
sub = col.column()
sub.itemR(lamp, "color", text="")
sub.itemR(lamp, "energy")
if lamp.type in ('POINT', 'SPOT'):
sub.itemL(text="Falloff:")
sub.itemR(lamp, "falloff_type", text="")
sub.itemR(lamp, "distance")
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
col.itemL(text="Attenuation Factors:")
sub = col.column(align=True)
sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
col.itemR(lamp, "sphere")
if lamp.type == 'AREA':
col.itemR(lamp, "distance")
col.itemR(lamp, "gamma")
col = split.column()
col.itemR(lamp, "negative")
col.itemR(lamp, "layer", text="This Layer Only")
col.itemR(lamp, "specular")
col.itemR(lamp, "diffuse")
class DATA_PT_sunsky(DataButtonsPanel):
bl_label = "Sky & Atmosphere"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type == 'SUN')
def draw(self, context):
layout = self.layout
lamp = context.lamp.sky
layout.itemR(lamp, "sky")
row = layout.row()
row.active = lamp.sky or lamp.atmosphere
row.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
split = layout.split()
col = split.column()
col.active = lamp.sky
col.itemL(text="Blending:")
sub = col.column()
sub.itemR(lamp, "sky_blend_type", text="")
sub.itemR(lamp, "sky_blend", text="Factor")
col.itemL(text="Color Space:")
sub = col.column()
sub.row().itemR(lamp, "sky_color_space", expand=True)
sub.itemR(lamp, "sky_exposure", text="Exposure")
col = split.column()
col.active = lamp.sky
col.itemL(text="Horizon:")
sub = col.column()
sub.itemR(lamp, "horizon_brightness", text="Brightness")
sub.itemR(lamp, "spread", text="Spread")
col.itemL(text="Sun:")
sub = col.column()
sub.itemR(lamp, "sun_brightness", text="Brightness")
sub.itemR(lamp, "sun_size", text="Size")
sub.itemR(lamp, "backscattered_light", slider=True, text="Back Light")
layout.itemS()
layout.itemR(lamp, "atmosphere")
split = layout.split()
col = split.column()
col.active = lamp.atmosphere
col.itemL(text="Intensity:")
col.itemR(lamp, "sun_intensity", text="Sun")
col.itemR(lamp, "atmosphere_distance_factor", text="Distance")
col = split.column()
col.active = lamp.atmosphere
col.itemL(text="Scattering:")
sub = col.column(align=True)
sub.itemR(lamp, "atmosphere_inscattering", slider=True, text="Inscattering")
sub.itemR(lamp, "atmosphere_extinction", slider=True, text="Extinction")
class DATA_PT_shadow(DataButtonsPanel):
bl_label = "Shadow"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type in ('POINT', 'SUN', 'SPOT', 'AREA'))
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.itemR(lamp, "shadow_method", expand=True)
if lamp.shadow_method != 'NOSHADOW':
split = layout.split()
col = split.column()
col.itemR(lamp, "shadow_color", text="")
col = split.column()
col.itemR(lamp, "shadow_layer", text="This Layer Only")
col.itemR(lamp, "only_shadow")
if lamp.shadow_method == 'RAY_SHADOW':
col = layout.column()
col.itemL(text="Sampling:")
col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
if lamp.type in ('POINT', 'SUN', 'SPOT'):
split = layout.split()
col = split.column()
col.itemR(lamp, "shadow_soft_size", text="Soft Size")
col.itemR(lamp, "shadow_ray_samples", text="Samples")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
col = split.column()
elif lamp.type == 'AREA':
split = layout.split()
col = split.column()
sub = split.column(align=True)
if lamp.shape == 'SQUARE':
col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE':
col.itemR(lamp, "shadow_ray_samples_x", text="Samples X")
col.itemR(lamp, "shadow_ray_samples_y", text="Samples Y")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
elif lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
sub.itemR(lamp, "umbra")
sub.itemR(lamp, "dither")
sub.itemR(lamp, "jitter")
elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
col.itemL(text="Buffer Type:")
col.row().itemR(lamp, "shadow_buffer_type", expand=True)
if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY', 'DEEP'):
split = layout.split()
col = split.column()
col.itemL(text="Filter Type:")
col.itemR(lamp, "shadow_filter_type", text="")
sub = col.column(align=True)
sub.itemR(lamp, "shadow_buffer_soft", text="Soft")
sub.itemR(lamp, "shadow_buffer_bias", text="Bias")
col = split.column()
col.itemL(text="Sample Buffers:")
col.itemR(lamp, "shadow_sample_buffers", text="")
sub = col.column(align=True)
sub.itemR(lamp, "shadow_buffer_size", text="Size")
sub.itemR(lamp, "shadow_buffer_samples", text="Samples")
if lamp.shadow_buffer_type == 'DEEP':
col.itemR(lamp, "compression_threshold")
elif lamp.shadow_buffer_type == 'IRREGULAR':
layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
row = layout.row()
row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
sub = row.row()
sub.active = not lamp.auto_clip_start
sub.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
row = layout.row()
row.itemR(lamp, "auto_clip_end", text="Autoclip End")
sub = row.row()
sub.active = not lamp.auto_clip_end
sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
class DATA_PT_area(DataButtonsPanel):
bl_label = "Area Shape"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type == 'AREA')
def draw(self, context):
layout = self.layout
lamp = context.lamp
split = layout.split()
col = split.column()
col.row().itemR(lamp, "shape", expand=True)
sub = col.column(align=True)
if (lamp.shape == 'SQUARE'):
sub.itemR(lamp, "size")
elif (lamp.shape == 'RECTANGLE'):
sub.itemR(lamp, "size", text="Size X")
sub.itemR(lamp, "size_y", text="Size Y")
class DATA_PT_spot(DataButtonsPanel):
bl_label = "Spot Shape"
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type == 'SPOT')
def draw(self, context):
layout = self.layout
lamp = context.lamp
split = layout.split()
col = split.column()
sub = col.column()
sub.itemR(lamp, "spot_size", text="Size")
sub.itemR(lamp, "spot_blend", text="Blend", slider=True)
col.itemR(lamp, "square")
col = split.column()
col.itemR(lamp, "halo")
sub = col.column(align=True)
sub.active = lamp.halo
sub.itemR(lamp, "halo_intensity", text="Intensity")
if lamp.shadow_method == 'BUFFER_SHADOW':
sub.itemR(lamp, "halo_step", text="Step")
class DATA_PT_falloff_curve(DataButtonsPanel):
bl_label = "Falloff Curve"
bl_default_closed = True
def poll(self, context):
lamp = context.lamp
return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
def draw(self, context):
lamp = context.lamp
self.layout.template_curve_mapping(lamp, "falloff_curve")
bpy.types.register(DATA_PT_context_lamp)
bpy.types.register(DATA_PT_preview)
bpy.types.register(DATA_PT_lamp)
bpy.types.register(DATA_PT_falloff_curve)
bpy.types.register(DATA_PT_area)
bpy.types.register(DATA_PT_spot)
bpy.types.register(DATA_PT_shadow)
bpy.types.register(DATA_PT_sunsky)

View File

@@ -0,0 +1,78 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return context.lattice
class DATA_PT_context_lattice(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
lat = context.lattice
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif lat:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_lattice(DataButtonsPanel):
bl_label = "Lattice"
def draw(self, context):
layout = self.layout
lat = context.lattice
row = layout.row()
row.itemR(lat, "points_u")
row.itemR(lat, "interpolation_type_u", expand=True)
row = layout.row()
row.itemR(lat, "points_v")
row.itemR(lat, "interpolation_type_v", expand=True)
row = layout.row()
row.itemR(lat, "points_w")
row.itemR(lat, "interpolation_type_w", expand=True)
row = layout.row()
row.itemO("lattice.make_regular")
row.itemR(lat, "outside")
bpy.types.register(DATA_PT_context_lattice)
bpy.types.register(DATA_PT_lattice)

View File

@@ -0,0 +1,274 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return context.mesh
class DATA_PT_context_mesh(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
mesh = context.mesh
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif mesh:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_normals(DataButtonsPanel):
bl_label = "Normals"
def draw(self, context):
layout = self.layout
mesh = context.mesh
split = layout.split()
col = split.column()
col.itemR(mesh, "autosmooth")
sub = col.column()
sub.active = mesh.autosmooth
sub.itemR(mesh, "autosmooth_angle", text="Angle")
col = split.column()
col.itemR(mesh, "vertex_normal_flip")
col.itemR(mesh, "double_sided")
class DATA_PT_settings(DataButtonsPanel):
bl_label = "Settings"
def draw(self, context):
layout = self.layout
mesh = context.mesh
split = layout.split()
col = split.column()
col.itemR(mesh, "texture_mesh")
class DATA_PT_vertex_groups(DataButtonsPanel):
bl_label = "Vertex Groups"
def poll(self, context):
return (context.object and context.object.type in ('MESH', 'LATTICE'))
def draw(self, context):
layout = self.layout
ob = context.object
group = ob.active_vertex_group
rows = 2
if group:
rows = 5
row = layout.row()
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index", rows=rows)
col = row.column(align=True)
col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
col.itemO("object.vertex_group_copy", icon='ICON_COPY_ID', text="")
if ob.data.users > 1:
col.itemO("object.vertex_group_copy_to_linked", icon='ICON_LINK_AREA', text="")
if group:
row = layout.row()
row.itemR(group, "name")
if ob.mode == 'EDIT' and len(ob.vertex_groups) > 0:
row = layout.row()
sub = row.row(align=True)
sub.itemO("object.vertex_group_assign", text="Assign")
sub.itemO("object.vertex_group_remove_from", text="Remove")
sub = row.row(align=True)
sub.itemO("object.vertex_group_select", text="Select")
sub.itemO("object.vertex_group_deselect", text="Deselect")
layout.itemR(context.tool_settings, "vertex_group_weight", text="Weight")
class DATA_PT_shape_keys(DataButtonsPanel):
bl_label = "Shape Keys"
def poll(self, context):
return (context.object and context.object.type in ('MESH', 'LATTICE', 'CURVE', 'SURFACE'))
def draw(self, context):
layout = self.layout
ob = context.object
key = ob.data.shape_keys
kb = ob.active_shape_key
enable_edit = ob.mode != 'EDIT'
enable_edit_value = False
if ob.shape_key_lock == False:
if enable_edit or (ob.type == 'MESH' and ob.shape_key_edit_mode):
enable_edit_value = True
row = layout.row()
rows = 2
if kb:
rows = 5
row.template_list(key, "keys", ob, "active_shape_key_index", rows=rows)
col = row.column()
subcol = col.column(align=True)
subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
if kb:
col.itemS()
subcol = col.column(align=True)
subcol.item_enumO("object.shape_key_move", "type", 'UP', icon='ICON_TRIA_UP', text="")
subcol.item_enumO("object.shape_key_move", "type", 'DOWN', icon='ICON_TRIA_DOWN', text="")
split = layout.split(percentage=0.4)
sub = split.row()
sub.enabled = enable_edit
sub.itemR(key, "relative")
sub = split.row()
sub.alignment = 'RIGHT'
subrow = sub.row(align=True)
subrow.active = enable_edit_value
if ob.shape_key_lock:
subrow.itemR(ob, "shape_key_lock", icon='ICON_PINNED', text="")
else:
subrow.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
if kb.mute:
subrow.itemR(kb, "mute", icon='ICON_MUTE_IPO_ON', text="")
else:
subrow.itemR(kb, "mute", icon='ICON_MUTE_IPO_OFF', text="")
subrow.itemO("object.shape_key_clear", icon='ICON_X', text="")
sub.itemO("object.shape_key_mirror", icon='ICON_MOD_MIRROR', text="")
sub.itemR(ob, "shape_key_edit_mode", text="")
row = layout.row()
row.itemR(kb, "name")
if key.relative:
if ob.active_shape_key_index != 0:
row = layout.row()
row.active = enable_edit_value
row.itemR(kb, "value")
split = layout.split()
sub = split.column(align=True)
sub.active = enable_edit_value
sub.itemL(text="Range:")
sub.itemR(kb, "slider_min", text="Min")
sub.itemR(kb, "slider_max", text="Max")
sub = split.column(align=True)
sub.active = enable_edit_value
sub.itemL(text="Blend:")
sub.item_pointerR(kb, "vertex_group", ob, "vertex_groups", text="")
sub.item_pointerR(kb, "relative_key", key, "keys", text="")
else:
row = layout.row()
row.active = enable_edit_value
row.itemR(key, "slurph")
class DATA_PT_uv_texture(DataButtonsPanel):
bl_label = "UV Texture"
def draw(self, context):
layout = self.layout
me = context.mesh
row = layout.row()
col = row.column()
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
col = row.column(align=True)
col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_uv_texture
if lay:
layout.itemR(lay, "name")
class DATA_PT_vertex_colors(DataButtonsPanel):
bl_label = "Vertex Colors"
def draw(self, context):
layout = self.layout
me = context.mesh
row = layout.row()
col = row.column()
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
col = row.column(align=True)
col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
lay = me.active_vertex_color
if lay:
layout.itemR(lay, "name")
bpy.types.register(DATA_PT_context_mesh)
bpy.types.register(DATA_PT_normals)
bpy.types.register(DATA_PT_settings)
bpy.types.register(DATA_PT_vertex_groups)
bpy.types.register(DATA_PT_shape_keys)
bpy.types.register(DATA_PT_uv_texture)
bpy.types.register(DATA_PT_vertex_colors)

View File

@@ -0,0 +1,130 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return context.meta_ball
class DATA_PT_context_metaball(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
mball = context.meta_ball
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif mball:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_metaball(DataButtonsPanel):
bl_label = "Metaball"
def draw(self, context):
layout = self.layout
mball = context.meta_ball
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(mball, "wire_size", text="View")
sub.itemR(mball, "render_size", text="Render")
col = split.column()
col.itemL(text="Settings:")
col.itemR(mball, "threshold", text="Threshold")
layout.itemL(text="Update:")
layout.itemR(mball, "flag", expand=True)
class DATA_PT_metaball_element(DataButtonsPanel):
bl_label = "Active Element"
def poll(self, context):
return (context.meta_ball and context.meta_ball.active_element)
def draw(self, context):
layout = self.layout
metaelem = context.meta_ball.active_element
split = layout.split(percentage=0.3)
split.itemL(text="Type:")
split.itemR(metaelem, "type", text="")
split = layout.split()
col = split.column()
col.itemL(text="Settings:")
col.itemR(metaelem, "stiffness", text="Stiffness")
col.itemR(metaelem, "negative", text="Negative")
col.itemR(metaelem, "hide", text="Hide")
if metaelem.type == 'BALL':
col = split.column(align=True)
elif metaelem.type == 'CUBE':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
col.itemR(metaelem, "size_y", text="Y")
col.itemR(metaelem, "size_z", text="Z")
elif metaelem.type == 'TUBE':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
elif metaelem.type == 'PLANE':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
col.itemR(metaelem, "size_y", text="Y")
elif metaelem.type == 'ELLIPSOID':
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(metaelem, "size_x", text="X")
col.itemR(metaelem, "size_y", text="Y")
col.itemR(metaelem, "size_z", text="Z")
bpy.types.register(DATA_PT_context_metaball)
bpy.types.register(DATA_PT_metaball)
bpy.types.register(DATA_PT_metaball_element)

View File

@@ -0,0 +1,469 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "modifier"
class DATA_PT_modifiers(DataButtonsPanel):
bl_label = "Modifiers"
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.item_menu_enumO("object.modifier_add", "type")
row.itemL()
for md in ob.modifiers:
box = layout.template_modifier(md)
if box:
# match enum type to our functions, avoids a lookup table.
getattr(self, md.type)(box, ob, md)
# the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements
# so each type must have a function here.
def ARMATURE(self, layout, ob, md):
layout.itemR(md, "object")
split = layout.split(percentage=0.5)
split.itemL(text="Vertex Group:")
sub = split.split(percentage=0.7)
sub.item_pointerR(md, "vertex_group", ob, "vertex_groups", text="")
subsub = sub.row()
subsub.active = md.vertex_group
subsub.itemR(md, "invert")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Bind To:")
col.itemR(md, "use_vertex_groups", text="Vertex Groups")
col.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
col = split.column()
col.itemL(text="Deformation:")
col.itemR(md, "quaternion")
col.itemR(md, "multi_modifier")
def ARRAY(self, layout, ob, md):
layout.itemR(md, "fit_type")
if md.fit_type == 'FIXED_COUNT':
layout.itemR(md, "count")
elif md.fit_type == 'FIT_LENGTH':
layout.itemR(md, "length")
elif md.fit_type == 'FIT_CURVE':
layout.itemR(md, "curve")
layout.itemS()
split = layout.split()
col = split.column()
col.itemR(md, "constant_offset")
sub = col.column()
sub.active = md.constant_offset
sub.itemR(md, "constant_offset_displacement", text="")
col.itemS()
col.itemR(md, "merge_adjacent_vertices", text="Merge")
sub = col.column()
sub.active = md.merge_adjacent_vertices
sub.itemR(md, "merge_end_vertices", text="First Last")
sub.itemR(md, "merge_distance", text="Distance")
col = split.column()
col.itemR(md, "relative_offset")
sub = col.column()
sub.active = md.relative_offset
sub.itemR(md, "relative_offset_displacement", text="")
col.itemS()
col.itemR(md, "add_offset_object")
sub = col.column()
sub.active = md.add_offset_object
sub.itemR(md, "offset_object", text="")
layout.itemS()
col = layout.column()
col.itemR(md, "start_cap")
col.itemR(md, "end_cap")
def BEVEL(self, layout, ob, md):
row = layout.row()
row.itemR(md, "width")
row.itemR(md, "only_vertices")
layout.itemL(text="Limit Method:")
layout.row().itemR(md, "limit_method", expand=True)
if md.limit_method == 'ANGLE':
layout.itemR(md, "angle")
elif md.limit_method == 'WEIGHT':
layout.row().itemR(md, "edge_weight_method", expand=True)
def BOOLEAN(self, layout, ob, md):
layout.itemR(md, "operation")
layout.itemR(md, "object")
def BUILD(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemR(md, "start")
col.itemR(md, "length")
col = split.column()
col.itemR(md, "randomize")
sub = col.column()
sub.active = md.randomize
sub.itemR(md, "seed")
def CAST(self, layout, ob, md):
layout.itemR(md, "cast_type")
layout.itemR(md, "object")
if md.object:
layout.itemR(md, "use_transform")
flow = layout.column_flow()
flow.itemR(md, "x")
flow.itemR(md, "y")
flow.itemR(md, "z")
flow.itemR(md, "factor")
flow.itemR(md, "radius")
flow.itemR(md, "size")
layout.itemR(md, "from_radius")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
def CLOTH(self, layout, ob, md):
layout.itemL(text="See Cloth panel.")
def COLLISION(self, layout, ob, md):
layout.itemL(text="See Collision panel.")
def CURVE(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "deform_axis")
def DECIMATE(self, layout, ob, md):
layout.itemR(md, "ratio")
layout.itemR(md, "face_count")
def DISPLACE(self, layout, ob, md):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "texture")
layout.itemR(md, "midlevel")
layout.itemR(md, "strength")
layout.itemR(md, "direction")
layout.itemR(md, "texture_coordinates")
if md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinate_object", text="Object")
elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
def EDGE_SPLIT(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemR(md, "use_edge_angle", text="Edge Angle")
sub = col.column()
sub.active = md.use_edge_angle
sub.itemR(md, "split_angle")
col = split.column()
col.itemR(md, "use_sharp", text="Sharp Edges")
def EXPLODE(self, layout, ob, md):
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "protect")
flow = layout.column_flow(2)
flow.itemR(md, "split_edges")
flow.itemR(md, "unborn")
flow.itemR(md, "alive")
flow.itemR(md, "dead")
layout.itemO("object.explode_refresh", text="Refresh")
def FLUID_SIMULATION(self, layout, ob, md):
layout.itemL(text="See Fluid panel.")
def HOOK(self, layout, ob, md):
col = layout.column()
col.itemR(md, "object")
if md.object and md.object.type == 'ARMATURE':
layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
split = layout.split()
split.itemR(md, "falloff")
split.itemR(md, "force", slider=True)
layout.itemS()
row = layout.row()
row.itemO("object.hook_reset", text="Reset")
row.itemO("object.hook_recenter", text="Recenter")
if ob.mode == 'EDIT':
row = layout.row()
row.itemO("object.hook_select", text="Select")
row.itemO("object.hook_assign", text="Assign")
def LATTICE(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
def MASK(self, layout, ob, md):
layout.itemR(md, "mode")
if md.mode == 'ARMATURE':
layout.itemR(md, "armature")
elif md.mode == 'VERTEX_GROUP':
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "inverse")
def MESH_DEFORM(self, layout, ob, md):
layout.itemR(md, "object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "invert")
layout.itemS()
if md.is_bound:
layout.itemO("object.meshdeform_bind", text="Unbind")
else:
layout.itemO("object.meshdeform_bind", text="Bind")
row = layout.row()
row.itemR(md, "precision")
row.itemR(md, "dynamic")
def MIRROR(self, layout, ob, md):
layout.itemR(md, "merge_limit")
split = layout.split()
col = split.column()
col.itemR(md, "x")
col.itemR(md, "y")
col.itemR(md, "z")
col = split.column()
col.itemL(text="Textures:")
col.itemR(md, "mirror_u")
col.itemR(md, "mirror_v")
col = split.column()
col.itemR(md, "clip", text="Do Clipping")
col.itemR(md, "mirror_vertex_groups", text="Vertex Group")
layout.itemR(md, "mirror_object")
def MULTIRES(self, layout, ob, md):
layout.itemR(md, "subdivision_type")
row = layout.row()
row.itemO("object.multires_subdivide", text="Subdivide")
row.itemO("object.multires_higher_levels_delete", text="Delete Higher")
layout.itemR(md, "level")
def PARTICLE_INSTANCE(self, layout, ob, md):
layout.itemR(md, "object")
layout.itemR(md, "particle_system_number")
flow = layout.column_flow()
flow.itemR(md, "normal")
flow.itemR(md, "children")
flow.itemR(md, "size")
flow.itemR(md, "path")
if md.path:
flow.itemR(md, "keep_shape")
flow.itemR(md, "unborn")
flow.itemR(md, "alive")
flow.itemR(md, "dead")
flow.itemL(md, "")
if md.path:
flow.itemR(md, "axis", text="")
if md.path:
row = layout.row()
row.itemR(md, "position", slider=True)
row.itemR(md, "random_position", text="Random", slider=True)
def PARTICLE_SYSTEM(self, layout, ob, md):
layout.itemL(text="See Particle panel.")
def SHRINKWRAP(self, layout, ob, md):
layout.itemR(md, "target")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "offset")
layout.itemR(md, "subsurf_levels")
layout.itemR(md, "mode")
if md.mode == 'PROJECT':
layout.itemR(md, "subsurf_levels")
layout.itemR(md, "auxiliary_target")
row = layout.row()
row.itemR(md, "x")
row.itemR(md, "y")
row.itemR(md, "z")
flow = layout.column_flow()
flow.itemR(md, "negative")
flow.itemR(md, "positive")
flow.itemR(md, "cull_front_faces")
flow.itemR(md, "cull_back_faces")
elif md.mode == 'NEAREST_SURFACEPOINT':
layout.itemR(md, "keep_above_surface")
def SIMPLE_DEFORM(self, layout, ob, md):
layout.itemR(md, "mode")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "origin")
layout.itemR(md, "relative")
layout.itemR(md, "factor")
layout.itemR(md, "limits")
if md.mode in ('TAPER', 'STRETCH'):
layout.itemR(md, "lock_x_axis")
layout.itemR(md, "lock_y_axis")
def SMOKE(self, layout, ob, md):
layout.itemL(text="See Smoke panel.")
def SMOOTH(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemR(md, "x")
col.itemR(md, "y")
col.itemR(md, "z")
col = split.column()
col.itemR(md, "factor")
col.itemR(md, "repeat")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
def SOFT_BODY(self, layout, ob, md):
layout.itemL(text="See Soft Body panel.")
def SUBSURF(self, layout, ob, md):
layout.row().itemR(md, "subdivision_type", expand=True)
flow = layout.column_flow()
flow.itemR(md, "levels", text="Preview")
flow.itemR(md, "render_levels", text="Render")
flow.itemR(md, "optimal_draw", text="Optimal Display")
flow.itemR(md, "subsurf_uv")
def SURFACE(self, layout, ob, md):
layout.itemL(text="See Fields panel.")
def UV_PROJECT(self, layout, ob, md):
if ob.type == 'MESH':
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
layout.itemR(md, "image")
layout.itemR(md, "override_image")
split = layout.split()
col = split.column()
col.itemL(text="Aspect Ratio:")
sub = col.column(align=True)
sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
col = split.column()
col.itemL(text="Projectors:")
sub = col.column(align=True)
sub.itemR(md, "num_projectors", text="Number")
for proj in md.projectors:
sub.itemR(proj, "object", text="")
def WAVE(self, layout, ob, md):
split = layout.split()
col = split.column()
col.itemL(text="Motion:")
col.itemR(md, "x")
col.itemR(md, "y")
col.itemR(md, "cyclic")
col = split.column()
col.itemR(md, "normals")
sub = col.column()
sub.active = md.normals
sub.itemR(md, "x_normal", text="X")
sub.itemR(md, "y_normal", text="Y")
sub.itemR(md, "z_normal", text="Z")
split = layout.split()
col = split.column()
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(md, "time_offset", text="Offset")
sub.itemR(md, "lifetime", text="Life")
col.itemR(md, "damping_time", text="Damping")
col = split.column()
col.itemL(text="Position:")
sub = col.column(align=True)
sub.itemR(md, "start_position_x", text="X")
sub.itemR(md, "start_position_y", text="Y")
col.itemR(md, "falloff_radius", text="Falloff")
layout.itemS()
layout.itemR(md, "start_position_object")
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
layout.itemR(md, "texture")
layout.itemR(md, "texture_coordinates")
if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
elif md.texture_coordinates == 'OBJECT':
layout.itemR(md, "texture_coordinates_object")
layout.itemS()
flow = layout.column_flow()
flow.itemR(md, "speed", slider=True)
flow.itemR(md, "height", slider=True)
flow.itemR(md, "width", slider=True)
flow.itemR(md, "narrowness", slider=True)
bpy.types.register(DATA_PT_modifiers)

View File

@@ -0,0 +1,205 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
def poll(self, context):
return (context.object and context.object.type == 'TEXT' and context.curve)
class DATA_PT_context_text(DataButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "data")
split.itemS()
elif curve:
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_shape_text(DataButtonsPanel):
bl_label = "Shape Text"
def draw(self, context):
layout = self.layout
ob = context.object
curve = context.curve
space = context.space_data
split = layout.split()
col = split.column()
col.itemL(text="Caps:")
row = col.row()
row .itemR(curve, "front")
row .itemR(curve, "back")
# col = split.column()
col.itemL(text="Textures:")
col.itemR(curve, "uv_orco")
col.itemR(curve, "auto_texspace")
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(curve, "resolution_u", text="Preview")
sub.itemR(curve, "render_resolution_u", text="Render")
# resolution_v is not used for text
sub = col.column(align=True)
col.itemL(text="Display:")
col.itemR(curve, "fast", text="Fast Editing")
class DATA_PT_geometry_text(DataButtonsPanel):
bl_label = "Geometry"
def draw(self, context):
layout = self.layout
curve = context.curve
split = layout.split()
col = split.column()
col.itemL(text="Modification:")
col.itemR(curve, "width")
col.itemR(curve, "extrude")
col.itemL(text="Taper Object:")
col.itemR(curve, "taper_object", text="")
col = split.column()
col.itemL(text="Bevel:")
col.itemR(curve, "bevel_depth", text="Depth")
col.itemR(curve, "bevel_resolution", text="Resolution")
col.itemL(text="Bevel Object:")
col.itemR(curve, "bevel_object", text="")
class DATA_PT_font(DataButtonsPanel):
bl_label = "Font"
def draw(self, context):
layout = self.layout
text = context.curve
char = context.curve.edit_format
layout.itemR(text, "font")
row = layout.row()
row.itemR(text, "text_size", text="Size")
row.itemR(text, "shear")
split = layout.split()
col = split.column()
col.itemL(text="Object Font:")
col.itemR(text, "family", text="")
col = split.column()
col.itemL(text="Text on Curve:")
col.itemR(text, "text_on_curve", text="")
split = layout.split()
col = split.column()
col.itemL(text="Character:")
col.itemR(char, "bold")
col.itemR(char, "italic")
col.itemR(char, "underline")
# col.itemR(char, "style")
# col.itemR(char, "wrap")
col = split.column(align=True)
col.itemL(text="Underline:")
col.itemR(text, "ul_position", text="Position")
col.itemR(text, "ul_height", text="Thickness")
class DATA_PT_paragraph(DataButtonsPanel):
bl_label = "Paragraph"
def draw(self, context):
layout = self.layout
text = context.curve
layout.itemL(text="Align:")
layout.itemR(text, "spacemode", expand=True)
split = layout.split()
col = split.column(align=True)
col.itemL(text="Spacing:")
col.itemR(text, "spacing", text="Character")
col.itemR(text, "word_spacing", text="Word")
col.itemR(text, "line_dist", text="Line")
col = split.column(align=True)
col.itemL(text="Offset:")
col.itemR(text, "offset_x", text="X")
col.itemR(text, "offset_y", text="Y")
class DATA_PT_textboxes(DataButtonsPanel):
bl_label = "Text Boxes"
def draw(self, context):
layout = self.layout
text = context.curve
for box in text.textboxes:
split = layout.box().split()
col = split.column(align=True)
col.itemL(text="Dimensions:")
col.itemR(box, "width", text="Width")
col.itemR(box, "height", text="Height")
col = split.column(align=True)
col.itemL(text="Offset:")
col.itemR(box, "x", text="X")
col.itemR(box, "y", text="Y")
bpy.types.register(DATA_PT_context_text)
bpy.types.register(DATA_PT_shape_text)
bpy.types.register(DATA_PT_geometry_text)
bpy.types.register(DATA_PT_font)
bpy.types.register(DATA_PT_paragraph)
bpy.types.register(DATA_PT_textboxes)

View File

@@ -0,0 +1,449 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class PhysicsButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
def poll(self, context):
ob = context.active_object
rd = context.scene.render_data
return ob and ob.game and (rd.engine == 'BLENDER_GAME')
class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
bl_label = "Physics"
def draw(self, context):
layout = self.layout
ob = context.active_object
game = ob.game
soft = ob.game.soft_body
layout.itemR(game, "physics_type")
layout.itemS()
#if game.physics_type == 'DYNAMIC':
if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
split = layout.split()
col = split.column()
col.itemR(game, "actor")
col.itemR(game, "ghost")
col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
col = split.column()
col.itemR(game, "material_physics")
col.itemR(game, "rotate_from_normal")
col.itemR(game, "no_sleeping")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Attributes:")
col.itemR(game, "mass")
col.itemR(game, "radius")
col.itemR(game, "form_factor")
col = split.column()
sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY')
sub.itemR(game, "anisotropic_friction")
subsub = sub.column()
subsub.active = game.anisotropic_friction
subsub.itemR(game, "friction_coefficients", text="", slider=True)
split = layout.split()
col = split.column()
col.itemL(text="Velocity:")
sub = col.column(align=True)
sub.itemR(game, "minimum_velocity", text="Minimum")
sub.itemR(game, "maximum_velocity", text="Maximum")
col = split.column()
col.itemL(text="Damping:")
sub = col.column(align=True)
sub.itemR(game, "damping", text="Translation", slider=True)
sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Lock Translation:")
col.itemR(game, "lock_x_axis", text="X")
col.itemR(game, "lock_y_axis", text="Y")
col.itemR(game, "lock_z_axis", text="Z")
col = split.column()
col.itemL(text="Lock Rotation:")
col.itemR(game, "lock_x_rot_axis", text="X")
col.itemR(game, "lock_y_rot_axis", text="Y")
col.itemR(game, "lock_z_rot_axis", text="Z")
elif game.physics_type == 'SOFT_BODY':
col = layout.column()
col.itemR(game, "actor")
col.itemR(game, "ghost")
col.itemR(ob, "restrict_render", text="Invisible")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Attributes:")
col.itemR(game, "mass")
col.itemR(soft, "welding")
col.itemR(soft, "position_iterations")
col.itemR(soft, "linstiff", slider=True)
col.itemR(soft, "dynamic_friction", slider=True)
col.itemR(soft, "margin", slider=True)
col.itemR(soft, "bending_const", text="Bending Constraints")
col = split.column()
col.itemR(soft, "shape_match")
sub = col.column()
sub.active = soft.shape_match
sub.itemR(soft, "threshold", slider=True)
col.itemS()
col.itemL(text="Cluster Collision:")
col.itemR(soft, "cluster_rigid_to_softbody")
col.itemR(soft, "cluster_soft_to_softbody")
sub = col.column()
sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
sub.itemR(soft, "cluster_iterations", text="Iterations")
elif game.physics_type == 'STATIC':
col = layout.column()
col.itemR(game, "actor")
col.itemR(game, "ghost")
col.itemR(ob, "restrict_render", text="Invisible")
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
layout.itemR(ob, "restrict_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
bl_label = "Collision Bounds"
def poll(self, context):
game = context.object.game
rd = context.scene.render_data
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
def draw_header(self, context):
game = context.active_object.game
self.layout.itemR(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
game = context.active_object.game
layout.active = game.use_collision_bounds
layout.itemR(game, "collision_bounds", text="Bounds")
row = layout.row()
row.itemR(game, "collision_compound", text="Compound")
row.itemR(game, "collision_margin", text="Margin", slider=True)
bpy.types.register(PHYSICS_PT_game_physics)
bpy.types.register(PHYSICS_PT_game_collision_bounds)
class RenderButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
def poll(self, context):
rd = context.scene.render_data
return (rd.engine == 'BLENDER_GAME')
class RENDER_PT_game(RenderButtonsPanel):
bl_label = "Game"
def draw(self, context):
layout = self.layout
row = layout.row()
row.itemO("view3d.game_start", text="Start")
row.itemL()
class RENDER_PT_game_player(RenderButtonsPanel):
bl_label = "Standalone Player"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemR(gs, "fullscreen")
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
sub = col.column(align=True)
sub.itemR(gs, "resolution_x", slider=False, text="X")
sub.itemR(gs, "resolution_y", slider=False, text="Y")
col = split.column()
col.itemL(text="Quality:")
sub = col.column(align=True)
sub.itemR(gs, "depth", text="Bit Depth", slider=False)
sub.itemR(gs, "frequency", text="FPS", slider=False)
# framing:
col = layout.column()
col.itemL(text="Framing:")
col.row().itemR(gs, "framing_type", expand=True)
if gs.framing_type == 'LETTERBOX':
col.itemR(gs, "framing_color", text="")
class RENDER_PT_game_stereo(RenderButtonsPanel):
bl_label = "Stereo"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
stereo_mode = gs.stereo
# stereo options:
layout.itemR(gs, "stereo", expand=True)
# stereo:
if stereo_mode == 'STEREO':
layout.itemR(gs, "stereo_mode")
layout.itemL(text="To do: Focal Length")
layout.itemL(text="To do: Eye Separation")
# dome:
elif stereo_mode == 'DOME':
layout.itemR(gs, "dome_mode", text="Dome Type")
dome_type = gs.dome_mode
split = layout.split()
if dome_type == 'FISHEYE' or \
dome_type == 'TRUNCATED_REAR' or \
dome_type == 'TRUNCATED_FRONT':
col = split.column()
col.itemR(gs, "dome_angle", slider=True)
col.itemR(gs, "dome_tilt")
col = split.column()
col.itemR(gs, "dome_tesselation", text="Tesselation")
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
elif dome_type == 'PANORAM_SPH':
col = split.column()
col.itemR(gs, "dome_tesselation", text="Tesselation")
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
else: # cube map
col = split.column()
col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
layout.itemR(gs, "dome_text")
class RENDER_PT_game_shading(RenderButtonsPanel):
bl_label = "Shading"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemR(gs, "material_mode", expand=True)
if gs.material_mode == 'GLSL':
split = layout.split()
col = split.column()
col.itemR(gs, "glsl_lights", text="Lights")
col.itemR(gs, "glsl_shaders", text="Shaders")
col.itemR(gs, "glsl_shadows", text="Shadows")
col = split.column()
col.itemR(gs, "glsl_ramps", text="Ramps")
col.itemR(gs, "glsl_nodes", text="Nodes")
col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
class RENDER_PT_game_performance(RenderButtonsPanel):
bl_label = "Performance"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
split = layout.split()
col = split.column()
col.itemL(text="Show:")
col.itemR(gs, "show_debug_properties", text="Debug Properties")
col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
col.itemR(gs, "deprecation_warnings")
col = split.column()
col.itemL(text="Render:")
col.itemR(gs, "all_frames")
col.itemR(gs, "display_lists")
class RENDER_PT_game_sound(RenderButtonsPanel):
bl_label = "Sound"
def draw(self, context):
layout = self.layout
scene = context.scene
layout.itemR(scene, "distance_model")
layout.itemR(scene, "speed_of_sound", text="Speed")
layout.itemR(scene, "doppler_factor")
bpy.types.register(RENDER_PT_game)
bpy.types.register(RENDER_PT_game_player)
bpy.types.register(RENDER_PT_game_stereo)
bpy.types.register(RENDER_PT_game_shading)
bpy.types.register(RENDER_PT_game_performance)
bpy.types.register(RENDER_PT_game_sound)
class WorldButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"
def poll(self, context):
rd = context.scene.render_data
return (rd.engine == 'BLENDER_GAME')
class WORLD_PT_game_context_world(WorldButtonsPanel):
bl_label = ""
bl_show_header = False
def poll(self, context):
rd = context.scene.render_data
return (context.scene) and (rd.use_game_engine)
def draw(self, context):
layout = self.layout
scene = context.scene
world = context.world
space = context.space_data
split = layout.split(percentage=0.65)
if scene:
split.template_ID(scene, "world", new="world.new")
elif world:
split.template_ID(space, "pin_id")
class WORLD_PT_game_world(WorldButtonsPanel):
bl_label = "World"
def draw(self, context):
layout = self.layout
world = context.world
row = layout.row()
row.column().itemR(world, "horizon_color")
row.column().itemR(world, "ambient_color")
layout.itemR(world.mist, "enabled", text="Mist")
row = layout.column_flow()
row.active = world.mist.enabled
row.itemR(world.mist, "start")
row.itemR(world.mist, "depth")
class WORLD_PT_game_physics(WorldButtonsPanel):
bl_label = "Physics"
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
layout.itemR(gs, "physics_engine")
if gs.physics_engine != 'NONE':
layout.itemR(gs, "physics_gravity", text="Gravity")
split = layout.split()
col = split.column()
col.itemL(text="Physics Steps:")
sub = col.column(align=True)
sub.itemR(gs, "physics_step_max", text="Max")
sub.itemR(gs, "physics_step_sub", text="Substeps")
col.itemR(gs, "fps", text="FPS")
col = split.column()
col.itemL(text="Logic Steps:")
col.itemR(gs, "logic_step_max", text="Max")
col = layout.column()
col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
sub = col.column()
sub.active = gs.use_occlusion_culling
sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
else:
split = layout.split()
col = split.column()
col.itemL(text="Physics Steps:")
col.itemR(gs, "fps", text="FPS")
col = split.column()
col.itemL(text="Logic Steps:")
col.itemR(gs, "logic_step_max", text="Max")
bpy.types.register(WORLD_PT_game_context_world)
bpy.types.register(WORLD_PT_game_world)
bpy.types.register(WORLD_PT_game_physics)

View File

@@ -0,0 +1,789 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
# which settings from node-materials are used
if mat:
mat_node = mat.active_node_material
if mat_node:
return mat_node
else:
return mat
return None
class MaterialButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_preview(MaterialButtonsPanel):
bl_label = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def draw(self, context):
self.layout.template_preview(context.material)
class MATERIAL_PT_context_material(MaterialButtonsPanel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
# An exception, dont call the parent poll func because
# this manages materials for all engine types
engine = context.scene.render_data.engine
return (context.material or context.object) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
ob = context.object
slot = context.material_slot
space = context.space_data
if ob:
row = layout.row()
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
col = row.column(align=True)
col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
col.itemO("object.material_slot_copy", icon='ICON_COPY_ID', text="")
if ob.mode == 'EDIT':
row = layout.row(align=True)
row.itemO("object.material_slot_assign", text="Assign")
row.itemO("object.material_slot_select", text="Select")
row.itemO("object.material_slot_deselect", text="Deselect")
split = layout.split(percentage=0.65)
if ob:
split.template_ID(ob, "active_material", new="material.new")
row = split.row()
if slot:
row.itemR(slot, "link", text="")
else:
row.itemL()
elif mat:
split.template_ID(space, "pin_id")
split.itemS()
if mat:
layout.itemR(mat, "type", expand=True)
class MATERIAL_PT_shading(MaterialButtonsPanel):
bl_label = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
if mat.type in ('SURFACE', 'WIRE'):
split = layout.split()
col = split.column()
sub = col.column()
sub.active = not mat.shadeless
sub.itemR(mat, "emit")
sub.itemR(mat, "ambient")
sub = col.column()
sub.itemR(mat, "translucency")
col = split.column()
col.itemR(mat, "shadeless")
sub = col.column()
sub.active = not mat.shadeless
sub.itemR(mat, "tangent_shading")
sub.itemR(mat, "cubic")
elif mat.type == 'HALO':
layout.itemR(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
bl_label = "Strand"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
tan = mat.strand
split = layout.split()
col = split.column(align=True)
col.itemL(text="Size:")
col.itemR(tan, "root_size", text="Root")
col.itemR(tan, "tip_size", text="Tip")
col.itemR(tan, "min_size", text="Minimum")
col.itemR(tan, "blender_units")
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(tan, "tangent_shading")
col.itemR(tan, "shape")
col = split.column()
col.itemL(text="Shading:")
col.itemR(tan, "width_fade")
ob = context.object
if ob and ob.type == 'MESH':
col.item_pointerR(tan, "uv_layer", ob.data, "uv_textures", text="")
else:
col.itemR(tan, "uv_layer", text="")
col.itemS()
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(tan, "surface_diffuse")
sub = col.column()
sub.active = tan.surface_diffuse
sub.itemR(tan, "blend_distance", text="Distance")
class MATERIAL_PT_physics(MaterialButtonsPanel):
bl_label = "Physics"
COMPAT_ENGINES = set(['BLENDER_GAME'])
def draw(self, context):
layout = self.layout
phys = context.material.physics # dont use node material
split = layout.split()
col = split.column()
col.itemR(phys, "distance")
col.itemR(phys, "friction")
col.itemR(phys, "align_to_normal")
col = split.column()
col.itemR(phys, "force", slider=True)
col.itemR(phys, "elasticity", slider=True)
col.itemR(phys, "damp", slider=True)
class MATERIAL_PT_options(MaterialButtonsPanel):
bl_label = "Options"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE', 'HALO')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
split = layout.split()
col = split.column()
col.itemR(mat, "traceable")
col.itemR(mat, "full_oversampling")
col.itemR(mat, "sky")
col.itemR(mat, "exclude_mist")
col.itemR(mat, "invert_z")
sub = col.row()
sub.itemR(mat, "z_offset")
sub.active = mat.transparency and mat.transparency_method == 'Z_TRANSPARENCY'
sub = col.column(align=True)
sub.itemL(text="Light Group:")
sub.itemR(mat, "light_group", text="")
row = sub.row()
row.active = mat.light_group
row.itemR(mat, "light_group_exclusive", text="Exclusive")
col = split.column()
col.itemR(mat, "face_texture")
sub = col.column()
sub.active = mat.face_texture
sub.itemR(mat, "face_texture_alpha")
col.itemS()
col.itemR(mat, "vertex_color_paint")
col.itemR(mat, "vertex_color_light")
col.itemR(mat, "object_color")
class MATERIAL_PT_shadow(MaterialButtonsPanel):
bl_label = "Shadow"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
split = layout.split()
col = split.column()
col.itemR(mat, "shadows", text="Receive")
col.itemR(mat, "receive_transparent_shadows", text="Receive Transparent")
col.itemR(mat, "only_shadow", text="Shadows Only")
col.itemR(mat, "cast_shadows_only", text="Cast Only")
col.itemR(mat, "shadow_casting_alpha", text="Casting Alpha")
col = split.column()
col.itemR(mat, "cast_buffer_shadows")
sub = col.column()
sub.active = mat.cast_buffer_shadows
sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias")
col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias")
sub = col.column()
sub.active = (not mat.ray_shadow_bias)
sub.itemR(mat, "shadow_ray_bias", text="Ray Bias")
class MATERIAL_PT_diffuse(MaterialButtonsPanel):
bl_label = "Diffuse"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
split = layout.split()
col = split.column()
col.itemR(mat, "diffuse_color", text="")
sub = col.column()
sub.active = (not mat.shadeless)
sub.itemR(mat, "diffuse_intensity", text="Intensity")
col = split.column()
col.active = (not mat.shadeless)
col.itemR(mat, "diffuse_shader", text="")
col.itemR(mat, "use_diffuse_ramp", text="Ramp")
col = layout.column()
col.active = (not mat.shadeless)
if mat.diffuse_shader == 'OREN_NAYAR':
col.itemR(mat, "roughness")
elif mat.diffuse_shader == 'MINNAERT':
col.itemR(mat, "darkness")
elif mat.diffuse_shader == 'TOON':
row = col.row()
row.itemR(mat, "diffuse_toon_size", text="Size")
row.itemR(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL':
row = col.row()
row.itemR(mat, "diffuse_fresnel", text="Fresnel")
row.itemR(mat, "diffuse_fresnel_factor", text="Factor")
if mat.use_diffuse_ramp:
layout.itemS()
layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
layout.itemS()
row = layout.row()
split = row.split(percentage=0.3)
split.itemL(text="Input:")
split.itemR(mat, "diffuse_ramp_input", text="")
split = row.split(percentage=0.3)
split.itemL(text="Blend:")
split.itemR(mat, "diffuse_ramp_blend", text="")
row = layout.row()
row.itemR(mat, "diffuse_ramp_factor", text="Factor")
class MATERIAL_PT_specular(MaterialButtonsPanel):
bl_label = "Specular"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
layout.active = (not mat.shadeless)
split = layout.split()
col = split.column()
col.itemR(mat, "specular_color", text="")
col.itemR(mat, "specular_intensity", text="Intensity")
col = split.column()
col.itemR(mat, "specular_shader", text="")
col.itemR(mat, "use_specular_ramp", text="Ramp")
col = layout.column()
if mat.specular_shader in ('COOKTORR', 'PHONG'):
col.itemR(mat, "specular_hardness", text="Hardness")
elif mat.specular_shader == 'BLINN':
row = col.row()
row.itemR(mat, "specular_hardness", text="Hardness")
row.itemR(mat, "specular_ior", text="IOR")
elif mat.specular_shader == 'WARDISO':
col.itemR(mat, "specular_slope", text="Slope")
elif mat.specular_shader == 'TOON':
row = col.row()
row.itemR(mat, "specular_toon_size", text="Size")
row.itemR(mat, "specular_toon_smooth", text="Smooth")
if mat.use_specular_ramp:
layout.itemS()
layout.template_color_ramp(mat, "specular_ramp", expand=True)
layout.itemS()
row = layout.row()
split = row.split(percentage=0.3)
split.itemL(text="Input:")
split.itemR(mat, "specular_ramp_input", text="")
split = row.split(percentage=0.3)
split.itemL(text="Blend:")
split.itemR(mat, "specular_ramp_blend", text="")
row = layout.row()
row.itemR(mat, "specular_ramp_factor", text="Factor")
class MATERIAL_PT_sss(MaterialButtonsPanel):
bl_label = "Subsurface Scattering"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
self.layout.active = (not mat.shadeless)
self.layout.itemR(sss, "enabled", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
sss = mat.subsurface_scattering
layout.active = sss.enabled
split = layout.split()
split.active = (not mat.shadeless)
col = split.column()
col.itemR(sss, "ior")
col.itemR(sss, "scale")
col.itemR(sss, "color", text="")
col.itemR(sss, "radius", text="RGB Radius")
col = split.column()
sub = col.column(align=True)
sub.itemL(text="Blend:")
sub.itemR(sss, "color_factor", text="Color")
sub.itemR(sss, "texture_factor", text="Texture")
sub.itemL(text="Scattering Weight:")
sub.itemR(sss, "front")
sub.itemR(sss, "back")
col.itemS()
col.itemR(sss, "error_tolerance", text="Error")
class MATERIAL_PT_mirror(MaterialButtonsPanel):
bl_label = "Mirror"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
raym = active_node_mat(context.material).raytrace_mirror
self.layout.itemR(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
raym = mat.raytrace_mirror
layout.active = raym.enabled
split = layout.split()
col = split.column()
col.itemR(raym, "reflect_factor")
col.itemR(mat, "mirror_color", text="")
col = split.column()
col.itemR(raym, "fresnel")
sub = col.column()
sub.active = raym.fresnel > 0
sub.itemR(raym, "fresnel_factor", text="Blend")
split = layout.split()
col = split.column()
col.itemS()
col.itemR(raym, "distance", text="Max Dist")
col.itemR(raym, "depth")
col.itemS()
sub = col.split(percentage=0.4)
sub.itemL(text="Fade To:")
sub.itemR(raym, "fade_to", text="")
col = split.column()
col.itemL(text="Gloss:")
col.itemR(raym, "gloss_factor", text="Amount")
sub = col.column()
sub.active = raym.gloss_factor < 1.0
sub.itemR(raym, "gloss_threshold", text="Threshold")
sub.itemR(raym, "gloss_samples", text="Samples")
sub.itemR(raym, "gloss_anisotropic", text="Anisotropic")
class MATERIAL_PT_transp(MaterialButtonsPanel):
bl_label = "Transparency"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = active_node_mat(context.material)
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
mat = active_node_mat(context.material)
self.layout.itemR(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
mat = active_node_mat(context.material)
rayt = mat.raytrace_transparency
row = layout.row()
row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "transparency_method", expand=True)
split = layout.split()
col = split.column()
col.itemR(mat, "alpha")
row = col.row()
row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "specular_alpha", text="Specular")
col = split.column()
col.active = (not mat.shadeless)
col.itemR(rayt, "fresnel")
sub = col.column()
sub.active = rayt.fresnel > 0
sub.itemR(rayt, "fresnel_factor", text="Blend")
if mat.transparency_method == 'RAYTRACE':
layout.itemS()
split = layout.split()
split.active = mat.transparency
col = split.column()
col.itemR(rayt, "ior")
col.itemR(rayt, "filter")
col.itemR(rayt, "falloff")
col.itemR(rayt, "limit")
col.itemR(rayt, "depth")
col = split.column()
col.itemL(text="Gloss:")
col.itemR(rayt, "gloss_factor", text="Amount")
sub = col.column()
sub.active = rayt.gloss_factor < 1.0
sub.itemR(rayt, "gloss_threshold", text="Threshold")
sub.itemR(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_halo(MaterialButtonsPanel):
bl_label = "Halo"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
halo = mat.halo
split = layout.split()
col = split.column()
col.itemR(mat, "diffuse_color", text="")
col.itemR(halo, "size")
col.itemR(halo, "hardness")
col.itemR(halo, "add")
col.itemL(text="Options:")
col.itemR(halo, "texture")
col.itemR(halo, "vertex_normal")
col.itemR(halo, "xalpha")
col.itemR(halo, "shaded")
col.itemR(halo, "soft")
col = split.column()
col.itemR(halo, "ring")
sub = col.column()
sub.active = halo.ring
sub.itemR(halo, "rings")
sub.itemR(mat, "mirror_color", text="")
col.itemS()
col.itemR(halo, "lines")
sub = col.column()
sub.active = halo.lines
sub.itemR(halo, "line_number", text="Lines")
sub.itemR(mat, "specular_color", text="")
col.itemS()
col.itemR(halo, "star")
sub = col.column()
sub.active = halo.star
sub.itemR(halo, "star_tips")
class MATERIAL_PT_flare(MaterialButtonsPanel):
bl_label = "Flare"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
halo = context.material.halo
self.layout.itemR(halo, "flare_mode", text="")
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
halo = mat.halo
layout.active = halo.flare_mode
split = layout.split()
col = split.column()
col.itemR(halo, "flare_size", text="Size")
col.itemR(halo, "flare_boost", text="Boost")
col.itemR(halo, "flare_seed", text="Seed")
col = split.column()
col.itemR(halo, "flares_sub", text="Subflares")
col.itemR(halo, "flare_subsize", text="Subsize")
bpy.types.register(MATERIAL_PT_context_material)
bpy.types.register(MATERIAL_PT_preview)
bpy.types.register(MATERIAL_PT_diffuse)
bpy.types.register(MATERIAL_PT_specular)
bpy.types.register(MATERIAL_PT_shading)
bpy.types.register(MATERIAL_PT_transp)
bpy.types.register(MATERIAL_PT_mirror)
bpy.types.register(MATERIAL_PT_sss)
bpy.types.register(MATERIAL_PT_halo)
bpy.types.register(MATERIAL_PT_flare)
bpy.types.register(MATERIAL_PT_physics)
bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options)
bpy.types.register(MATERIAL_PT_shadow)
class VolumeButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "material"
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_volume_density(VolumeButtonsPanel):
bl_label = "Density"
bl_default_closed = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
row = split.row()
row.itemR(vol, "density")
row.itemR(vol, "density_scale")
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
bl_label = "Shading"
bl_default_closed = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
col = split.column()
col.itemR(vol, "scattering")
col.itemR(vol, "asymmetry")
col.itemR(vol, "transmission_color")
col = split.column()
sub = col.column(align=True)
sub.itemR(vol, "emission")
sub.itemR(vol, "emission_color", text="")
sub = col.column(align=True)
sub.itemR(vol, "reflection")
sub.itemR(vol, "reflection_color", text="")
class MATERIAL_PT_volume_lighting(VolumeButtonsPanel):
bl_label = "Lighting"
bl_default_closed = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
col = split.column()
col.itemR(vol, "lighting_mode", text="")
col = split.column()
if vol.lighting_mode == 'SHADED':
col.itemR(vol, "external_shadows")
col.itemR(vol, "light_cache")
sub = col.column()
sub.active = vol.light_cache
sub.itemR(vol, "cache_resolution")
elif vol.lighting_mode in ('MULTIPLE_SCATTERING', 'SHADED_PLUS_MULTIPLE_SCATTERING'):
sub = col.column()
sub.enabled = True
sub.active = False
sub.itemR(vol, "light_cache")
col.itemR(vol, "cache_resolution")
sub = col.column(align=True)
sub.itemR(vol, "ms_diffusion")
sub.itemR(vol, "ms_spread")
sub.itemR(vol, "ms_intensity")
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
bl_label = "Transparency"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
mat = context.material # dont use node material
layout.itemR(mat, "transparency_method", expand=True)
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
bl_label = "Integration"
bl_default_closed = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume # dont use node material
split = layout.split()
col = split.column()
col.itemL(text="Step Calculation:")
col.itemR(vol, "step_calculation", text="")
col = col.column(align=True)
col.itemR(vol, "step_size")
col = split.column()
col.itemL()
col.itemR(vol, "depth_cutoff")
bpy.types.register(MATERIAL_PT_volume_density)
bpy.types.register(MATERIAL_PT_volume_shading)
bpy.types.register(MATERIAL_PT_volume_lighting)
bpy.types.register(MATERIAL_PT_volume_transp)
bpy.types.register(MATERIAL_PT_volume_integration)

View File

@@ -0,0 +1,253 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class ObjectButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
class OBJECT_PT_context_object(ObjectButtonsPanel):
bl_label = ""
bl_show_header = False
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.itemL(text="", icon='ICON_OBJECT_DATA')
row.itemR(ob, "name", text="")
class OBJECT_PT_transform(ObjectButtonsPanel):
bl_label = "Transform"
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.column().itemR(ob, "location")
if ob.rotation_mode == 'QUATERNION':
row.column().itemR(ob, "rotation_quaternion", text="Rotation")
elif ob.rotation_mode == 'AXIS_ANGLE':
#row.column().itemL(text="Rotation")
#row.column().itemR(pchan, "rotation_angle", text="Angle")
#row.column().itemR(pchan, "rotation_axis", text="Axis")
row.column().itemR(ob, "rotation_axis_angle", text="Rotation")
else:
row.column().itemR(ob, "rotation_euler", text="Rotation")
row.column().itemR(ob, "scale")
layout.itemR(ob, "rotation_mode")
class OBJECT_PT_transform_locks(ObjectButtonsPanel):
bl_label = "Transform Locks"
bl_default_closed = True
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
col = row.column()
col.itemR(ob, "lock_location")
col = row.column()
if ob.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'):
col.itemR(ob, "lock_rotations_4d", text="Lock Rotation")
if ob.lock_rotations_4d:
col.itemR(ob, "lock_rotation_w", text="W")
col.itemR(ob, "lock_rotation", text="")
else:
col.itemR(ob, "lock_rotation", text="Rotation")
row.column().itemR(ob, "lock_scale")
class OBJECT_PT_relations(ObjectButtonsPanel):
bl_label = "Relations"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
col = split.column()
col.itemR(ob, "layers")
col.itemS()
col.itemR(ob, "pass_index")
col = split.column()
col.itemL(text="Parent:")
col.itemR(ob, "parent", text="")
sub = col.column()
split = sub.split(percentage=0.3)
split.itemL(text="Type:")
split.itemR(ob, "parent_type", text="")
parent = ob.parent
if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE':
sub.item_pointerR(ob, "parent_bone", parent.data, "bones", text="")
sub.active = parent != None
class OBJECT_PT_groups(ObjectButtonsPanel):
bl_label = "Groups"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
split.item_menu_enumO("object.group_add", "group", text="Add to Group")
split.itemL()
for group in bpy.data.groups:
if ob.name in group.objects:
col = layout.column(align=True)
col.set_context_pointer("group", group)
row = col.box().row()
row.itemR(group, "name", text="")
row.itemO("object.group_remove", text="", icon='VICON_X')
split = col.box().split()
split.column().itemR(group, "layer", text="Dupli")
split.column().itemR(group, "dupli_offset", text="")
class OBJECT_PT_display(ObjectButtonsPanel):
bl_label = "Display"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
col = split.column()
col.itemR(ob, "max_draw_type", text="Type")
col = split.column()
row = col.row()
row.itemR(ob, "draw_bounds", text="Bounds")
sub = row.row()
sub.active = ob.draw_bounds
sub.itemR(ob, "draw_bounds_type", text="")
flow = layout.column_flow()
flow.itemR(ob, "draw_name", text="Name")
flow.itemR(ob, "draw_axis", text="Axis")
flow.itemR(ob, "draw_wire", text="Wire")
flow.itemR(ob, "draw_texture_space", text="Texture Space")
flow.itemR(ob, "x_ray", text="X-Ray")
flow.itemR(ob, "draw_transparent", text="Transparency")
class OBJECT_PT_duplication(ObjectButtonsPanel):
bl_label = "Duplication"
def draw(self, context):
layout = self.layout
ob = context.object
layout.itemR(ob, "dupli_type", expand=True)
if ob.dupli_type == 'FRAMES':
split = layout.split()
col = split.column(align=True)
col.itemR(ob, "dupli_frames_start", text="Start")
col.itemR(ob, "dupli_frames_end", text="End")
col = split.column(align=True)
col.itemR(ob, "dupli_frames_on", text="On")
col.itemR(ob, "dupli_frames_off", text="Off")
layout.itemR(ob, "dupli_frames_no_speed", text="No Speed")
elif ob.dupli_type == 'VERTS':
layout.itemR(ob, "dupli_verts_rotation", text="Rotation")
elif ob.dupli_type == 'FACES':
row = layout.row()
row.itemR(ob, "dupli_faces_scale", text="Scale")
row.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
elif ob.dupli_type == 'GROUP':
layout.itemR(ob, "dupli_group", text="Group")
class OBJECT_PT_animation(ObjectButtonsPanel):
bl_label = "Animation"
def draw(self, context):
layout = self.layout
ob = context.object
split = layout.split()
col = split.column()
col.itemL(text="Time Offset:")
col.itemR(ob, "time_offset_edit", text="Edit")
row = col.row()
row.itemR(ob, "time_offset_particle", text="Particle")
row.active = len(ob.particle_systems) != 0
row = col.row()
row.itemR(ob, "time_offset_parent", text="Parent")
row.active = ob.parent != None
row = col.row()
row.itemR(ob, "slow_parent")
row.active = ob.parent != None
col.itemR(ob, "time_offset", text="Offset")
col = split.column()
col.itemL(text="Track:")
col.itemR(ob, "track", text="")
col.itemR(ob, "track_axis", text="Axis")
col.itemR(ob, "up_axis", text="Up Axis")
row = col.row()
row.itemR(ob, "track_override_parent", text="Override Parent")
row.active = ob.parent != None
bpy.types.register(OBJECT_PT_context_object)
bpy.types.register(OBJECT_PT_transform)
bpy.types.register(OBJECT_PT_transform_locks)
bpy.types.register(OBJECT_PT_relations)
bpy.types.register(OBJECT_PT_groups)
bpy.types.register(OBJECT_PT_display)
bpy.types.register(OBJECT_PT_duplication)
bpy.types.register(OBJECT_PT_animation)

View File

@@ -0,0 +1,790 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class ConstraintButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "constraint"
def draw_constraint(self, context, con):
layout = self.layout
box = layout.template_constraint(con)
if box:
# match enum type to our functions, avoids a lookup table.
getattr(self, con.type)(context, box, con)
# show/key buttons here are most likely obsolete now, with
# keyframing functionality being part of every button
if con.type not in ('RIGID_BODY_JOINT', 'SPLINE_IK', 'NULL'):
box.itemR(con, "influence")
def space_template(self, layout, con, target=True, owner=True):
if target or owner:
row = layout.row()
row.itemL(text="Convert:")
if target:
row.itemR(con, "target_space", text="")
if target and owner:
row.itemL(icon='ICON_ARROW_LEFTRIGHT')
if owner:
row.itemR(con, "owner_space", text="")
def target_template(self, layout, con, subtargets=True):
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
if con.target and subtargets:
if con.target.type == 'ARMATURE':
layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
if con.type == 'COPY_LOCATION':
row = layout.row()
row.itemL(text="Head/Tail:")
row.itemR(con, "head_tail", text="")
elif con.target.type in ('MESH', 'LATTICE'):
layout.item_pointerR(con, "subtarget", con.target, "vertex_groups", text="Vertex Group")
def ik_template(self, layout, con):
# only used for iTaSC
layout.itemR(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target:
row = layout.row()
row.itemL()
row.itemR(con, "pole_angle")
split = layout.split(percentage=0.33)
col = split.column()
col.itemR(con, "tail")
col.itemR(con, "stretch")
col = split.column()
col.itemR(con, "chain_length")
col.itemR(con, "targetless")
def CHILD_OF(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemL(text="Location:")
col.itemR(con, "locationx", text="X")
col.itemR(con, "locationy", text="Y")
col.itemR(con, "locationz", text="Z")
col = split.column()
col.itemL(text="Rotation:")
col.itemR(con, "rotationx", text="X")
col.itemR(con, "rotationy", text="Y")
col.itemR(con, "rotationz", text="Z")
col = split.column()
col.itemL(text="Scale:")
col.itemR(con, "sizex", text="X")
col.itemR(con, "sizey", text="Y")
col.itemR(con, "sizez", text="Z")
row = layout.row()
row.itemO("constraint.childof_set_inverse")
row.itemO("constraint.childof_clear_inverse")
def TRACK_TO(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="To:")
row.itemR(con, "track", expand=True)
row = layout.row()
#row.itemR(con, "up", text="Up", expand=True) # XXX: up and expand don't play nice together
row.itemR(con, "up", text="Up")
row.itemR(con, "target_z")
self.space_template(layout, con)
def IK(self, context, layout, con):
if context.object.pose.ik_solver == "ITASC":
layout.itemR(con, "ik_type")
getattr(self, "IK_" + con.ik_type)(context, layout, con)
else:
# Legacy IK constraint
self.target_template(layout, con)
layout.itemR(con, "pole_target")
if con.pole_target and con.pole_target.type == 'ARMATURE':
layout.item_pointerR(con, "pole_subtarget", con.pole_target.data, "bones", text="Bone")
if con.pole_target:
row = layout.row()
row.itemL()
row.itemR(con, "pole_angle")
split = layout.split()
col = split.column()
col.itemR(con, "tail")
col.itemR(con, "stretch")
col = split.column()
col.itemR(con, "iterations")
col.itemR(con, "chain_length")
split = layout.split()
col = split.column()
col.itemL()
col.itemR(con, "targetless")
col.itemR(con, "rotation")
col = split.column()
col.itemL(text="Weight:")
col.itemR(con, "weight", text="Position", slider=True)
sub = col.column()
sub.active = con.rotation
sub.itemR(con, "orient_weight", text="Rotation", slider=True)
def IK_COPY_POSE(self, context, layout, con):
self.target_template(layout, con)
self.ik_template(layout, con)
row = layout.row()
row.itemL(text="Axis Ref:")
row.itemR(con, "axis_reference", expand=True)
split = layout.split(percentage=0.33)
split.row().itemR(con, "position")
row = split.row()
row.itemR(con, "weight", text="Weight", slider=True)
row.active = con.position
split = layout.split(percentage=0.33)
row = split.row()
row.itemL(text="Lock:")
row = split.row()
row.itemR(con, "pos_lock_x", text="X")
row.itemR(con, "pos_lock_y", text="Y")
row.itemR(con, "pos_lock_z", text="Z")
split.active = con.position
split = layout.split(percentage=0.33)
split.row().itemR(con, "rotation")
row = split.row()
row.itemR(con, "orient_weight", text="Weight", slider=True)
row.active = con.rotation
split = layout.split(percentage=0.33)
row = split.row()
row.itemL(text="Lock:")
row = split.row()
row.itemR(con, "rot_lock_x", text="X")
row.itemR(con, "rot_lock_y", text="Y")
row.itemR(con, "rot_lock_z", text="Z")
split.active = con.rotation
def IK_DISTANCE(self, context, layout, con):
self.target_template(layout, con)
self.ik_template(layout, con)
layout.itemR(con, "limit_mode")
row = layout.row()
row.itemR(con, "weight", text="Weight", slider=True)
row.itemR(con, "distance", text="Distance", slider=True)
def FOLLOW_PATH(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "use_curve_follow")
col.itemR(con, "use_curve_radius")
col = split.column()
col.itemR(con, "use_fixed_position")
if con.use_fixed_position:
col.itemR(con, "offset_factor", text="Offset")
else:
col.itemR(con, "offset")
row = layout.row()
row.itemL(text="Forward:")
row.itemR(con, "forward", expand=True)
row = layout.row()
row.itemR(con, "up", text="Up")
row.itemL()
def LIMIT_ROTATION(self, context, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_limit_x")
sub = col.column()
sub.active = con.use_limit_x
sub.itemR(con, "minimum_x", text="Min")
sub.itemR(con, "maximum_x", text="Max")
col = split.column()
col.itemR(con, "use_limit_y")
sub = col.column()
sub.active = con.use_limit_y
sub.itemR(con, "minimum_y", text="Min")
sub.itemR(con, "maximum_y", text="Max")
col = split.column()
col.itemR(con, "use_limit_z")
sub = col.column()
sub.active = con.use_limit_z
sub.itemR(con, "minimum_z", text="Min")
sub.itemR(con, "maximum_z", text="Max")
row = layout.row()
row.itemR(con, "limit_transform")
row.itemL()
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def LIMIT_LOCATION(self, context, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_minimum_x")
sub = col.column()
sub.active = con.use_minimum_x
sub.itemR(con, "minimum_x", text="")
col.itemR(con, "use_maximum_x")
sub = col.column()
sub.active = con.use_maximum_x
sub.itemR(con, "maximum_x", text="")
col = split.column()
col.itemR(con, "use_minimum_y")
sub = col.column()
sub.active = con.use_minimum_y
sub.itemR(con, "minimum_y", text="")
col.itemR(con, "use_maximum_y")
sub = col.column()
sub.active = con.use_maximum_y
sub.itemR(con, "maximum_y", text="")
col = split.column()
col.itemR(con, "use_minimum_z")
sub = col.column()
sub.active = con.use_minimum_z
sub.itemR(con, "minimum_z", text="")
col.itemR(con, "use_maximum_z")
sub = col.column()
sub.active = con.use_maximum_z
sub.itemR(con, "maximum_z", text="")
row = layout.row()
row.itemR(con, "limit_transform")
row.itemL()
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def LIMIT_SCALE(self, context, layout, con):
split = layout.split()
col = split.column()
col.itemR(con, "use_minimum_x")
sub = col.column()
sub.active = con.use_minimum_x
sub.itemR(con, "minimum_x", text="")
col.itemR(con, "use_maximum_x")
sub = col.column()
sub.active = con.use_maximum_x
sub.itemR(con, "maximum_x", text="")
col = split.column()
col.itemR(con, "use_minimum_y")
sub = col.column()
sub.active = con.use_minimum_y
sub.itemR(con, "minimum_y", text="")
col.itemR(con, "use_maximum_y")
sub = col.column()
sub.active = con.use_maximum_y
sub.itemR(con, "maximum_y", text="")
col = split.column()
col.itemR(con, "use_minimum_z")
sub = col.column()
sub.active = con.use_minimum_z
sub.itemR(con, "minimum_z", text="")
col.itemR(con, "use_maximum_z")
sub = col.column()
sub.active = con.use_maximum_z
sub.itemR(con, "maximum_z", text="")
row = layout.row()
row.itemR(con, "limit_transform")
row.itemL()
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def COPY_ROTATION(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "rotate_like_x", text="X")
sub = col.column()
sub.active = con.rotate_like_x
sub.itemR(con, "invert_x", text="Invert")
col = split.column()
col.itemR(con, "rotate_like_y", text="Y")
sub = col.column()
sub.active = con.rotate_like_y
sub.itemR(con, "invert_y", text="Invert")
col = split.column()
col.itemR(con, "rotate_like_z", text="Z")
sub = col.column()
sub.active = con.rotate_like_z
sub.itemR(con, "invert_z", text="Invert")
layout.itemR(con, "offset")
self.space_template(layout, con)
def COPY_LOCATION(self, context, layout, con):
self.target_template(layout, con)
split = layout.split()
col = split.column()
col.itemR(con, "locate_like_x", text="X")
sub = col.column()
sub.active = con.locate_like_x
sub.itemR(con, "invert_x", text="Invert")
col = split.column()
col.itemR(con, "locate_like_y", text="Y")
sub = col.column()
sub.active = con.locate_like_y
sub.itemR(con, "invert_y", text="Invert")
col = split.column()
col.itemR(con, "locate_like_z", text="Z")
sub = col.column()
sub.active = con.locate_like_z
sub.itemR(con, "invert_z", text="Invert")
layout.itemR(con, "offset")
self.space_template(layout, con)
def COPY_SCALE(self, context, layout, con):
self.target_template(layout, con)
row = layout.row(align=True)
row.itemR(con, "size_like_x", text="X")
row.itemR(con, "size_like_y", text="Y")
row.itemR(con, "size_like_z", text="Z")
layout.itemR(con, "offset")
self.space_template(layout, con)
#def SCRIPT(self, context, layout, con):
def ACTION(self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "action")
layout.itemR(con, "transform_channel")
split = layout.split()
col = split.column(align=True)
col.itemR(con, "start_frame", text="Start")
col.itemR(con, "end_frame", text="End")
col = split.column(align=True)
col.itemR(con, "minimum", text="Min")
col.itemR(con, "maximum", text="Max")
row = layout.row()
row.itemL(text="Convert:")
row.itemR(con, "owner_space", text="")
def LOCKED_TRACK(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="To:")
row.itemR(con, "track", expand=True)
row = layout.row()
row.itemL(text="Lock:")
row.itemR(con, "locked", expand=True)
def LIMIT_DISTANCE(self, context, layout, con):
self.target_template(layout, con)
col = layout.column(align=True)
col.itemR(con, "distance")
col.itemO("constraint.limitdistance_reset")
row = layout.row()
row.itemL(text="Clamp Region:")
row.itemR(con, "limit_mode", text="")
def STRETCH_TO(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemR(con, "original_length", text="Rest Length")
row.itemO("constraint.stretchto_reset", text="Reset")
col = layout.column()
col.itemR(con, "bulge", text="Volume Variation")
row = layout.row()
row.itemL(text="Volume:")
row.itemR(con, "volume", expand=True)
row.itemL(text="Plane:")
row.itemR(con, "keep_axis", expand=True)
def FLOOR(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemR(con, "sticky")
row.itemR(con, "use_rotation")
layout.itemR(con, "offset")
row = layout.row()
row.itemL(text="Min/Max:")
row.itemR(con, "floor_location", expand=True)
def RIGID_BODY_JOINT(self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "pivot_type")
layout.itemR(con, "child")
row = layout.row()
row.itemR(con, "disable_linked_collision", text="No Collision")
row.itemR(con, "draw_pivot", text="Display Pivot")
split = layout.split()
col = split.column(align=True)
col.itemL(text="Pivot:")
col.itemR(con, "pivot_x", text="X")
col.itemR(con, "pivot_y", text="Y")
col.itemR(con, "pivot_z", text="Z")
col = split.column(align=True)
col.itemL(text="Axis:")
col.itemR(con, "axis_x", text="X")
col.itemR(con, "axis_y", text="Y")
col.itemR(con, "axis_z", text="Z")
#Missing: Limit arrays (not wrapped in RNA yet)
def CLAMP_TO(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="Main Axis:")
row.itemR(con, "main_axis", expand=True)
row = layout.row()
row.itemR(con, "cyclic")
def TRANSFORM(self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "extrapolate_motion", text="Extrapolate")
split = layout.split()
col = split.column()
col.itemL(text="Source:")
col.row().itemR(con, "map_from", expand=True)
sub = col.row(align=True)
sub.itemL(text="X:")
sub.itemR(con, "from_min_x", text="")
sub.itemR(con, "from_max_x", text="")
sub = col.row(align=True)
sub.itemL(text="Y:")
sub.itemR(con, "from_min_y", text="")
sub.itemR(con, "from_max_y", text="")
sub = col.row(align=True)
sub.itemL(text="Z:")
sub.itemR(con, "from_min_z", text="")
sub.itemR(con, "from_max_z", text="")
split = layout.split()
col = split.column()
col.itemL(text="Destination:")
col.row().itemR(con, "map_to", expand=True)
sub = col.row(align=True)
sub.itemR(con, "map_to_x_from", text="")
sub.itemR(con, "to_min_x", text="")
sub.itemR(con, "to_max_x", text="")
sub = col.row(align=True)
sub.itemR(con, "map_to_y_from", text="")
sub.itemR(con, "to_min_y", text="")
sub.itemR(con, "to_max_y", text="")
sub = col.row(align=True)
sub.itemR(con, "map_to_z_from", text="")
sub.itemR(con, "to_min_z", text="")
sub.itemR(con, "to_max_z", text="")
self.space_template(layout, con)
def SHRINKWRAP(self, context, layout, con):
self.target_template(layout, con)
layout.itemR(con, "distance")
layout.itemR(con, "shrinkwrap_type")
if con.shrinkwrap_type == 'PROJECT':
row = layout.row(align=True)
row.itemR(con, "axis_x")
row.itemR(con, "axis_y")
row.itemR(con, "axis_z")
def DAMPED_TRACK(self, context, layout, con):
self.target_template(layout, con)
row = layout.row()
row.itemL(text="To:")
row.itemR(con, "track", expand=True)
def SPLINE_IK(self, context, layout, con):
self.target_template(layout, con)
col = layout.column()
col.itemL(text="Spline Fitting:")
col.itemR(con, "chain_length")
col.itemR(con, "even_divisions")
#col.itemR(con, "affect_root") # XXX: this is not that useful yet
col = layout.column()
col.itemL(text="Chain Scaling:")
col.itemR(con, "keep_max_length")
col.itemR(con, "radius_to_thickness")
class OBJECT_PT_constraints(ConstraintButtonsPanel):
bl_label = "Object Constraints"
bl_context = "constraint"
def poll(self, context):
return (context.object)
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.item_menu_enumO("object.constraint_add", "type")
row.itemL()
for con in ob.constraints:
self.draw_constraint(context, con)
class BONE_PT_inverse_kinematics(ConstraintButtonsPanel):
bl_label = "Inverse Kinematics"
bl_default_closed = True
bl_context = "bone_constraint"
def poll(self, context):
ob = context.object
bone = context.bone
if ob and bone:
pchan = ob.pose.pose_channels[bone.name]
return pchan.has_ik
return False
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
pchan = ob.pose.pose_channels[bone.name]
row = layout.row()
row.itemR(ob.pose, "ik_solver")
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_x", text="X")
row = split.row()
row.itemR(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
row.active = pchan.ik_dof_x
split = layout.split(percentage=0.25)
row = split.row()
row.itemR(pchan, "ik_limit_x", text="Limit")
row.active = pchan.ik_dof_x
row = split.row(align=True)
row.itemR(pchan, "ik_min_x", text="")
row.itemR(pchan, "ik_max_x", text="")
row.active = pchan.ik_dof_x and pchan.ik_limit_x
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_y", text="Y")
row = split.row()
row.itemR(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
row.active = pchan.ik_dof_y
split = layout.split(percentage=0.25)
row = split.row()
row.itemR(pchan, "ik_limit_y", text="Limit")
row.active = pchan.ik_dof_y
row = split.row(align=True)
row.itemR(pchan, "ik_min_y", text="")
row.itemR(pchan, "ik_max_y", text="")
row.active = pchan.ik_dof_y and pchan.ik_limit_y
split = layout.split(percentage=0.25)
split.itemR(pchan, "ik_dof_z", text="Z")
row = split.row()
row.itemR(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
row.active = pchan.ik_dof_z
split = layout.split(percentage=0.25)
row = split.row()
row.itemR(pchan, "ik_limit_z", text="Limit")
row.active = pchan.ik_dof_z
row = split.row(align=True)
row.itemR(pchan, "ik_min_z", text="")
row.itemR(pchan, "ik_max_z", text="")
row.active = pchan.ik_dof_z and pchan.ik_limit_z
split = layout.split()
split.itemR(pchan, "ik_stretch", text="Stretch", slider=True)
split.itemL()
if ob.pose.ik_solver == "ITASC":
row = layout.row()
row.itemR(pchan, "ik_rot_control", text="Control Rotation")
row.itemR(pchan, "ik_rot_weight", text="Weight", slider=True)
# not supported yet
#row = layout.row()
#row.itemR(pchan, "ik_lin_control", text="Joint Size")
#row.itemR(pchan, "ik_lin_weight", text="Weight", slider=True)
class BONE_PT_iksolver_itasc(ConstraintButtonsPanel):
bl_label = "iTaSC parameters"
bl_default_closed = True
bl_context = "bone_constraint"
def poll(self, context):
ob = context.object
bone = context.bone
if ob and bone:
pchan = ob.pose.pose_channels[bone.name]
return pchan.has_ik and ob.pose.ik_solver == "ITASC" and ob.pose.ik_param
return False
def draw(self, context):
layout = self.layout
ob = context.object
itasc = ob.pose.ik_param
layout.itemR(itasc, "mode", expand=True)
simulation = itasc.mode == "SIMULATION"
if simulation:
layout.itemL(text="Reiteration:")
layout.itemR(itasc, "reiteration", expand=True)
flow = layout.column_flow()
flow.itemR(itasc, "precision", text="Prec")
flow.itemR(itasc, "num_iter", text="Iter")
flow.active = not simulation or itasc.reiteration != "NEVER"
if simulation:
layout.itemR(itasc, "auto_step")
row = layout.row()
if itasc.auto_step:
row.itemR(itasc, "min_step", text="Min")
row.itemR(itasc, "max_step", text="Max")
else:
row.itemR(itasc, "num_step")
layout.itemR(itasc, "solver")
if simulation:
layout.itemR(itasc, "feedback")
layout.itemR(itasc, "max_velocity")
if itasc.solver == "DLS":
row = layout.row()
row.itemR(itasc, "dampmax", text="Damp", slider=True)
row.itemR(itasc, "dampeps", text="Eps", slider=True)
class BONE_PT_constraints(ConstraintButtonsPanel):
bl_label = "Bone Constraints"
bl_context = "bone_constraint"
def poll(self, context):
ob = context.object
return (ob and ob.type == 'ARMATURE' and context.bone)
def draw(self, context):
layout = self.layout
ob = context.object
pchan = ob.pose.pose_channels[context.bone.name]
row = layout.row()
row.item_menu_enumO("pose.constraint_add", "type")
row.itemL()
for con in pchan.constraints:
self.draw_constraint(context, con)
bpy.types.register(OBJECT_PT_constraints)
bpy.types.register(BONE_PT_iksolver_itasc)
bpy.types.register(BONE_PT_inverse_kinematics)
bpy.types.register(BONE_PT_constraints)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,212 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
def cloth_panel_enabled(md):
return md.point_cache.baked == False
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_cloth(PhysicButtonsPanel):
bl_label = "Cloth"
def draw(self, context):
layout = self.layout
md = context.cloth
ob = context.object
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add")
split.itemL()
if md:
cloth = md.settings
layout.active = cloth_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemL(text="Quality:")
col.itemR(cloth, "quality", text="Steps", slider=True)
col.itemL(text="Material:")
sub = col.column(align=True)
sub.itemR(cloth, "mass")
sub.itemR(cloth, "structural_stiffness", text="Structural")
sub.itemR(cloth, "bending_stiffness", text="Bending")
col = split.column()
col.itemL(text="Presets:")
col.itemL(text="TODO!")
col.itemL(text="Damping:")
sub = col.column(align=True)
sub.itemR(cloth, "spring_damping", text="Spring")
sub.itemR(cloth, "air_damping", text="Air")
col.itemR(cloth, "pin_cloth", text="Pin")
sub = col.column(align=True)
sub.active = cloth.pin_cloth
sub.itemR(cloth, "pin_stiffness", text="Stiffness")
sub.item_pointerR(cloth, "mass_vertex_group", ob, "vertex_groups", text="")
# Disabled for now
"""
if cloth.mass_vertex_group:
layout.itemL(text="Goal:")
col = layout.column_flow()
col.itemR(cloth, "goal_default", text="Default")
col.itemR(cloth, "goal_spring", text="Stiffness")
col.itemR(cloth, "goal_friction", text="Friction")
"""
class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
bl_label = "Cloth Cache"
bl_default_closed = True
def poll(self, context):
return context.cloth
def draw(self, context):
md = context.cloth
point_cache_ui(self, md.point_cache, cloth_panel_enabled(md), 0, 0)
class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
bl_label = "Cloth Collision"
bl_default_closed = True
def poll(self, context):
return context.cloth
def draw_header(self, context):
cloth = context.cloth.collision_settings
self.layout.active = cloth_panel_enabled(context.cloth)
self.layout.itemR(cloth, "enable_collision", text="")
def draw(self, context):
layout = self.layout
cloth = context.cloth.collision_settings
md = context.cloth
layout.active = cloth.enable_collision and cloth_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemR(cloth, "collision_quality", slider=True, text="Quality")
col.itemR(cloth, "min_distance", slider=True, text="Distance")
col.itemR(cloth, "friction")
col = split.column()
col.itemR(cloth, "enable_self_collision", text="Self Collision")
sub = col.column()
sub.active = cloth.enable_self_collision
sub.itemR(cloth, "self_collision_quality", slider=True, text="Quality")
sub.itemR(cloth, "self_min_distance", slider=True, text="Distance")
class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
bl_label = "Cloth Stiffness Scaling"
bl_default_closed = True
def poll(self, context):
return context.cloth
def draw_header(self, context):
cloth = context.cloth.settings
self.layout.active = cloth_panel_enabled(context.cloth)
self.layout.itemR(cloth, "stiffness_scaling", text="")
def draw(self, context):
layout = self.layout
md = context.cloth
ob = context.object
cloth = context.cloth.settings
layout.active = cloth.stiffness_scaling and cloth_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemL(text="Structural Stiffness:")
sub = col.column(align=True)
sub.itemR(cloth, "structural_stiffness_max", text="Max")
sub.item_pointerR(cloth, "structural_stiffness_vertex_group", ob, "vertex_groups", text="")
col = split.column()
col.itemL(text="Bending Stiffness:")
sub = col.column(align=True)
sub.itemR(cloth, "bending_stiffness_max", text="Max")
sub.item_pointerR(cloth, "bending_vertex_group", ob, "vertex_groups", text="")
class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel):
bl_label = "Cloth Field Weights"
bl_default_closed = True
def poll(self, context):
return (context.cloth)
def draw(self, context):
cloth = context.cloth.settings
effector_weights_ui(self, cloth.effector_weights)
bpy.types.register(PHYSICS_PT_cloth)
bpy.types.register(PHYSICS_PT_cloth_cache)
bpy.types.register(PHYSICS_PT_cloth_collision)
bpy.types.register(PHYSICS_PT_cloth_stiffness)
bpy.types.register(PHYSICS_PT_cloth_field_weights)

View File

@@ -0,0 +1,181 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
def point_cache_ui(self, cache, enabled, particles, smoke):
layout = self.layout
layout.set_context_pointer("PointCache", cache)
row = layout.row()
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2)
col = row.column(align=True)
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
row = layout.row()
row.itemL(text="File Name:")
if particles:
row.itemR(cache, "external")
if cache.external:
split = layout.split(percentage=0.80)
split.itemR(cache, "name", text="")
split.itemR(cache, "index", text="")
layout.itemL(text="File Path:")
layout.itemR(cache, "filepath", text="")
layout.itemL(text=cache.info)
else:
layout.itemR(cache, "name", text="")
if not particles:
row = layout.row()
row.enabled = enabled
row.itemR(cache, "start_frame")
row.itemR(cache, "end_frame")
row = layout.row()
if cache.baked == True:
row.itemO("ptcache.free_bake", text="Free Bake")
else:
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
sub = row.row()
sub.enabled = (cache.frames_skipped or cache.outdated) and enabled
sub.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
row = layout.row()
row.enabled = enabled
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
if not smoke:
row.itemR(cache, "step")
if not smoke:
row = layout.row()
sub = row.row()
sub.enabled = enabled
sub.itemR(cache, "quick_cache")
row.itemR(cache, "disk_cache")
layout.itemL(text=cache.info)
layout.itemS()
row = layout.row()
row.item_booleanO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
def effector_weights_ui(self, weights):
layout = self.layout
layout.itemR(weights, "group")
split = layout.split()
split.itemR(weights, "gravity", slider=True)
split.itemR(weights, "all", slider=True)
layout.itemS()
flow = layout.column_flow()
flow.itemR(weights, "force", slider=True)
flow.itemR(weights, "vortex", slider=True)
flow.itemR(weights, "magnetic", slider=True)
flow.itemR(weights, "wind", slider=True)
flow.itemR(weights, "curveguide", slider=True)
flow.itemR(weights, "texture", slider=True)
flow.itemR(weights, "harmonic", slider=True)
flow.itemR(weights, "charge", slider=True)
flow.itemR(weights, "lennardjones", slider=True)
flow.itemR(weights, "turbulence", slider=True)
flow.itemR(weights, "drag", slider=True)
flow.itemR(weights, "boid", slider=True)
def basic_force_field_settings_ui(self, field):
layout = self.layout
split = layout.split()
if not field or field.type == 'NONE':
return
col = split.column()
if field.type == 'DRAG':
col.itemR(field, "linear_drag", text="Linear")
else:
col.itemR(field, "strength")
if field.type == 'TURBULENCE':
col.itemR(field, "size")
col.itemR(field, "flow")
elif field.type == 'HARMONIC':
col.itemR(field, "harmonic_damping", text="Damping")
elif field.type == 'VORTEX' and field.shape != 'POINT':
col.itemR(field, "inflow")
elif field.type == 'DRAG':
col.itemR(field, "quadratic_drag", text="Quadratic")
else:
col.itemR(field, "flow")
col = split.column()
col.itemR(field, "noise")
col.itemR(field, "seed")
if field.type == 'TURBULENCE':
col.itemR(field, "global_coordinates", text="Global")
split = layout.split()
col = split.column()
col.itemL(text="Effect point:")
col.itemR(field, "do_location")
col.itemR(field, "do_rotation")
sub = split.column()
sub.itemL(text="Collision:")
sub.itemR(field, "do_absorption")
def basic_force_field_falloff_ui(self, field):
layout = self.layout
split = layout.split(percentage=0.35)
if not field or field.type == 'NONE':
return
col = split.column()
col.itemR(field, "z_direction", text="")
col.itemR(field, "use_min_distance", text="Use Minimum")
col.itemR(field, "use_max_distance", text="Use Maximum")
col = split.column()
col.itemR(field, "falloff_power", text="Power")
sub = col.column()
sub.active = field.use_min_distance
sub.itemR(field, "minimum_distance", text="Distance")
sub = col.column()
sub.active = field.use_max_distance
sub.itemR(field, "maximum_distance", text="Distance")

View File

@@ -0,0 +1,222 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from properties_physics_common import basic_force_field_settings_ui
from properties_physics_common import basic_force_field_falloff_ui
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
def poll(self, context):
rd = context.scene.render_data
return (context.object) and (not rd.use_game_engine)
class PHYSICS_PT_field(PhysicButtonsPanel):
bl_label = "Force Fields"
def draw(self, context):
layout = self.layout
ob = context.object
field = ob.field
split = layout.split(percentage=0.2)
split.itemL(text="Type:")
split.itemR(field, "type", text="")
if field.type not in ('NONE', 'GUIDE', 'TEXTURE'):
split = layout.split(percentage=0.2)
#split = layout.row()
split.itemL(text="Shape:")
split.itemR(field, "shape", text="")
split = layout.split()
if field.type == 'NONE':
return # nothing to draw
elif field.type == 'GUIDE':
col = split.column()
col.itemR(field, "guide_minimum")
col.itemR(field, "guide_free")
col.itemR(field, "falloff_power")
col.itemR(field, "guide_path_add")
col = split.column()
col.itemL(text="Clumping:")
col.itemR(field, "guide_clump_amount")
col.itemR(field, "guide_clump_shape")
row = layout.row()
row.itemR(field, "use_max_distance")
sub = row.row()
sub.active = field.use_max_distance
sub.itemR(field, "maximum_distance")
layout.itemS()
layout.itemR(field, "guide_kink_type")
if (field.guide_kink_type != "NONE"):
layout.itemR(field, "guide_kink_axis")
flow = layout.column_flow()
flow.itemR(field, "guide_kink_frequency")
flow.itemR(field, "guide_kink_shape")
flow.itemR(field, "guide_kink_amplitude")
elif field.type == 'TEXTURE':
col = split.column()
col.itemR(field, "strength")
col.itemR(field, "texture", text="")
col.itemR(field, "texture_mode", text="")
col.itemR(field, "texture_nabla")
col = split.column()
col.itemR(field, "use_coordinates")
col.itemR(field, "root_coordinates")
col.itemR(field, "force_2d")
else:
basic_force_field_settings_ui(self, field)
if field.type not in ('NONE', 'GUIDE'):
layout.itemL(text="Falloff:")
layout.itemR(field, "falloff_type", expand=True)
basic_force_field_falloff_ui(self, field)
if field.falloff_type == 'CONE':
layout.itemS()
split = layout.split(percentage=0.35)
col = split.column()
col.itemL(text="Angular:")
col.itemR(field, "use_radial_min", text="Use Minimum")
col.itemR(field, "use_radial_max", text="Use Maximum")
col = split.column()
col.itemR(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
sub.itemR(field, "radial_minimum", text="Angle")
sub = col.column()
sub.active = field.use_radial_max
sub.itemR(field, "radial_maximum", text="Angle")
elif field.falloff_type == 'TUBE':
layout.itemS()
split = layout.split(percentage=0.35)
col = split.column()
col.itemL(text="Radial:")
col.itemR(field, "use_radial_min", text="Use Minimum")
col.itemR(field, "use_radial_max", text="Use Maximum")
col = split.column()
col.itemR(field, "radial_falloff", text="Power")
sub = col.column()
sub.active = field.use_radial_min
sub.itemR(field, "radial_minimum", text="Distance")
sub = col.column()
sub.active = field.use_radial_max
sub.itemR(field, "radial_maximum", text="Distance")
class PHYSICS_PT_collision(PhysicButtonsPanel):
bl_label = "Collision"
#bl_default_closed = True
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
def draw(self, context):
layout = self.layout
md = context.collision
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
col = split.column()
#row = split.row(align=True)
#row.itemR(md, "render", text="")
#row.itemR(md, "realtime", text="")
coll = md.settings
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'COLLISION', text="Add")
split.itemL()
coll = None
if coll:
settings = context.object.collision
layout.active = settings.enabled
split = layout.split()
col = split.column()
col.itemL(text="Particle:")
col.itemR(settings, "permeability", slider=True)
col.itemL(text="Particle Damping:")
sub = col.column(align=True)
sub.itemR(settings, "damping_factor", text="Factor", slider=True)
sub.itemR(settings, "random_damping", text="Random", slider=True)
col.itemL(text="Soft Body and Cloth:")
sub = col.column(align=True)
sub.itemR(settings, "outer_thickness", text="Outer", slider=True)
sub.itemR(settings, "inner_thickness", text="Inner", slider=True)
layout.itemL(text="Force Fields:")
layout.itemR(settings, "absorption", text="Absorption")
col = split.column()
col.itemL(text="")
col.itemR(settings, "kill_particles")
col.itemL(text="Particle Friction:")
sub = col.column(align=True)
sub.itemR(settings, "friction_factor", text="Factor", slider=True)
sub.itemR(settings, "random_friction", text="Random", slider=True)
col.itemL(text="Soft Body Damping:")
col.itemR(settings, "damping", text="Factor", slider=True)
bpy.types.register(PHYSICS_PT_field)
bpy.types.register(PHYSICS_PT_collision)

View File

@@ -0,0 +1,280 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_fluid(PhysicButtonsPanel):
bl_label = "Fluid"
def draw(self, context):
layout = self.layout
md = context.fluid
ob = context.object
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
fluid = md.settings
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add")
split.itemL()
fluid = None
if fluid:
layout.itemR(fluid, "type")
if fluid.type == 'DOMAIN':
layout.itemO("fluid.bake", text="Bake Fluid Simulation", icon='ICON_MOD_FLUIDSIM')
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(fluid, "resolution", text="Final")
col.itemL(text="Render Display:")
col.itemR(fluid, "render_display_mode", text="")
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(fluid, "start_time", text="Start")
sub.itemR(fluid, "end_time", text="End")
col = split.column()
col.itemL(text="Required Memory: " + fluid.memory_estimate)
col.itemR(fluid, "preview_resolution", text="Preview")
col.itemL(text="Viewport Display:")
col.itemR(fluid, "viewport_display_mode", text="")
col.itemL()
col.itemR(fluid, "generate_speed_vectors")
col.itemR(fluid, "reverse_frames")
layout.itemR(fluid, "path", text="")
elif fluid.type == 'FLUID':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col = split.column()
col.itemL(text="Initial Velocity:")
col.itemR(fluid, "initial_velocity", text="")
elif fluid.type == 'OBSTACLE':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col = split.column()
col.itemL(text="Slip Type:")
col.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
col.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
col.itemL(text="Impact:")
col.itemR(fluid, "impact_factor", text="Factor")
elif fluid.type == 'INFLOW':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
col.itemR(fluid, "local_coordinates")
col = split.column()
col.itemL(text="Inflow Velocity:")
col.itemR(fluid, "inflow_velocity", text="")
elif fluid.type == 'OUTFLOW':
split = layout.split()
col = split.column()
col.itemL(text="Volume Initialization:")
col.itemR(fluid, "volume_initialization", text="")
col.itemR(fluid, "export_animated_mesh")
split.column()
elif fluid.type == 'PARTICLE':
split = layout.split(percentage=0.5)
col = split.column()
col.itemL(text="Influence:")
col.itemR(fluid, "particle_influence", text="Size")
col.itemR(fluid, "alpha_influence", text="Alpha")
col = split.column()
col.itemL(text="Type:")
col.itemR(fluid, "drops")
col.itemR(fluid, "floats")
col = split.column()
col.itemL()
col.itemR(fluid, "tracer")
layout.itemR(fluid, "path", text="")
elif fluid.type == 'CONTROL':
split = layout.split()
col = split.column()
col.itemL(text="")
col.itemR(fluid, "quality", slider=True)
col.itemR(fluid, "reverse_frames")
col = split.column()
col.itemL(text="Time:")
sub = col.column(align=True)
sub.itemR(fluid, "start_time", text="Start")
sub.itemR(fluid, "end_time", text="End")
split = layout.split()
col = split.column()
col.itemL(text="Attraction Force:")
sub = col.column(align=True)
sub.itemR(fluid, "attraction_strength", text="Strength")
sub.itemR(fluid, "attraction_radius", text="Radius")
col = split.column()
col.itemL(text="Velocity Force:")
sub = col.column(align=True)
sub.itemR(fluid, "velocity_strength", text="Strength")
sub.itemR(fluid, "velocity_radius", text="Radius")
class PHYSICS_PT_domain_gravity(PhysicButtonsPanel):
bl_label = "Domain World"
bl_default_closed = True
def poll(self, context):
md = context.fluid
return md and (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
fluid = context.fluid.settings
split = layout.split()
col = split.column()
col.itemL(text="Gravity:")
col.itemR(fluid, "gravity", text="")
col.itemL(text="Real World Size:")
col.itemR(fluid, "real_world_size", text="Metres")
col = split.column()
col.itemL(text="Viscosity Presets:")
sub = col.column(align=True)
sub.itemR(fluid, "viscosity_preset", text="")
if fluid.viscosity_preset == 'MANUAL':
sub.itemR(fluid, "viscosity_base", text="Base")
sub.itemR(fluid, "viscosity_exponent", text="Exponent", slider=True)
else:
sub.itemL()
sub.itemL()
col.itemL(text="Optimization:")
sub = col.column(align=True)
sub.itemR(fluid, "grid_levels", slider=True)
sub.itemR(fluid, "compressibility", slider=True)
class PHYSICS_PT_domain_boundary(PhysicButtonsPanel):
bl_label = "Domain Boundary"
bl_default_closed = True
def poll(self, context):
md = context.fluid
return md and (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
fluid = context.fluid.settings
split = layout.split()
col = split.column()
col.itemL(text="Slip Type:")
sub = col.column(align=True)
sub.itemR(fluid, "slip_type", text="")
if fluid.slip_type == 'PARTIALSLIP':
sub.itemR(fluid, "partial_slip_factor", slider=True, text="Amount")
col = split.column()
col.itemL(text="Surface:")
sub = col.column(align=True)
sub.itemR(fluid, "surface_smoothing", text="Smoothing")
sub.itemR(fluid, "surface_subdivisions", text="Subdivisions")
class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
bl_label = "Domain Particles"
bl_default_closed = True
def poll(self, context):
md = context.fluid
return md and (md.settings.type == 'DOMAIN')
def draw(self, context):
layout = self.layout
fluid = context.fluid.settings
col = layout.column(align=True)
col.itemR(fluid, "tracer_particles")
col.itemR(fluid, "generate_particles")
bpy.types.register(PHYSICS_PT_fluid)
bpy.types.register(PHYSICS_PT_domain_gravity)
bpy.types.register(PHYSICS_PT_domain_boundary)
bpy.types.register(PHYSICS_PT_domain_particles)

View File

@@ -0,0 +1,219 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_smoke(PhysicButtonsPanel):
bl_label = "Smoke"
def draw(self, context):
layout = self.layout
md = context.smoke
ob = context.object
split = layout.split()
split.operator_context = 'EXEC_DEFAULT'
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
split.itemL()
if md:
layout.itemR(md, "smoke_type", expand=True)
if md.smoke_type == 'TYPE_DOMAIN':
domain = md.domain_settings
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(domain, "maxres", text="Divisions")
col = split.column()
col.itemL(text="Behavior:")
col.itemR(domain, "alpha")
col.itemR(domain, "beta")
col.itemR(domain, "dissolve_smoke", text="Dissolve")
sub = col.column()
sub.active = domain.dissolve_smoke
sub.itemR(domain, "dissolve_speed", text="Time")
sub.itemR(domain, "dissolve_smoke_log", text="Slow")
elif md.smoke_type == 'TYPE_FLOW':
flow = md.flow_settings
split = layout.split()
col = split.column()
col.itemR(flow, "outflow")
col.itemL(text="Particle System:")
col.item_pointerR(flow, "psys", ob, "particle_systems", text="")
if md.flow_settings.outflow:
col = split.column()
else:
col = split.column()
col.itemL(text="Behavior:")
col.itemR(flow, "temperature")
col.itemR(flow, "density")
#elif md.smoke_type == 'TYPE_COLL':
# layout.itemS()
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
bl_label = "Smoke Groups"
bl_default_closed = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
layout = self.layout
group = context.smoke.domain_settings
split = layout.split()
col = split.column()
col.itemL(text="Flow Group:")
col.itemR(group, "fluid_group", text="")
#col.itemL(text="Effector Group:")
#col.itemR(group, "eff_group", text="")
col = split.column()
col.itemL(text="Collision Group:")
col.itemR(group, "coll_group", text="")
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
bl_label = "Smoke Cache"
bl_default_closed = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
cache = md.point_cache_low
point_cache_ui(self, cache, cache.baked == False, 0, 1)
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
bl_label = "Smoke High Resolution"
bl_default_closed = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw_header(self, context):
high = context.smoke.domain_settings
self.layout.itemR(high, "highres", text="")
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
split = layout.split()
col = split.column()
col.itemL(text="Resolution:")
col.itemR(md, "amplify", text="Divisions")
col = split.column()
col.itemL(text="Noise Method:")
col.row().itemR(md, "noise_type", text="")
col.itemR(md, "strength")
col.itemR(md, "viewhighres")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
bl_label = "Smoke High Resolution Cache"
bl_default_closed = True
def poll(self, context):
md = context.smoke
return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
cache = md.point_cache_high
point_cache_ui(self, cache, cache.baked == False, 0, 1)
class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel):
bl_label = "Smoke Field Weights"
bl_default_closed = True
def poll(self, context):
smoke = context.smoke
return (smoke and smoke.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
domain = context.smoke.domain_settings
effector_weights_ui(self, domain.effector_weights)
bpy.types.register(PHYSICS_PT_smoke)
bpy.types.register(PHYSICS_PT_smoke_field_weights)
bpy.types.register(PHYSICS_PT_smoke_cache)
bpy.types.register(PHYSICS_PT_smoke_highres)
bpy.types.register(PHYSICS_PT_smoke_groups)
bpy.types.register(PHYSICS_PT_smoke_cache_highres)

View File

@@ -0,0 +1,272 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from properties_physics_common import point_cache_ui
from properties_physics_common import effector_weights_ui
def softbody_panel_enabled(md):
return md.point_cache.baked == False
class PhysicButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
def poll(self, context):
ob = context.object
rd = context.scene.render_data
return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
class PHYSICS_PT_softbody(PhysicButtonsPanel):
bl_label = "Soft Body"
def draw(self, context):
layout = self.layout
md = context.soft_body
ob = context.object
split = layout.split()
split.operator_context = "EXEC_DEFAULT"
if md:
# remove modifier + settings
split.set_context_pointer("modifier", md)
split.itemO("object.modifier_remove", text="Remove")
row = split.row(align=True)
row.itemR(md, "render", text="")
row.itemR(md, "realtime", text="")
else:
# add modifier
split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add")
split.itemL("")
if md:
softbody = md.settings
# General
split = layout.split()
split.enabled = softbody_panel_enabled(md)
col = split.column()
col.itemL(text="Object:")
col.itemR(softbody, "mass")
col.itemR(softbody, "friction")
col = split.column()
col.itemL(text="Simulation:")
col.itemR(softbody, "speed")
class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
bl_label = "Soft Body Cache"
bl_default_closed = True
def poll(self, context):
return context.soft_body
def draw(self, context):
md = context.soft_body
point_cache_ui(self, md.point_cache, softbody_panel_enabled(md), 0, 0)
class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
bl_label = "Soft Body Goal"
bl_default_closed = True
def poll(self, context):
return context.soft_body
def draw_header(self, context):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
self.layout.itemR(softbody, "use_goal", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody.use_goal and softbody_panel_enabled(md)
split = layout.split()
# Goal
split = layout.split()
col = split.column()
col.itemL(text="Goal Strengths:")
col.itemR(softbody, "goal_default", text="Default")
sub = col.column(align=True)
sub.itemR(softbody, "goal_min", text="Minimum")
sub.itemR(softbody, "goal_max", text="Maximum")
col = split.column()
col.itemL(text="Goal Settings:")
col.itemR(softbody, "goal_spring", text="Stiffness")
col.itemR(softbody, "goal_friction", text="Damping")
layout.item_pointerR(softbody, "goal_vertex_group", ob, "vertex_groups", text="Vertex Group")
class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
bl_label = "Soft Body Edges"
bl_default_closed = True
def poll(self, context):
return context.soft_body
def draw_header(self, context):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
self.layout.itemR(softbody, "use_edges", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody.use_edges and softbody_panel_enabled(md)
split = layout.split()
col = split.column()
col.itemL(text="Springs:")
col.itemR(softbody, "pull")
col.itemR(softbody, "push")
col.itemR(softbody, "damp")
col.itemR(softbody, "plastic")
col.itemR(softbody, "bending")
col.itemR(softbody, "spring_length", text="Length")
col = split.column()
col.itemR(softbody, "stiff_quads")
sub = col.column()
sub.active = softbody.stiff_quads
sub.itemR(softbody, "shear")
col.itemR(softbody, "new_aero", text="Aero")
sub = col.column()
sub.enabled = softbody.new_aero
sub.itemR(softbody, "aero", text="Factor")
col.itemL(text="Collision:")
col.itemR(softbody, "edge_collision", text="Edge")
col.itemR(softbody, "face_collision", text="Face")
class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
bl_label = "Soft Body Collision"
bl_default_closed = True
def poll(self, context):
return context.soft_body
def draw_header(self, context):
softbody = context.soft_body.settings
self.layout.active = softbody_panel_enabled(context.soft_body)
self.layout.itemR(softbody, "self_collision", text="")
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody.self_collision and softbody_panel_enabled(md)
layout.itemL(text="Collision Type:")
layout.itemR(softbody, "collision_type", expand=True)
col = layout.column(align=True)
col.itemL(text="Ball:")
col.itemR(softbody, "ball_size", text="Size")
col.itemR(softbody, "ball_stiff", text="Stiffness")
col.itemR(softbody, "ball_damp", text="Dampening")
class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
bl_label = "Soft Body Solver"
bl_default_closed = True
def poll(self, context):
return context.soft_body
def draw(self, context):
layout = self.layout
md = context.soft_body
softbody = md.settings
ob = context.object
layout.active = softbody_panel_enabled(md)
# Solver
split = layout.split()
col = split.column(align=True)
col.itemL(text="Step Size:")
col.itemR(softbody, "minstep")
col.itemR(softbody, "maxstep")
col.itemR(softbody, "auto_step", text="Auto-Step")
col = split.column()
col.itemR(softbody, "error_limit")
col.itemL(text="Helpers:")
col.itemR(softbody, "choke")
col.itemR(softbody, "fuzzy")
layout.itemL(text="Diagnostics:")
layout.itemR(softbody, "diagnose")
class PHYSICS_PT_softbody_field_weights(PhysicButtonsPanel):
bl_label = "Soft Body Field Weights"
bl_default_closed = True
def poll(self, context):
return (context.soft_body)
def draw(self, context):
md = context.soft_body
softbody = md.settings
effector_weights_ui(self, softbody.effector_weights)
bpy.types.register(PHYSICS_PT_softbody)
bpy.types.register(PHYSICS_PT_softbody_cache)
bpy.types.register(PHYSICS_PT_softbody_goal)
bpy.types.register(PHYSICS_PT_softbody_edge)
bpy.types.register(PHYSICS_PT_softbody_collision)
bpy.types.register(PHYSICS_PT_softbody_solver)
bpy.types.register(PHYSICS_PT_softbody_field_weights)

View File

@@ -0,0 +1,483 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class RenderButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "render"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
rd = context.scene.render_data
return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
class RENDER_PT_render(RenderButtonsPanel):
bl_label = "Render"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
row = layout.row()
row.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
layout.itemR(rd, "display_mode", text="Display")
class RENDER_PT_layers(RenderButtonsPanel):
bl_label = "Layers"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render_data
row = layout.row()
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
col = row.column(align=True)
col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
rl = rd.layers[rd.active_layer_index]
if rl:
layout.itemR(rl, "name")
split = layout.split()
col = split.column()
col.itemR(scene, "visible_layers", text="Scene")
col = split.column()
col.itemR(rl, "visible_layers", text="Layer")
layout.itemR(rl, "light_override", text="Light")
layout.itemR(rl, "material_override", text="Material")
layout.itemS()
layout.itemL(text="Include:")
split = layout.split()
col = split.column()
col.itemR(rl, "zmask")
row = col.row()
row.itemR(rl, "zmask_negate", text="Negate")
row.active = rl.zmask
col.itemR(rl, "all_z")
col = split.column()
col.itemR(rl, "solid")
col.itemR(rl, "halo")
col.itemR(rl, "ztransp")
col = split.column()
col.itemR(rl, "sky")
col.itemR(rl, "edge")
col.itemR(rl, "strand")
if rl.zmask:
split = layout.split()
split.itemL(text="Zmask Layers:")
split.column().itemR(rl, "zmask_layers", text="")
layout.itemS()
split = layout.split()
col = split.column()
col.itemL(text="Passes:")
col.itemR(rl, "pass_combined")
col.itemR(rl, "pass_z")
col.itemR(rl, "pass_vector")
col.itemR(rl, "pass_normal")
col.itemR(rl, "pass_uv")
col.itemR(rl, "pass_mist")
col.itemR(rl, "pass_object_index")
col = split.column()
col.itemL()
col.itemR(rl, "pass_color")
col.itemR(rl, "pass_diffuse")
row = col.row()
row.itemR(rl, "pass_specular")
row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_shadow")
row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_ao")
row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_reflection")
row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
row = col.row()
row.itemR(rl, "pass_refraction")
row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
class RENDER_PT_shading(RenderButtonsPanel):
bl_label = "Shading"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column()
col.itemR(rd, "render_textures", text="Textures")
col.itemR(rd, "render_shadows", text="Shadows")
col.itemR(rd, "render_sss", text="Subsurface Scattering")
col.itemR(rd, "render_envmaps", text="Environment Map")
col = split.column()
col.itemR(rd, "render_raytracing", text="Ray Tracing")
col.itemR(rd, "color_management")
col.itemR(rd, "alpha_mode", text="Alpha")
class RENDER_PT_performance(RenderButtonsPanel):
bl_label = "Performance"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column(align=True)
col.itemL(text="Threads:")
col.row().itemR(rd, "threads_mode", expand=True)
sub = col.column()
sub.enabled = rd.threads_mode == 'THREADS_FIXED'
sub.itemR(rd, "threads")
col.itemL(text="Tiles:")
col.itemR(rd, "parts_x", text="X")
col.itemR(rd, "parts_y", text="Y")
col = split.column()
col.itemL(text="Memory:")
sub = col.column()
sub.itemR(rd, "save_buffers")
sub.enabled = not rd.full_sample
sub = col.column()
sub.active = rd.use_compositing
sub.itemR(rd, "free_image_textures")
sub = col.column()
sub.active = rd.render_raytracing
sub.itemL(text="Acceleration structure:")
sub.itemR(rd, "raytrace_structure", text="")
if rd.raytrace_structure == "OCTREE":
sub.itemR(rd, "octree_resolution", text="Resolution")
else:
sub.itemR(rd, "use_instances", text="Instances")
sub.itemR(rd, "use_local_coords", text="Local Coordinates")
class RENDER_PT_post_processing(RenderButtonsPanel):
bl_label = "Post Processing"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
col = split.column()
col.itemR(rd, "use_compositing")
col.itemR(rd, "use_sequencer")
col = split.column()
col.itemR(rd, "dither_intensity", text="Dither", slider=True)
layout.itemS()
split = layout.split()
col = split.column()
col.itemR(rd, "fields", text="Fields")
sub = col.column()
sub.active = rd.fields
sub.row().itemR(rd, "field_order", expand=True)
sub.itemR(rd, "fields_still", text="Still")
col = split.column()
col.itemR(rd, "edge")
sub = col.column()
sub.active = rd.edge
sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
sub.itemR(rd, "edge_color", text="")
class RENDER_PT_output(RenderButtonsPanel):
bl_label = "Output"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.itemR(rd, "output_path", text="")
split = layout.split()
col = split.column()
col.itemR(rd, "file_format", text="")
col.row().itemR(rd, "color_mode", text="Color", expand=True)
col = split.column()
col.itemR(rd, "file_extensions")
col.itemR(rd, "use_overwrite")
col.itemR(rd, "use_placeholder")
if rd.file_format in ('AVIJPEG', 'JPEG'):
split = layout.split()
split.itemR(rd, "quality", slider=True)
elif rd.file_format == 'OPENEXR':
split = layout.split()
col = split.column()
col.itemL(text="Codec:")
col.itemR(rd, "exr_codec", text="")
subsplit = split.split()
col = subsplit.column()
col.itemR(rd, "exr_half")
col.itemR(rd, "exr_zbuf")
col = subsplit.column()
col.itemR(rd, "exr_preview")
elif rd.file_format == 'JPEG2000':
split = layout.split()
col = split.column()
col.itemL(text="Depth:")
col.row().itemR(rd, "jpeg2k_depth", expand=True)
col = split.column()
col.itemR(rd, "jpeg2k_preset", text="")
col.itemR(rd, "jpeg2k_ycc")
elif rd.file_format in ('CINEON', 'DPX'):
split = layout.split()
col = split.column()
col.itemR(rd, "cineon_log", text="Convert to Log")
col = split.column(align=True)
col.active = rd.cineon_log
col.itemR(rd, "cineon_black", text="Black")
col.itemR(rd, "cineon_white", text="White")
col.itemR(rd, "cineon_gamma", text="Gamma")
elif rd.file_format == 'TIFF':
split = layout.split()
split.itemR(rd, "tiff_bit")
class RENDER_PT_encoding(RenderButtonsPanel):
bl_label = "Encoding"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
rd = context.scene.render_data
return rd.file_format in ('FFMPEG', 'XVID', 'H264', 'THEORA')
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
split = layout.split()
split.itemR(rd, "ffmpeg_format")
if rd.ffmpeg_format in ('AVI', 'QUICKTIME', 'MKV', 'OGG'):
split.itemR(rd, "ffmpeg_codec")
else:
split.itemL()
split = layout.split()
col = split.column()
col.itemR(rd, "ffmpeg_video_bitrate")
col.itemL(text="Rate:")
col.itemR(rd, "ffmpeg_minrate", text="Minimum")
col.itemR(rd, "ffmpeg_maxrate", text="Maximum")
col.itemR(rd, "ffmpeg_buffersize", text="Buffer")
col = split.column()
col.itemR(rd, "ffmpeg_gopsize")
col.itemR(rd, "ffmpeg_autosplit")
col.itemL(text="Mux:")
col.itemR(rd, "ffmpeg_muxrate", text="Rate")
col.itemR(rd, "ffmpeg_packetsize", text="Packet Size")
row = layout.row()
row.itemL(text="Audio:")
row = layout.row()
row.itemR(rd, "ffmpeg_audio_codec")
split = layout.split()
col = split.column()
col.itemR(rd, "ffmpeg_audio_bitrate")
col.itemR(rd, "ffmpeg_audio_mixrate")
col = split.column()
col.itemR(rd, "ffmpeg_multiplex_audio")
col.itemR(rd, "ffmpeg_audio_volume")
class RENDER_PT_antialiasing(RenderButtonsPanel):
bl_label = "Anti-Aliasing"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
rd = context.scene.render_data
self.layout.itemR(rd, "antialiasing", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.active = rd.antialiasing
split = layout.split()
col = split.column()
col.row().itemR(rd, "antialiasing_samples", expand=True)
col.itemR(rd, "full_sample")
col = split.column()
col.itemR(rd, "pixel_filter", text="")
col.itemR(rd, "filter_size", text="Size", slider=True)
class RENDER_PT_dimensions(RenderButtonsPanel):
bl_label = "Dimensions"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render_data
split = layout.split()
col = split.column()
sub = col.column(align=True)
sub.itemL(text="Resolution:")
sub.itemR(rd, "resolution_x", text="X")
sub.itemR(rd, "resolution_y", text="Y")
sub.itemR(rd, "resolution_percentage", text="")
sub.itemL(text="Aspect Ratio:")
sub.itemR(rd, "pixel_aspect_x", text="X")
sub.itemR(rd, "pixel_aspect_y", text="Y")
row = col.row()
row.itemR(rd, "use_border", text="Border")
rowsub = row.row()
rowsub.active = rd.use_border
rowsub.itemR(rd, "crop_to_border", text="Crop")
col = split.column(align=True)
col.itemL(text="Frame Range:")
col.itemR(scene, "start_frame", text="Start")
col.itemR(scene, "end_frame", text="End")
col.itemR(scene, "frame_step", text="Step")
col.itemL(text="Frame Rate:")
col.itemR(rd, "fps")
col.itemR(rd, "fps_base", text="/")
class RENDER_PT_stamp(RenderButtonsPanel):
bl_label = "Stamp"
bl_default_closed = True
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
rd = context.scene.render_data
self.layout.itemR(rd, "render_stamp", text="")
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
layout.active = rd.render_stamp
split = layout.split()
col = split.column()
col.itemR(rd, "stamp_time", text="Time")
col.itemR(rd, "stamp_date", text="Date")
col.itemR(rd, "stamp_render_time", text="RenderTime")
col.itemR(rd, "stamp_frame", text="Frame")
col.itemR(rd, "stamp_scene", text="Scene")
col.itemR(rd, "stamp_camera", text="Camera")
col.itemR(rd, "stamp_filename", text="Filename")
col.itemR(rd, "stamp_marker", text="Marker")
col.itemR(rd, "stamp_sequence_strip", text="Seq. Strip")
col = split.column()
col.active = rd.render_stamp
col.itemR(rd, "stamp_foreground", slider=True)
col.itemR(rd, "stamp_background", slider=True)
col.itemR(rd, "stamp_font_size", text="Font Size")
row = layout.split(percentage=0.2)
row.itemR(rd, "stamp_note", text="Note")
sub = row.row()
sub.active = rd.stamp_note
sub.itemR(rd, "stamp_note_text", text="")
bpy.types.register(RENDER_PT_render)
bpy.types.register(RENDER_PT_layers)
bpy.types.register(RENDER_PT_dimensions)
bpy.types.register(RENDER_PT_antialiasing)
bpy.types.register(RENDER_PT_shading)
bpy.types.register(RENDER_PT_output)
bpy.types.register(RENDER_PT_encoding)
bpy.types.register(RENDER_PT_performance)
bpy.types.register(RENDER_PT_post_processing)
bpy.types.register(RENDER_PT_stamp)

View File

@@ -0,0 +1,161 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class SceneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "scene"
def poll(self, context):
return context.scene
class SCENE_PT_scene(SceneButtonsPanel):
bl_label = "Scene"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
scene = context.scene
layout.itemR(scene, "camera")
layout.itemR(scene, "set", text="Background")
class SCENE_PT_unit(SceneButtonsPanel):
bl_label = "Units"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
unit = context.scene.unit_settings
col = layout.column()
col.row().itemR(unit, "system", expand=True)
row = layout.row()
row.active = (unit.system != 'NONE')
row.itemR(unit, "scale_length", text="Scale")
row.itemR(unit, "use_separate")
class SCENE_PT_keying_sets(SceneButtonsPanel):
bl_label = "Keying Sets"
def draw(self, context):
layout = self.layout
scene = context.scene
row = layout.row()
col = row.column()
col.template_list(scene, "keying_sets", scene, "active_keying_set_index", rows=2)
col = row.column(align=True)
col.itemO("anim.keying_set_add", icon='ICON_ZOOMIN', text="")
col.itemO("anim.keying_set_remove", icon='ICON_ZOOMOUT', text="")
ks = scene.active_keying_set
if ks:
row = layout.row()
col = row.column()
col.itemR(ks, "name")
col.itemR(ks, "absolute")
col = row.column()
col.itemL(text="Keyframing Settings:")
col.itemR(ks, "insertkey_needed", text="Needed")
col.itemR(ks, "insertkey_visual", text="Visual")
class SCENE_PT_keying_set_paths(SceneButtonsPanel):
bl_label = "Active Keying Set"
def poll(self, context):
return (context.scene != None) and (context.scene.active_keying_set != None)
def draw(self, context):
layout = self.layout
scene = context.scene
ks = scene.active_keying_set
row = layout.row()
row.itemL(text="Paths:")
row = layout.row()
col = row.column()
col.template_list(ks, "paths", ks, "active_path_index", rows=2)
col = row.column(align=True)
col.itemO("anim.keying_set_path_add", icon='ICON_ZOOMIN', text="")
col.itemO("anim.keying_set_path_remove", icon='ICON_ZOOMOUT', text="")
ksp = ks.active_path
if ksp:
col = layout.column()
col.itemL(text="Target:")
col.template_any_ID(ksp, "id", "id_type")
col.template_path_builder(ksp, "rna_path", ksp.id)
row = layout.row()
col = row.column()
col.itemL(text="Array Target:")
col.itemR(ksp, "entire_array")
if ksp.entire_array == False:
col.itemR(ksp, "array_index")
col = row.column()
col.itemL(text="F-Curve Grouping:")
col.itemR(ksp, "grouping")
if ksp.grouping == 'NAMED':
col.itemR(ksp, "group")
class SCENE_PT_physics(SceneButtonsPanel):
bl_label = "Gravity"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
self.layout.itemR(context.scene, "use_gravity", text="")
def draw(self, context):
layout = self.layout
scene = context.scene
layout.active = scene.use_gravity
layout.itemR(scene, "gravity", text="")
bpy.types.register(SCENE_PT_scene)
bpy.types.register(SCENE_PT_unit)
bpy.types.register(SCENE_PT_keying_sets)
bpy.types.register(SCENE_PT_keying_set_paths)
bpy.types.register(SCENE_PT_physics)

View File

@@ -0,0 +1,841 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
def active_node_mat(mat):
if mat:
mat_node = mat.active_node_material
if mat_node:
return mat_node
else:
return mat
return None
def context_tex_datablock(context):
idblock = active_node_mat(context.material)
if idblock:
return idblock
idblock = context.lamp
if idblock:
return idblock
idblock = context.world
if idblock:
return idblock
idblock = context.brush
return idblock
class TextureButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "texture"
def poll(self, context):
tex = context.texture
return (tex and (tex.type != 'NONE' or tex.use_nodes))
class TEXTURE_PT_preview(TextureButtonsPanel):
bl_label = "Preview"
def draw(self, context):
layout = self.layout
tex = context.texture
slot = context.texture_slot
idblock = context_tex_datablock(context)
if idblock:
layout.template_preview(tex, parent=idblock, slot=slot)
else:
layout.template_preview(tex, slot=slot)
class TEXTURE_PT_context_texture(TextureButtonsPanel):
bl_label = ""
bl_show_header = False
def poll(self, context):
return (context.material or context.world or context.lamp or context.brush or context.texture)
def draw(self, context):
layout = self.layout
tex = context.texture
idblock = context_tex_datablock(context)
space = context.space_data
if idblock:
row = layout.row()
row.template_list(idblock, "textures", idblock, "active_texture_index", rows=2)
col = row.column(align=True)
col.item_enumO("texture.slot_move", "type", 'UP', text="", icon='ICON_TRIA_UP')
col.item_enumO("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN')
split = layout.split(percentage=0.65)
if idblock:
split.template_ID(idblock, "active_texture", new="texture.new")
elif tex:
split.template_ID(space, "pin_id")
if (not space.pin_id) and (
context.sculpt_object or
context.vertex_paint_object or
context.weight_paint_object or
context.texture_paint_object):
split.itemR(space, "brush_texture", text="Brush", toggle=True)
if tex:
layout.itemR(tex, "use_nodes")
split = layout.split(percentage=0.2)
if tex.use_nodes:
slot = context.texture_slot
if slot:
split.itemL(text="Output:")
split.itemR(slot, "output_node", text="")
else:
split.itemL(text="Type:")
split.itemR(tex, "type", text="")
class TEXTURE_PT_colors(TextureButtonsPanel):
bl_label = "Colors"
bl_default_closed = True
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "use_color_ramp", text="Ramp")
if tex.use_color_ramp:
layout.template_color_ramp(tex, "color_ramp", expand=True)
split = layout.split()
col = split.column()
col.itemL(text="RGB Multiply:")
sub = col.column(align=True)
sub.itemR(tex, "factor_red", text="R")
sub.itemR(tex, "factor_green", text="G")
sub.itemR(tex, "factor_blue", text="B")
col = split.column()
col.itemL(text="Adjust:")
col.itemR(tex, "brightness")
col.itemR(tex, "contrast")
# Texture Slot Panels #
class TextureSlotPanel(TextureButtonsPanel):
def poll(self, context):
return (context.texture_slot and
TextureButtonsPanel.poll(self, context))
class TEXTURE_PT_mapping(TextureSlotPanel):
bl_label = "Mapping"
def draw(self, context):
layout = self.layout
idblock = context_tex_datablock(context)
tex = context.texture_slot
textype = context.texture
if type(idblock) != bpy.types.Brush:
split = layout.split(percentage=0.3)
col = split.column()
col.itemL(text="Coordinates:")
col = split.column()
col.itemR(tex, "texture_coordinates", text="")
if tex.texture_coordinates == 'ORCO':
"""
ob = context.object
if ob and ob.type == 'MESH':
split = layout.split(percentage=0.3)
split.itemL(text="Mesh:")
split.itemR(ob.data, "texco_mesh", text="")
"""
elif tex.texture_coordinates == 'UV':
split = layout.split(percentage=0.3)
split.itemL(text="Layer:")
ob = context.object
if ob and ob.type == 'MESH':
split.item_pointerR(tex, "uv_layer", ob.data, "uv_textures", text="")
else:
split.itemR(tex, "uv_layer", text="")
elif tex.texture_coordinates == 'OBJECT':
split = layout.split(percentage=0.3)
split.itemL(text="Object:")
split.itemR(tex, "object", text="")
if type(idblock) == bpy.types.Brush:
layout.itemR(tex, "map_mode", expand=True)
row = layout.row()
row.active = tex.map_mode in ('FIXED', 'TILED')
row.itemR(tex, "angle")
row = layout.row()
row.active = tex.map_mode in ('TILED', '3D')
row.column().itemR(tex, "size")
else:
if type(idblock) == bpy.types.Material:
split = layout.split(percentage=0.3)
split.itemL(text="Projection:")
split.itemR(tex, "mapping", text="")
split = layout.split()
col = split.column()
if tex.texture_coordinates in ('ORCO', 'UV'):
col.itemR(tex, "from_dupli")
elif tex.texture_coordinates == 'OBJECT':
col.itemR(tex, "from_original")
else:
col.itemL()
col = split.column()
row = col.row()
row.itemR(tex, "x_mapping", text="")
row.itemR(tex, "y_mapping", text="")
row.itemR(tex, "z_mapping", text="")
# any non brush
row = layout.row()
row.column().itemR(tex, "offset")
row.column().itemR(tex, "size")
class TEXTURE_PT_influence(TextureSlotPanel):
bl_label = "Influence"
def poll(self, context):
return context.texture_slot
def draw(self, context):
layout = self.layout
idblock = context_tex_datablock(context)
textype = context.texture
tex = context.texture_slot
def factor_but(layout, active, toggle, factor, name):
row = layout.row(align=True)
row.itemR(tex, toggle, text="")
sub = row.row()
sub.active = active
sub.itemR(tex, factor, text=name, slider=True)
if type(idblock) == bpy.types.Material:
if idblock.type in ('SURFACE', 'HALO', 'WIRE'):
split = layout.split()
col = split.column()
col.itemL(text="Diffuse:")
factor_but(col, tex.map_diffuse, "map_diffuse", "diffuse_factor", "Intensity")
factor_but(col, tex.map_colordiff, "map_colordiff", "colordiff_factor", "Color")
factor_but(col, tex.map_alpha, "map_alpha", "alpha_factor", "Alpha")
factor_but(col, tex.map_translucency, "map_translucency", "translucency_factor", "Translucency")
col.itemL(text="Specular:")
factor_but(col, tex.map_specular, "map_specular", "specular_factor", "Intensity")
factor_but(col, tex.map_colorspec, "map_colorspec", "colorspec_factor", "Color")
factor_but(col, tex.map_hardness, "map_hardness", "hardness_factor", "Hardness")
col = split.column()
col.itemL(text="Shading:")
factor_but(col, tex.map_ambient, "map_ambient", "ambient_factor", "Ambient")
factor_but(col, tex.map_emit, "map_emit", "emit_factor", "Emit")
factor_but(col, tex.map_mirror, "map_mirror", "mirror_factor", "Mirror")
factor_but(col, tex.map_raymir, "map_raymir", "raymir_factor", "Ray Mirror")
col.itemL(text="Geometry:")
factor_but(col, tex.map_normal, "map_normal", "normal_factor", "Normal")
factor_but(col, tex.map_warp, "map_warp", "warp_factor", "Warp")
factor_but(col, tex.map_displacement, "map_displacement", "displacement_factor", "Displace")
#sub = col.column()
#sub.active = tex.map_translucency or tex.map_emit or tex.map_alpha or tex.map_raymir or tex.map_hardness or tex.map_ambient or tex.map_specularity or tex.map_reflection or tex.map_mirror
#sub.itemR(tex, "default_value", text="Amount", slider=True)
elif idblock.type == 'VOLUME':
split = layout.split()
col = split.column()
factor_but(col, tex.map_density, "map_density", "density_factor", "Density")
factor_but(col, tex.map_emission, "map_emission", "emission_factor", "Emission")
factor_but(col, tex.map_scattering, "map_scattering", "scattering_factor", "Scattering")
factor_but(col, tex.map_reflection, "map_reflection", "reflection_factor", "Reflection")
col = split.column()
col.itemL(text=" ")
factor_but(col, tex.map_alpha, "map_coloremission", "coloremission_factor", "Emission Color")
factor_but(col, tex.map_colortransmission, "map_colortransmission", "colortransmission_factor", "Transmission Color")
factor_but(col, tex.map_colorreflection, "map_colorreflection", "colorreflection_factor", "Reflection Color")
elif type(idblock) == bpy.types.Lamp:
row = layout.row()
factor_but(row, tex.map_color, "map_color", "color_factor", "Color")
factor_but(row, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
elif type(idblock) == bpy.types.World:
split = layout.split()
col = split.column()
factor_but(col, tex.map_blend, "map_blend", "blend_factor", "Blend")
factor_but(col, tex.map_horizon, "map_horizon", "horizon_factor", "Horizon")
col = split.column()
factor_but(col, tex.map_zenith_up, "map_zenith_up", "zenith_up_factor", "Zenith Up")
factor_but(col, tex.map_zenith_down, "map_zenith_down", "zenith_down_factor", "Zenith Down")
layout.itemS()
split = layout.split()
col = split.column()
col.itemR(tex, "blend_type", text="Blend")
col.itemR(tex, "rgb_to_intensity")
sub = col.column()
sub.active = tex.rgb_to_intensity
sub.itemR(tex, "color", text="")
col = split.column()
col.itemR(tex, "negate", text="Negative")
col.itemR(tex, "stencil")
if type(idblock) in (bpy.types.Material, bpy.types.World):
col.itemR(tex, "default_value", text="DVar", slider=True)
# Texture Type Panels #
class TextureTypePanel(TextureButtonsPanel):
def poll(self, context):
tex = context.texture
return (tex and tex.type == self.tex_type and not tex.use_nodes)
class TEXTURE_PT_clouds(TextureTypePanel):
bl_label = "Clouds"
tex_type = 'CLOUDS'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "stype", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "noise_depth", text="Depth")
flow.itemR(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureTypePanel):
bl_label = "Wood"
tex_type = 'WOOD'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "noisebasis2", expand=True)
layout.itemR(tex, "stype", expand=True)
col = layout.column()
col.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
col.itemL(text="Noise:")
col.row().itemR(tex, "noise_type", text="Type", expand=True)
col.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
class TEXTURE_PT_marble(TextureTypePanel):
bl_label = "Marble"
tex_type = 'MARBLE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "stype", expand=True)
layout.itemR(tex, "noisebasis2", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "noise_depth", text="Depth")
flow.itemR(tex, "turbulence")
flow.itemR(tex, "nabla")
class TEXTURE_PT_magic(TextureTypePanel):
bl_label = "Magic"
tex_type = 'MAGIC'
def draw(self, context):
layout = self.layout
tex = context.texture
row = layout.row()
row.itemR(tex, "noise_depth", text="Depth")
row.itemR(tex, "turbulence")
class TEXTURE_PT_blend(TextureTypePanel):
bl_label = "Blend"
tex_type = 'BLEND'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "progression")
sub = layout.row()
sub.active = (tex.progression in ('LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'))
sub.itemR(tex, "flip_axis", expand=True)
class TEXTURE_PT_stucci(TextureTypePanel):
bl_label = "Stucci"
tex_type = 'STUCCI'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "stype", expand=True)
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_type", text="Type", expand=True)
layout.itemR(tex, "noise_basis", text="Basis")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "turbulence")
class TEXTURE_PT_image(TextureTypePanel):
bl_label = "Image"
tex_type = 'IMAGE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.template_image(tex, "image", tex.image_user)
class TEXTURE_PT_image_sampling(TextureTypePanel):
bl_label = "Image Sampling"
bl_default_closed = True
tex_type = 'IMAGE'
def draw(self, context):
layout = self.layout
tex = context.texture
slot = context.texture_slot
split = layout.split()
col = split.column()
col.itemL(text="Alpha:")
col.itemR(tex, "use_alpha", text="Use")
col.itemR(tex, "calculate_alpha", text="Calculate")
col.itemR(tex, "invert_alpha", text="Invert")
col.itemL(text="Flip:")
col.itemR(tex, "flip_axis", text="X/Y Axis")
col = split.column()
col.itemR(tex, "normal_map")
row = col.row()
row.active = tex.normal_map
row.itemR(tex, "normal_space", text="")
col.itemL(text="Filter:")
col.itemR(tex, "filter", text="")
col.itemR(tex, "filter_size")
col.itemR(tex, "filter_size_minimum")
col.itemR(tex, "mipmap")
row = col.row()
row.active = tex.mipmap
row.itemR(tex, "mipmap_gauss")
col.itemR(tex, "interpolation")
if tex.mipmap and tex.filter != 'DEFAULT':
if tex.filter == 'FELINE':
col.itemR(tex, "filter_probes", text="Probes")
else:
col.itemR(tex, "filter_eccentricity", text="Eccentricity")
class TEXTURE_PT_image_mapping(TextureTypePanel):
bl_label = "Image Mapping"
bl_default_closed = True
tex_type = 'IMAGE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "extension")
split = layout.split()
if tex.extension == 'REPEAT':
col = split.column(align=True)
col.itemL(text="Repeat:")
col.itemR(tex, "repeat_x", text="X")
col.itemR(tex, "repeat_y", text="Y")
col = split.column(align=True)
col.itemL(text="Mirror:")
col.itemR(tex, "mirror_x", text="X")
col.itemR(tex, "mirror_y", text="Y")
layout.itemS()
elif tex.extension == 'CHECKER':
col = split.column(align=True)
row = col.row()
row.itemR(tex, "checker_even", text="Even")
row.itemR(tex, "checker_odd", text="Odd")
split.itemR(tex, "checker_distance", text="Distance")
layout.itemS()
split = layout.split()
col = split.column(align=True)
#col.itemR(tex, "crop_rectangle")
col.itemL(text="Crop Minimum:")
col.itemR(tex, "crop_min_x", text="X")
col.itemR(tex, "crop_min_y", text="Y")
col = split.column(align=True)
col.itemL(text="Crop Maximum:")
col.itemR(tex, "crop_max_x", text="X")
col.itemR(tex, "crop_max_y", text="Y")
class TEXTURE_PT_plugin(TextureTypePanel):
bl_label = "Plugin"
tex_type = 'PLUGIN'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemL(text="Nothing yet")
class TEXTURE_PT_envmap(TextureTypePanel):
bl_label = "Environment Map"
tex_type = 'ENVIRONMENT_MAP'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemL(text="Nothing yet")
class TEXTURE_PT_musgrave(TextureTypePanel):
bl_label = "Musgrave"
tex_type = 'MUSGRAVE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "musgrave_type")
split = layout.split()
col = split.column()
col.itemR(tex, "highest_dimension", text="Dimension")
col.itemR(tex, "lacunarity")
col.itemR(tex, "octaves")
col = split.column()
if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
col.itemR(tex, "offset")
if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
col.itemR(tex, "gain")
col.itemR(tex, "noise_intensity", text="Intensity")
layout.itemL(text="Noise:")
layout.itemR(tex, "noise_basis", text="Basis")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
class TEXTURE_PT_voronoi(TextureTypePanel):
bl_label = "Voronoi"
tex_type = 'VORONOI'
def draw(self, context):
layout = self.layout
tex = context.texture
split = layout.split()
col = split.column()
col.itemL(text="Distance Metric:")
col.itemR(tex, "distance_metric", text="")
sub = col.column()
sub.active = tex.distance_metric == 'MINKOVSKY'
sub.itemR(tex, "minkovsky_exponent", text="Exponent")
col.itemL(text="Coloring:")
col.itemR(tex, "coloring", text="")
col.itemR(tex, "noise_intensity", text="Intensity")
col = split.column(align=True)
col.itemL(text="Feature Weights:")
col.itemR(tex, "weight_1", text="1", slider=True)
col.itemR(tex, "weight_2", text="2", slider=True)
col.itemR(tex, "weight_3", text="3", slider=True)
col.itemR(tex, "weight_4", text="4", slider=True)
layout.itemL(text="Noise:")
row = layout.row()
row.itemR(tex, "noise_size", text="Size")
row.itemR(tex, "nabla")
class TEXTURE_PT_distortednoise(TextureTypePanel):
bl_label = "Distorted Noise"
tex_type = 'DISTORTED_NOISE'
def draw(self, context):
layout = self.layout
tex = context.texture
layout.itemR(tex, "noise_distortion")
layout.itemR(tex, "noise_basis", text="Basis")
flow = layout.column_flow()
flow.itemR(tex, "distortion", text="Distortion")
flow.itemR(tex, "noise_size", text="Size")
flow.itemR(tex, "nabla")
class TEXTURE_PT_voxeldata(TextureButtonsPanel):
bl_label = "Voxel Data"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'VOXEL_DATA')
def draw(self, context):
layout = self.layout
tex = context.texture
vd = tex.voxeldata
layout.itemR(vd, "file_format")
if vd.file_format in ['BLENDER_VOXEL', 'RAW_8BIT']:
layout.itemR(vd, "source_path")
if vd.file_format == 'RAW_8BIT':
layout.itemR(vd, "resolution")
elif vd.file_format == 'SMOKE':
layout.itemR(vd, "domain_object")
layout.itemR(vd, "still")
row = layout.row()
row.active = vd.still
row.itemR(vd, "still_frame_number")
layout.itemR(vd, "interpolation")
layout.itemR(vd, "extension")
layout.itemR(vd, "intensity")
class TEXTURE_PT_pointdensity(TextureButtonsPanel):
bl_label = "Point Density"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'POINT_DENSITY')
def draw(self, context):
layout = self.layout
tex = context.texture
pd = tex.pointdensity
layout.itemR(pd, "point_source", expand=True)
split = layout.split()
col = split.column()
if pd.point_source == 'PARTICLE_SYSTEM':
col.itemL(text="Object:")
col.itemR(pd, "object", text="")
sub = col.column()
sub.enabled = pd.object
if pd.object:
sub.itemL(text="System:")
sub.item_pointerR(pd, "particle_system", pd.object, "particle_systems", text="")
sub.itemL(text="Cache:")
sub.itemR(pd, "particle_cache", text="")
else:
col.itemL(text="Object:")
col.itemR(pd, "object", text="")
col.itemL(text="Cache:")
col.itemR(pd, "vertices_cache", text="")
col.itemS()
col.itemL(text="Color Source:")
col.itemR(pd, "color_source", text="")
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_VELOCITY'):
col.itemR(pd, "speed_scale")
if pd.color_source in ('PARTICLE_SPEED', 'PARTICLE_AGE'):
layout.template_color_ramp(pd, "color_ramp", expand=True)
col = split.column()
col.itemL()
col.itemR(pd, "radius")
col.itemL(text="Falloff:")
col.itemR(pd, "falloff", text="")
if pd.falloff == 'SOFT':
col.itemR(pd, "falloff_softness")
class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
bl_label = "Turbulence"
def poll(self, context):
tex = context.texture
return (tex and tex.type == 'POINT_DENSITY')
def draw_header(self, context):
layout = self.layout
tex = context.texture
pd = tex.pointdensity
layout.itemR(pd, "turbulence", text="")
def draw(self, context):
layout = self.layout
tex = context.texture
pd = tex.pointdensity
layout.active = pd.turbulence
split = layout.split()
col = split.column()
col.itemL(text="Influence:")
col.itemR(pd, "turbulence_influence", text="")
col.itemL(text="Noise Basis:")
col.itemR(pd, "noise_basis", text="")
col = split.column()
col.itemL()
col.itemR(pd, "turbulence_size")
col.itemR(pd, "turbulence_depth")
col.itemR(pd, "turbulence_strength")
bpy.types.register(TEXTURE_PT_context_texture)
bpy.types.register(TEXTURE_PT_preview)
bpy.types.register(TEXTURE_PT_clouds) # Texture Type Panels
bpy.types.register(TEXTURE_PT_wood)
bpy.types.register(TEXTURE_PT_marble)
bpy.types.register(TEXTURE_PT_magic)
bpy.types.register(TEXTURE_PT_blend)
bpy.types.register(TEXTURE_PT_stucci)
bpy.types.register(TEXTURE_PT_image)
bpy.types.register(TEXTURE_PT_image_sampling)
bpy.types.register(TEXTURE_PT_image_mapping)
bpy.types.register(TEXTURE_PT_plugin)
bpy.types.register(TEXTURE_PT_envmap)
bpy.types.register(TEXTURE_PT_musgrave)
bpy.types.register(TEXTURE_PT_voronoi)
bpy.types.register(TEXTURE_PT_distortednoise)
bpy.types.register(TEXTURE_PT_voxeldata)
bpy.types.register(TEXTURE_PT_pointdensity)
bpy.types.register(TEXTURE_PT_pointdensity_turbulence)
bpy.types.register(TEXTURE_PT_colors)
bpy.types.register(TEXTURE_PT_mapping)
bpy.types.register(TEXTURE_PT_influence)

View File

@@ -0,0 +1,209 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class WorldButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "world"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context):
rd = context.scene.render_data
return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
class WORLD_PT_preview(WorldButtonsPanel):
bl_label = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
self.layout.template_preview(context.world)
class WORLD_PT_context_world(WorldButtonsPanel):
bl_label = ""
bl_show_header = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
rd = context.scene.render_data
return (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
scene = context.scene
world = context.world
space = context.space_data
split = layout.split(percentage=0.65)
if scene:
split.template_ID(scene, "world", new="world.new")
elif world:
split.template_ID(space, "pin_id")
class WORLD_PT_world(WorldButtonsPanel):
bl_label = "World"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
world = context.world
row = layout.row()
row.itemR(world, "paper_sky")
row.itemR(world, "blend_sky")
row.itemR(world, "real_sky")
row = layout.row()
row.column().itemR(world, "horizon_color")
col = row.column()
col.itemR(world, "zenith_color")
col.active = world.blend_sky
row.column().itemR(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
bl_label = "Mist"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
world = context.world
self.layout.itemR(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
world = context.world
layout.active = world.mist.enabled
flow = layout.column_flow()
flow.itemR(world.mist, "intensity", slider=True)
flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height")
layout.itemR(world.mist, "falloff")
class WORLD_PT_stars(WorldButtonsPanel):
bl_label = "Stars"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
world = context.world
self.layout.itemR(world.stars, "enabled", text="")
def draw(self, context):
layout = self.layout
world = context.world
layout.active = world.stars.enabled
flow = layout.column_flow()
flow.itemR(world.stars, "size")
flow.itemR(world.stars, "color_randomization", text="Colors")
flow.itemR(world.stars, "min_distance", text="Min. Dist")
flow.itemR(world.stars, "average_separation", text="Separation")
class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
bl_label = "Ambient Occlusion"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
world = context.world
self.layout.itemR(world.ambient_occlusion, "enabled", text="")
def draw(self, context):
layout = self.layout
ao = context.world.ambient_occlusion
layout.active = ao.enabled
layout.itemR(ao, "gather_method", expand=True)
split = layout.split()
col = split.column()
col.itemL(text="Attenuation:")
if ao.gather_method == 'RAYTRACE':
col.itemR(ao, "distance")
col.itemR(ao, "falloff")
sub = col.row()
sub.active = ao.falloff
sub.itemR(ao, "falloff_strength", text="Strength")
if ao.gather_method == 'RAYTRACE':
col = split.column()
col.itemL(text="Sampling:")
col.itemR(ao, "sample_method", text="")
sub = col.column()
sub.itemR(ao, "samples")
if ao.sample_method == 'ADAPTIVE_QMC':
sub.itemR(ao, "threshold")
sub.itemR(ao, "adapt_to_speed", slider=True)
elif ao.sample_method == 'CONSTANT_JITTERED':
sub.itemR(ao, "bias")
if ao.gather_method == 'APPROXIMATE':
col = split.column()
col.itemL(text="Sampling:")
col.itemR(ao, "passes")
col.itemR(ao, "error_tolerance", text="Error")
col.itemR(ao, "pixel_cache")
col.itemR(ao, "correction")
col = layout.column()
col.itemL(text="Influence:")
col.row().itemR(ao, "blend_mode", expand=True)
split = layout.split()
col = split.column()
col.itemR(ao, "energy")
col = split.column()
sub = col.split(percentage=0.3)
sub.itemL(text="Color:")
sub.itemR(ao, "color", text="")
bpy.types.register(WORLD_PT_context_world)
bpy.types.register(WORLD_PT_preview)
bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion)
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)

View File

@@ -1,35 +1,55 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class Buttons_HT_header(bpy.types.Header):
__space_type__ = 'PROPERTIES'
bl_space_type = 'PROPERTIES'
def draw(self, context):
layout = self.layout
so = context.space_data
scene = context.scene
def draw(self, context):
layout = self.layout
row= layout.row(align=True)
row.template_header()
so = context.space_data
scene = context.scene
row = layout.row(align=True)
row.template_header()
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("Buttons_MT_view", text="View")
row = layout.row()
row.itemR(so, "buttons_context", expand=True, text="")
row.itemR(scene, "current_frame")
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("Buttons_MT_view", text="View")
row = layout.row()
row.itemR(so, "buttons_context", expand=True, text="")
row.itemR(scene, "current_frame")
class Buttons_MT_view(bpy.types.Menu):
__label__ = "View"
bl_label = "View"
def draw(self, context):
layout = self.layout
so = context.space_data
def draw(self, context):
layout = self.layout
so = context.space_data
col = layout.column()
col.itemR(so, "panel_alignment", expand=True)
col = layout.column()
col.itemR(so, "panel_alignment", expand=True)
bpy.types.register(Buttons_HT_header)
bpy.types.register(Buttons_MT_view)

View File

@@ -1,9 +1,28 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import sys
import bpy
class CONSOLE_HT_header(bpy.types.Header):
__space_type__ = 'CONSOLE'
bl_space_type = 'CONSOLE'
def draw(self, context):
sc = context.space_data
@@ -41,7 +60,7 @@ class CONSOLE_HT_header(bpy.types.Header):
class CONSOLE_MT_console(bpy.types.Menu):
__label__ = "Console"
bl_label = "Console"
def draw(self, context):
layout = self.layout
@@ -52,7 +71,7 @@ class CONSOLE_MT_console(bpy.types.Menu):
class CONSOLE_MT_report(bpy.types.Menu):
__label__ = "Report"
bl_label = "Report"
def draw(self, context):
layout = self.layout
@@ -110,9 +129,9 @@ def get_console(console_id):
class CONSOLE_OT_exec(bpy.types.Operator):
'''Execute the current console line as a python expression.'''
__idname__ = "console.execute"
__label__ = "Console Execute"
__register__ = False
bl_idname = "console.execute"
bl_label = "Console Execute"
bl_register = False
# Both prompts must be the same length
PROMPT = '>>> '
@@ -190,9 +209,9 @@ class CONSOLE_OT_exec(bpy.types.Operator):
class CONSOLE_OT_autocomplete(bpy.types.Operator):
'''Evaluate the namespace up until the cursor and give a list of
options or complete the name if there is only one.'''
__idname__ = "console.autocomplete"
__label__ = "Console Autocomplete"
__register__ = False
bl_idname = "console.autocomplete"
bl_label = "Console Autocomplete"
bl_register = False
def poll(self, context):
return context.space_data.console_type == 'PYTHON'

View File

@@ -1,48 +1,67 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class FILEBROWSER_HT_header(bpy.types.Header):
__space_type__ = 'FILE_BROWSER'
bl_space_type = 'FILE_BROWSER'
def draw(self, context):
layout = self.layout
st = context.space_data
params = st.params
layout.template_header(menus=False)
row = layout.row()
row.itemS()
row = layout.row(align=True)
row.itemO("file.previous", text="", icon='ICON_BACK')
row.itemO("file.next", text="", icon='ICON_FORWARD')
row.itemO("file.parent", text="", icon='ICON_FILE_PARENT')
row.itemO("file.refresh", text="", icon='ICON_FILE_REFRESH')
row = layout.row()
row.itemS()
row = layout.row(align=True)
row.itemO("file.directory_new", text="", icon='ICON_NEWFOLDER')
layout.itemR(params, "display", expand=True, text="")
layout.itemR(params, "sort", expand=True, text="")
layout.itemR(params, "hide_dot", text="Hide Invisible")
layout.itemR(params, "do_filter", text="", icon='ICON_FILTER')
row = layout.row(align=True)
row.active = params.do_filter
def draw(self, context):
layout = self.layout
row.itemR(params, "filter_folder", text="");
row.itemR(params, "filter_blender", text="");
row.itemR(params, "filter_image", text="");
row.itemR(params, "filter_movie", text="");
row.itemR(params, "filter_script", text="");
row.itemR(params, "filter_font", text="");
row.itemR(params, "filter_sound", text="");
row.itemR(params, "filter_text", text="");
st = context.space_data
params = st.params
layout.template_header(menus=False)
row = layout.row()
row.itemS()
row = layout.row(align=True)
row.itemO("file.previous", text="", icon='ICON_BACK')
row.itemO("file.next", text="", icon='ICON_FORWARD')
row.itemO("file.parent", text="", icon='ICON_FILE_PARENT')
row.itemO("file.refresh", text="", icon='ICON_FILE_REFRESH')
row = layout.row()
row.itemS()
row = layout.row(align=True)
row.itemO("file.directory_new", text="", icon='ICON_NEWFOLDER')
layout.itemR(params, "display", expand=True, text="")
layout.itemR(params, "sort", expand=True, text="")
layout.itemR(params, "hide_dot", text="Hide Invisible")
layout.itemR(params, "do_filter", text="", icon='ICON_FILTER')
row = layout.row(align=True)
row.active = params.do_filter
row.itemR(params, "filter_folder", text="")
row.itemR(params, "filter_blender", text="")
row.itemR(params, "filter_image", text="")
row.itemR(params, "filter_movie", text="")
row.itemR(params, "filter_script", text="")
row.itemR(params, "filter_font", text="")
row.itemR(params, "filter_sound", text="")
row.itemR(params, "filter_text", text="")
bpy.types.register(FILEBROWSER_HT_header)

View File

@@ -1,481 +1,512 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
class IMAGE_MT_view(bpy.types.Menu):
__label__ = "View"
bl_label = "View"
def draw(self, context):
layout = self.layout
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
def draw(self, context):
layout = self.layout
show_uvedit = sima.show_uvedit
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
layout.itemO("image.properties", icon='ICON_MENU_PANEL')
show_uvedit = sima.show_uvedit
layout.itemS()
layout.itemO("image.properties", icon='ICON_MENU_PANEL')
layout.itemR(sima, "update_automatically")
if show_uvedit:
layout.itemR(settings, "uv_local_view") # Numpad /
layout.itemS()
layout.itemS()
layout.itemR(sima, "update_automatically")
if show_uvedit:
layout.itemR(settings, "uv_local_view") # Numpad /
layout.itemO("image.view_zoom_in")
layout.itemO("image.view_zoom_out")
layout.itemS()
layout.itemS()
layout.itemO("image.view_zoom_in")
layout.itemO("image.view_zoom_out")
ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]];
layout.itemS()
for a, b in ratios:
text = "Zoom %d:%d" % (a, b)
layout.item_floatO("image.view_zoom_ratio", "ratio", a/b, text=text)
ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]]
layout.itemS()
for a, b in ratios:
text = "Zoom %d:%d" % (a, b)
layout.item_floatO("image.view_zoom_ratio", "ratio", a / b, text=text)
if show_uvedit:
layout.itemO("image.view_selected")
layout.itemS()
if show_uvedit:
layout.itemO("image.view_selected")
layout.itemO("image.view_all")
layout.itemO("screen.screen_full_area")
layout.itemO("image.view_all")
layout.itemO("screen.screen_full_area")
class IMAGE_MT_select(bpy.types.Menu):
__label__ = "Select"
bl_label = "Select"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.itemO("uv.select_border")
layout.item_booleanO("uv.select_border", "pinned", True)
layout.itemO("uv.select_border")
layout.item_booleanO("uv.select_border", "pinned", True)
layout.itemS()
layout.itemO("uv.select_all_toggle")
layout.itemO("uv.select_inverse")
layout.itemO("uv.unlink_selection")
layout.itemS()
layout.itemS()
layout.itemO("uv.select_all_toggle")
layout.itemO("uv.select_inverse")
layout.itemO("uv.unlink_selection")
layout.itemS()
layout.itemO("uv.select_pinned")
layout.itemO("uv.select_linked")
layout.itemO("uv.select_pinned")
layout.itemO("uv.select_linked")
class IMAGE_MT_image(bpy.types.Menu):
__label__ = "Image"
bl_label = "Image"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
sima = context.space_data
ima = sima.image
sima = context.space_data
ima = sima.image
layout.itemO("image.new")
layout.itemO("image.open")
layout.itemO("image.new")
layout.itemO("image.open")
show_render = sima.show_render
show_render = sima.show_render
if ima:
if not show_render:
layout.itemO("image.replace")
layout.itemO("image.reload")
if ima:
if not show_render:
layout.itemO("image.replace")
layout.itemO("image.reload")
layout.itemO("image.save")
layout.itemO("image.save_as")
layout.itemO("image.save")
layout.itemO("image.save_as")
if ima.source == 'SEQUENCE':
layout.itemO("image.save_sequence")
if ima.source == 'SEQUENCE':
layout.itemO("image.save_sequence")
if not show_render:
layout.itemS()
if not show_render:
layout.itemS()
if ima.packed_file:
layout.itemO("image.unpack")
else:
layout.itemO("image.pack")
if ima.packed_file:
layout.itemO("image.unpack")
else:
layout.itemO("image.pack")
# only for dirty && specific image types, perhaps
# this could be done in operator poll too
if ima.dirty:
if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG")
# only for dirty && specific image types, perhaps
# this could be done in operator poll too
if ima.dirty:
if ima.source in ('FILE', 'GENERATED') and ima.type != 'MULTILAYER':
layout.item_booleanO("image.pack", "as_png", True, text="Pack As PNG")
layout.itemS()
layout.itemS()
layout.itemR(sima, "image_painting")
layout.itemR(sima, "image_painting")
class IMAGE_MT_uvs_showhide(bpy.types.Menu):
__label__ = "Show/Hide Faces"
bl_label = "Show/Hide Faces"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.itemO("uv.reveal")
layout.itemO("uv.hide")
layout.item_booleanO("uv.hide", "unselected", True)
layout.itemO("uv.reveal")
layout.itemO("uv.hide")
layout.item_booleanO("uv.hide", "unselected", True)
class IMAGE_MT_uvs_transform(bpy.types.Menu):
__label__ = "Transform"
bl_label = "Transform"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.itemO("tfm.translate")
layout.itemO("tfm.rotate")
layout.itemO("tfm.resize")
layout.itemO("tfm.translate")
layout.itemO("tfm.rotate")
layout.itemO("tfm.resize")
class IMAGE_MT_uvs_mirror(bpy.types.Menu):
__label__ = "Mirror"
bl_label = "Mirror"
def draw(self, context):
layout = self.layout
layout.operator_context = "EXEC_REGION_WIN"
def draw(self, context):
layout = self.layout
layout.operator_context = "EXEC_REGION_WIN"
props= layout.itemO("tfm.mirror", text="X Axis", properties=True)
props.constraint_axis[0]= True
props = layout.itemO("tfm.mirror", text="X Axis", properties=True)
props.constraint_axis[0] = True
props = layout.itemO("tfm.mirror", text="Y Axis", properties=True)
props.constraint_axis[1] = True
props= layout.itemO("tfm.mirror", text="Y Axis", properties=True)
props.constraint_axis[1]= True
class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
__label__ = "Weld/Align"
bl_label = "Weld/Align"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.itemO("uv.weld") # W, 1
layout.items_enumO("uv.align", "axis") # W, 2/3/4
layout.itemO("uv.weld") # W, 1
layout.items_enumO("uv.align", "axis") # W, 2/3/4
class IMAGE_MT_uvs(bpy.types.Menu):
__label__ = "UVs"
bl_label = "UVs"
def draw(self, context):
layout = self.layout
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
def draw(self, context):
layout = self.layout
layout.itemR(uv, "snap_to_pixels")
layout.itemR(uv, "constrain_to_image_bounds")
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
layout.itemS()
layout.itemR(uv, "snap_to_pixels")
layout.itemR(uv, "constrain_to_image_bounds")
layout.itemR(uv, "live_unwrap")
layout.itemO("uv.unwrap")
layout.item_booleanO("uv.pin", "clear", True, text="Unpin")
layout.itemO("uv.pin")
layout.itemS()
layout.itemS()
layout.itemR(uv, "live_unwrap")
layout.itemO("uv.unwrap")
layout.item_booleanO("uv.pin", "clear", True, text="Unpin")
layout.itemO("uv.pin")
layout.itemO("uv.pack_islands")
layout.itemO("uv.average_islands_scale")
layout.itemO("uv.minimize_stretch")
layout.itemO("uv.stitch")
layout.itemS()
layout.itemS()
layout.itemO("uv.pack_islands")
layout.itemO("uv.average_islands_scale")
layout.itemO("uv.minimize_stretch")
layout.itemO("uv.stitch")
layout.itemM("IMAGE_MT_uvs_transform")
layout.itemM("IMAGE_MT_uvs_mirror")
layout.itemM("IMAGE_MT_uvs_weldalign")
layout.itemS()
layout.itemS()
layout.itemM("IMAGE_MT_uvs_transform")
layout.itemM("IMAGE_MT_uvs_mirror")
layout.itemM("IMAGE_MT_uvs_weldalign")
layout.itemR(settings, "proportional_editing")
layout.item_menu_enumR(settings, "proportional_editing_falloff")
layout.itemS()
layout.itemS()
layout.itemR(settings, "proportional_editing")
layout.item_menu_enumR(settings, "proportional_editing_falloff")
layout.itemS()
layout.itemM("IMAGE_MT_uvs_showhide")
layout.itemM("IMAGE_MT_uvs_showhide")
class IMAGE_HT_header(bpy.types.Header):
__space_type__ = 'IMAGE_EDITOR'
bl_space_type = 'IMAGE_EDITOR'
def draw(self, context):
layout = self.layout
sima = context.space_data
ima = sima.image
iuser = sima.image_user
settings = context.tool_settings
def draw(self, context):
layout = self.layout
show_render = sima.show_render
show_paint = sima.show_paint
show_uvedit = sima.show_uvedit
sima = context.space_data
ima = sima.image
iuser = sima.image_user
settings = context.tool_settings
row = layout.row(align=True)
row.template_header()
show_render = sima.show_render
show_paint = sima.show_paint
show_uvedit = sima.show_uvedit
# menus
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("IMAGE_MT_view")
row = layout.row(align=True)
row.template_header()
if show_uvedit:
sub.itemM("IMAGE_MT_select")
# menus
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("IMAGE_MT_view")
if ima and ima.dirty:
sub.itemM("IMAGE_MT_image", text="Image*")
else:
sub.itemM("IMAGE_MT_image", text="Image")
if show_uvedit:
sub.itemM("IMAGE_MT_select")
if show_uvedit:
sub.itemM("IMAGE_MT_uvs")
if ima and ima.dirty:
sub.itemM("IMAGE_MT_image", text="Image*")
else:
sub.itemM("IMAGE_MT_image", text="Image")
layout.template_ID(sima, "image", new="image.new")
if show_uvedit:
sub.itemM("IMAGE_MT_uvs")
# uv editing
if show_uvedit:
uvedit = sima.uv_editor
layout.template_ID(sima, "image", new="image.new")
layout.itemR(uvedit, "pivot", text="", icon_only=True)
layout.itemR(settings, "uv_sync_selection", text="")
# uv editing
if show_uvedit:
uvedit = sima.uv_editor
if settings.uv_sync_selection:
layout.itemR(settings, "mesh_selection_mode", text="", expand=True)
else:
layout.itemR(settings, "uv_selection_mode", text="", expand=True)
layout.itemR(uvedit, "sticky_selection_mode", text="", icon_only=True)
pass
layout.itemR(uvedit, "pivot", text="", icon_only=True)
layout.itemR(settings, "uv_sync_selection", text="")
row = layout.row(align=True)
row.itemR(settings, "snap", text="")
if settings.snap:
row.itemR(settings, "snap_mode", text="")
if settings.uv_sync_selection:
layout.itemR(settings, "mesh_selection_mode", text="", expand=True)
else:
layout.itemR(settings, "uv_selection_mode", text="", expand=True)
layout.itemR(uvedit, "sticky_selection_mode", text="", icon_only=True)
pass
"""
mesh = context.edit_object.data
row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
"""
row = layout.row(align=True)
row.itemR(settings, "snap", text="")
if settings.snap:
row.itemR(settings, "snap_mode", text="")
if ima:
# layers
layout.template_image_layers(ima, iuser)
"""
mesh = context.edit_object.data
row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
"""
# painting
layout.itemR(sima, "image_painting", text="")
if ima:
# layers
layout.template_image_layers(ima, iuser)
# draw options
row = layout.row(align=True)
row.itemR(sima, "draw_channels", text="", expand=True)
# painting
layout.itemR(sima, "image_painting", text="")
# draw options
row = layout.row(align=True)
row.itemR(sima, "draw_channels", text="", expand=True)
row = layout.row(align=True)
if ima.type == 'COMPOSITE':
row.itemO("image.record_composite", icon='ICON_REC')
if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
row.itemO("image.play_composite", icon='ICON_PLAY')
if show_uvedit or sima.image_painting:
layout.itemR(sima, "update_automatically", text="")
row = layout.row(align=True)
if ima.type == 'COMPOSITE':
row.itemO("image.record_composite", icon='ICON_REC')
if ima.type == 'COMPOSITE' and ima.source in ('MOVIE', 'SEQUENCE'):
row.itemO("image.play_composite", icon='ICON_PLAY')
if show_uvedit or sima.image_painting:
layout.itemR(sima, "update_automatically", text="")
class IMAGE_PT_image_properties(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR'
__region_type__ = 'UI'
__label__ = "Image"
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_label = "Image"
def poll(self, context):
sima = context.space_data
return (sima.image)
def poll(self, context):
sima = context.space_data
return (sima.image)
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
sima = context.space_data
ima = sima.image
iuser = sima.image_user
sima = context.space_data
ima = sima.image
iuser = sima.image_user
layout.template_image(sima, "image", iuser, compact=True)
layout.template_image(sima, "image", iuser, compact=True)
class IMAGE_PT_game_properties(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR'
__region_type__ = 'UI'
__label__ = "Game Properties"
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_label = "Game Properties"
def poll(self, context):
rd = context.scene.render_data
sima = context.space_data
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
def poll(self, context):
rd = context.scene.render_data
sima = context.space_data
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
def draw(self, context):
layout = self.layout
sima = context.space_data
ima = sima.image
def draw(self, context):
layout = self.layout
split = layout.split()
sima = context.space_data
ima = sima.image
col = split.column()
sub = col.column(align=True)
sub.itemR(ima, "animated")
split = layout.split()
subsub = sub.column()
subsub.active = ima.animated
subsub.itemR(ima, "animation_start", text="Start")
subsub.itemR(ima, "animation_end", text="End")
subsub.itemR(ima, "animation_speed", text="Speed")
col.itemR(ima, "tiles")
sub = col.column(align=True)
sub.active = ima.tiles or ima.animated
sub.itemR(ima, "tiles_x", text="X")
sub.itemR(ima, "tiles_y", text="Y")
col = split.column()
col.itemL(text="Clamp:")
col.itemR(ima, "clamp_x", text="X")
col.itemR(ima, "clamp_y", text="Y")
col.itemS()
col.itemR(ima, "mapping", expand=True)
col = split.column()
sub = col.column(align=True)
sub.itemR(ima, "animated")
subsub = sub.column()
subsub.active = ima.animated
subsub.itemR(ima, "animation_start", text="Start")
subsub.itemR(ima, "animation_end", text="End")
subsub.itemR(ima, "animation_speed", text="Speed")
col.itemR(ima, "tiles")
sub = col.column(align=True)
sub.active = ima.tiles or ima.animated
sub.itemR(ima, "tiles_x", text="X")
sub.itemR(ima, "tiles_y", text="Y")
col = split.column()
col.itemL(text="Clamp:")
col.itemR(ima, "clamp_x", text="X")
col.itemR(ima, "clamp_y", text="Y")
col.itemS()
col.itemR(ima, "mapping", expand=True)
class IMAGE_PT_view_properties(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR'
__region_type__ = 'UI'
__label__ = "Display"
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_label = "Display"
def poll(self, context):
sima = context.space_data
return (sima and (sima.image or sima.show_uvedit))
def poll(self, context):
sima = context.space_data
return (sima and (sima.image or sima.show_uvedit))
def draw(self, context):
layout = self.layout
sima = context.space_data
ima = sima.image
show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor
def draw(self, context):
layout = self.layout
split = layout.split()
sima = context.space_data
ima = sima.image
show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor
col = split.column()
if ima:
col.itemR(ima, "display_aspect", text="Aspect Ratio")
split = layout.split()
col = split.column()
col.itemL(text="Coordinates:")
col.itemR(sima, "draw_repeated", text="Repeat")
if show_uvedit:
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
elif show_uvedit:
col.itemL(text="Coordinates:")
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
col = split.column()
if ima:
col.itemR(ima, "display_aspect", text="Aspect Ratio")
if show_uvedit:
col = layout.column()
col.itemL(text="UVs:")
row = col.row()
row.itemR(uvedit, "edge_draw_type", expand=True)
split = layout.split()
col = split.column()
col.itemL(text="Coordinates:")
col.itemR(sima, "draw_repeated", text="Repeat")
if show_uvedit:
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
elif show_uvedit:
col.itemL(text="Coordinates:")
col.itemR(uvedit, "normalized_coordinates", text="Normalized")
if show_uvedit:
col = layout.column()
col.itemL(text="UVs:")
row = col.row()
row.itemR(uvedit, "edge_draw_type", expand=True)
split = layout.split()
col = split.column()
col.itemR(uvedit, "draw_stretch", text="Stretch")
sub = col.column()
sub.active = uvedit.draw_stretch
sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
col = split.column()
col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
col.itemR(uvedit, "draw_modified_edges", text="Modified")
#col.itemR(uvedit, "draw_edges")
#col.itemR(uvedit, "draw_faces")
col = split.column()
col.itemR(uvedit, "draw_stretch", text="Stretch")
sub = col.column()
sub.active = uvedit.draw_stretch
sub.row().itemR(uvedit, "draw_stretch_type", expand=True)
col = split.column()
col.itemR(uvedit, "draw_smooth_edges", text="Smooth")
col.itemR(uvedit, "draw_modified_edges", text="Modified")
#col.itemR(uvedit, "draw_edges")
#col.itemR(uvedit, "draw_faces")
class IMAGE_PT_paint(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR'
__region_type__ = 'UI'
__label__ = "Paint"
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_label = "Paint"
def poll(self, context):
sima = context.space_data
return sima.show_paint
def poll(self, context):
sima = context.space_data
return sima.show_paint
def draw(self, context):
layout = self.layout
settings = context.tool_settings.image_paint
brush = settings.brush
def draw(self, context):
layout = self.layout
col = layout.split().column()
row = col.row()
row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
col.template_ID(settings, "brush", new="brush.add")
settings = context.tool_settings.image_paint
brush = settings.brush
row = layout.row(align=True)
row.item_enumR(settings, "tool", 'DRAW')
row.item_enumR(settings, "tool", 'SOFTEN')
row.item_enumR(settings, "tool", 'CLONE')
row.item_enumR(settings, "tool", 'SMEAR')
if brush:
col = layout.column()
col.itemR(brush, "color", text="")
col = layout.split().column()
row = col.row()
row.template_list(settings, "brushes", settings, "active_brush_index", rows=2)
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
row.itemR(brush, "use_strength_pressure", toggle=True, text="")
col.template_ID(settings, "brush", new="brush.add")
row = col.row(align=True)
row.itemR(brush, "jitter", slider=True)
row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
row = layout.row(align=True)
row.item_enumR(settings, "tool", 'DRAW')
row.item_enumR(settings, "tool", 'SOFTEN')
row.item_enumR(settings, "tool", 'CLONE')
row.item_enumR(settings, "tool", 'SMEAR')
if brush:
col = layout.column()
col.itemR(brush, "color", text="")
row = col.row(align=True)
row.itemR(brush, "size", slider=True)
row.itemR(brush, "use_size_pressure", toggle=True, text="")
row = col.row(align=True)
row.itemR(brush, "strength", slider=True)
row.itemR(brush, "use_strength_pressure", toggle=True, text="")
row = col.row(align=True)
row.itemR(brush, "jitter", slider=True)
row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
col.itemR(brush, "blend", text="Blend")
col.itemR(brush, "blend", text="Blend")
class IMAGE_PT_paint_stroke(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR'
__region_type__ = 'UI'
__label__ = "Paint Stroke"
__default_closed__ = True
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_label = "Paint Stroke"
bl_default_closed = True
def poll(self, context):
sima = context.space_data
settings = context.tool_settings.image_paint
return sima.show_paint and settings.brush
def poll(self, context):
sima = context.space_data
settings = context.tool_settings.image_paint
return sima.show_paint and settings.brush
def draw(self, context):
layout = self.layout
settings = context.tool_settings.image_paint
brush = settings.brush
def draw(self, context):
layout = self.layout
layout.itemR(brush, "use_airbrush")
col = layout.column()
col.active = brush.use_airbrush
col.itemR(brush, "rate", slider=True)
settings = context.tool_settings.image_paint
brush = settings.brush
layout.itemR(brush, "use_airbrush")
col = layout.column()
col.active = brush.use_airbrush
col.itemR(brush, "rate", slider=True)
layout.itemR(brush, "use_space")
row = layout.row(align=True)
row.active = brush.use_space
row.itemR(brush, "spacing", text="Distance", slider=True)
row.itemR(brush, "use_spacing_pressure", toggle=True, text="")
layout.itemR(brush, "use_space")
row = layout.row(align=True)
row.active = brush.use_space
row.itemR(brush, "spacing", text="Distance", slider=True)
row.itemR(brush, "use_spacing_pressure", toggle=True, text="")
class IMAGE_PT_paint_curve(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR'
__region_type__ = 'UI'
__label__ = "Paint Curve"
__default_closed__ = True
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = 'UI'
bl_label = "Paint Curve"
bl_default_closed = True
def poll(self, context):
sima = context.space_data
settings = context.tool_settings.image_paint
return sima.show_paint and settings.brush
def poll(self, context):
sima = context.space_data
settings = context.tool_settings.image_paint
return sima.show_paint and settings.brush
def draw(self, context):
layout = self.layout
settings = context.tool_settings.image_paint
brush = settings.brush
def draw(self, context):
layout = self.layout
layout.template_curve_mapping(brush, "curve")
layout.item_menu_enumO("brush.curve_preset", property="shape")
settings = context.tool_settings.image_paint
brush = settings.brush
layout.template_curve_mapping(brush, "curve")
layout.item_menu_enumO("brush.curve_preset", property="shape")
bpy.types.register(IMAGE_MT_view)
bpy.types.register(IMAGE_MT_select)
@@ -492,4 +523,3 @@ bpy.types.register(IMAGE_PT_paint_stroke)
bpy.types.register(IMAGE_PT_paint_curve)
bpy.types.register(IMAGE_PT_game_properties)
bpy.types.register(IMAGE_PT_view_properties)

View File

@@ -1,235 +1,269 @@
# ##### 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
import dynamic_menu
# reload(dynamic_menu)
class INFO_HT_header(bpy.types.Header):
__space_type__ = 'INFO'
bl_space_type = 'INFO'
def draw(self, context):
layout = self.layout
st = context.space_data
scene = context.scene
rd = scene.render_data
def draw(self, context):
layout = self.layout
row = layout.row(align=True)
row.template_header()
st = context.space_data
scene = context.scene
rd = scene.render_data
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("INFO_MT_file")
sub.itemM("INFO_MT_add")
if rd.use_game_engine:
sub.itemM("INFO_MT_game")
else:
sub.itemM("INFO_MT_render")
sub.itemM("INFO_MT_help")
row = layout.row(align=True)
row.template_header()
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
if context.area.show_menus:
sub = row.row(align=True)
sub.itemM("INFO_MT_file")
sub.itemM("INFO_MT_add")
if rd.use_game_engine:
sub.itemM("INFO_MT_game")
else:
sub.itemM("INFO_MT_render")
sub.itemM("INFO_MT_help")
if rd.multiple_engines:
layout.itemR(rd, "engine", text="")
layout.template_ID(context.window, "screen", new="screen.new", unlink="screen.delete")
layout.template_ID(context.screen, "scene", new="scene.new", unlink="scene.delete")
layout.itemS()
layout.itemS()
layout.template_operator_search()
layout.template_running_jobs()
if rd.multiple_engines:
layout.itemR(rd, "engine", text="")
layout.itemS()
layout.template_operator_search()
layout.template_running_jobs()
layout.itemL(text=scene.statistics())
layout.itemO("wm.window_fullscreen_toggle", icon='ICON_FULLSCREEN_ENTER', text="")
layout.itemL(text=scene.statistics())
layout.itemO("wm.window_fullscreen_toggle", icon='ICON_ARROW_LEFTRIGHT', text="")
class INFO_MT_file(bpy.types.Menu):
__label__ = "File"
bl_label = "File"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.operator_context = "EXEC_AREA"
layout.itemO("wm.read_homefile", text="New", icon='ICON_NEW')
layout.operator_context = "INVOKE_AREA"
layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
layout.itemO("wm.recover_last_session")
layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
layout.operator_context = "EXEC_AREA"
layout.itemO("wm.read_homefile", text="New", icon='ICON_NEW')
layout.operator_context = "INVOKE_AREA"
layout.itemO("wm.open_mainfile", text="Open...", icon='ICON_FILE_FOLDER')
layout.item_menu_enumO("wm.open_recentfile", "file", text="Open Recent")
layout.itemO("wm.recover_last_session")
layout.itemO("wm.recover_auto_save", text="Recover Auto Save...")
layout.itemS()
layout.itemS()
layout.operator_context = "EXEC_AREA"
layout.itemO("wm.save_mainfile", text="Save", icon='ICON_FILE_TICK')
layout.operator_context = "INVOKE_AREA"
layout.itemO("wm.save_as_mainfile", text="Save As...")
layout.itemO("screen.userpref_show", text="User Preferences...", icon='ICON_PREFERENCES')
layout.operator_context = "EXEC_AREA"
layout.itemO("wm.save_mainfile", text="Save", icon='ICON_FILE_TICK')
layout.operator_context = "INVOKE_AREA"
layout.itemO("wm.save_as_mainfile", text="Save As...")
layout.itemO("screen.userpref_show", text="User Preferences...", icon='ICON_PREFERENCES')
layout.itemS()
layout.operator_context = "INVOKE_AREA"
layout.itemO("wm.link_append", text="Link")
layout.item_booleanO("wm.link_append", "link", False, text="Append")
layout.itemS()
layout.itemS()
layout.operator_context = "INVOKE_AREA"
layout.itemO("wm.link_append", text="Link")
layout.item_booleanO("wm.link_append", "link", False, text="Append")
layout.itemS()
layout.itemM("INFO_MT_file_import")
layout.itemM("INFO_MT_file_export")
layout.itemM("INFO_MT_file_import")
layout.itemM("INFO_MT_file_export")
layout.itemS()
layout.itemS()
layout.itemM("INFO_MT_file_external_data")
layout.itemM("INFO_MT_file_external_data")
layout.itemS()
layout.itemS()
layout.operator_context = "EXEC_AREA"
layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
layout.operator_context = "EXEC_AREA"
layout.itemO("wm.exit_blender", text="Quit", icon='ICON_QUIT')
# test for expanding menus
'''
class INFO_MT_file_more(INFO_MT_file):
__label__ = "File"
bl_label = "File"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.itemO("wm.read_homefile", text="TESTING ")
layout.itemO("wm.read_homefile", text="TESTING ")
dynamic_menu.setup(INFO_MT_file_more)
'''
class INFO_MT_file_import(dynamic_menu.DynMenu):
__label__ = "Import"
def draw(self, context):
self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
class INFO_MT_file_import(dynamic_menu.DynMenu):
bl_idname = "INFO_MT_file_import"
bl_label = "Import"
def draw(self, context):
self.layout.itemO("WM_OT_collada_import", text="COLLADA (.dae)...")
class INFO_MT_file_export(dynamic_menu.DynMenu):
__label__ = "Export"
bl_idname = "INFO_MT_file_export"
bl_label = "Export"
def draw(self, context):
self.layout.itemO("WM_OT_collada_export", text="COLLADA (.dae)...")
def draw(self, context):
self.layout.itemO("WM_OT_collada_export", text="COLLADA (.dae)...")
class INFO_MT_file_external_data(bpy.types.Menu):
__label__ = "External Data"
bl_label = "External Data"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.itemO("file.pack_all", text="Pack into .blend file")
layout.itemO("file.unpack_all", text="Unpack into Files...")
layout.itemO("file.pack_all", text="Pack into .blend file")
layout.itemO("file.unpack_all", text="Unpack into Files...")
layout.itemS()
layout.itemS()
layout.itemO("file.make_paths_relative")
layout.itemO("file.make_paths_absolute")
layout.itemO("file.report_missing_files")
layout.itemO("file.find_missing_files")
layout.itemO("file.make_paths_relative")
layout.itemO("file.make_paths_absolute")
layout.itemO("file.report_missing_files")
layout.itemO("file.find_missing_files")
class INFO_MT_mesh_add(dynamic_menu.DynMenu):
__label__ = "Mesh"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.itemO("mesh.primitive_plane_add", icon='ICON_MESH_PLANE', text="Plane")
layout.itemO("mesh.primitive_cube_add", icon='ICON_MESH_CUBE', text="Cube")
layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
layout.itemS()
layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
layout.itemO("mesh.primitive_monkey_add", icon='ICON_MESH_MONKEY', text="Monkey")
bl_idname = "INFO_MT_mesh_add"
bl_label = "Mesh"
def draw(self, context):
layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN'
layout.itemO("mesh.primitive_plane_add", icon='ICON_MESH_PLANE', text="Plane")
layout.itemO("mesh.primitive_cube_add", icon='ICON_MESH_CUBE', text="Cube")
layout.itemO("mesh.primitive_circle_add", icon='ICON_MESH_CIRCLE', text="Circle")
layout.itemO("mesh.primitive_uv_sphere_add", icon='ICON_MESH_UVSPHERE', text="UV Sphere")
layout.itemO("mesh.primitive_ico_sphere_add", icon='ICON_MESH_ICOSPHERE', text="Icosphere")
layout.itemO("mesh.primitive_tube_add", icon='ICON_MESH_TUBE', text="Tube")
layout.itemO("mesh.primitive_cone_add", icon='ICON_MESH_CONE', text="Cone")
layout.itemS()
layout.itemO("mesh.primitive_grid_add", icon='ICON_MESH_GRID', text="Grid")
layout.itemO("mesh.primitive_monkey_add", icon='ICON_MESH_MONKEY', text="Monkey")
class INFO_MT_add(bpy.types.Menu):
__label__ = "Add"
bl_label = "Add"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.operator_context = "EXEC_SCREEN"
layout.operator_context = "EXEC_SCREEN"
# layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
layout.itemM("INFO_MT_mesh_add", icon='ICON_OUTLINER_OB_MESH')
layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
# layout.item_menu_enumO("object.mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH')
layout.itemM("INFO_MT_mesh_add", icon='ICON_OUTLINER_OB_MESH')
layout.itemS()
layout.item_menu_enumO("object.curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE')
layout.item_menu_enumO("object.surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE')
layout.item_menu_enumO("object.metaball_add", "type", 'META', text="Metaball", icon='ICON_OUTLINER_OB_META')
layout.itemO("object.text_add", text="Text", icon='ICON_OUTLINER_OB_FONT')
layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
layout.itemS()
layout.itemS()
layout.itemO("object.armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE')
layout.item_enumO("object.add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE')
layout.item_enumO("object.add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY')
layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
layout.itemS()
layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
layout.itemS()
layout.item_enumO("object.add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA')
layout.item_menu_enumO("object.lamp_add", "type", 'LAMP', text="Lamp", icon='ICON_OUTLINER_OB_LAMP')
layout.itemS()
layout.item_menu_enumO("object.effector_add", "type", 'EMPTY', text="Force Field", icon='ICON_OUTLINER_OB_EMPTY')
layout.itemS()
layout.item_menu_enumO("object.group_instance_add", "type", text="Group Instance", icon='ICON_OUTLINER_OB_EMPTY')
layout.itemS()
layout.item_menu_enumO("object.group_instance_add", "type", text="Group Instance", icon='ICON_OUTLINER_OB_EMPTY')
class INFO_MT_game(bpy.types.Menu):
__label__ = "Game"
bl_label = "Game"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
gs = context.scene.game_data
gs = context.scene.game_data
layout.itemO("view3d.game_start")
layout.itemO("view3d.game_start")
layout.itemS()
layout.itemS()
layout.itemR(gs, "show_debug_properties")
layout.itemR(gs, "show_framerate_profile")
layout.itemR(gs, "show_physics_visualization")
layout.itemR(gs, "deprecation_warnings")
layout.itemR(gs, "show_debug_properties")
layout.itemR(gs, "show_framerate_profile")
layout.itemR(gs, "show_physics_visualization")
layout.itemR(gs, "deprecation_warnings")
class INFO_MT_render(bpy.types.Menu):
__label__ = "Render"
bl_label = "Render"
def draw(self, context):
layout = self.layout
rd = context.scene.render_data
def draw(self, context):
layout = self.layout
layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION')
rd = context.scene.render_data
layout.itemS()
layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION')
layout.itemO("screen.opengl_render", text="OpenGL Render Image")
layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
layout.itemS()
layout.itemS()
layout.itemO("screen.opengl_render", text="OpenGL Render Image")
layout.item_booleanO("screen.opengl_render", "animation", True, text="OpenGL Render Animation")
layout.itemS()
layout.itemO("screen.render_view_show")
layout.itemO("screen.render_view_show")
class INFO_MT_help(bpy.types.Menu):
__label__ = "Help"
bl_label = "Help"
def draw(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
layout.itemO("help.manual", icon='ICON_HELP')
layout.itemO("help.release_logs", icon='ICON_URL')
layout.itemO("help.manual", icon='ICON_HELP')
layout.itemO("help.release_logs", icon='ICON_URL')
layout.itemS()
layout.itemS()
layout.itemO("help.blender_website", icon='ICON_URL')
layout.itemO("help.blender_eshop", icon='ICON_URL')
layout.itemO("help.developer_community", icon='ICON_URL')
layout.itemO("help.user_community", icon='ICON_URL')
layout.itemS()
layout.itemO("help.report_bug", icon='ICON_URL')
layout.itemS()
layout.itemO("help.operator_cheat_sheet")
layout.itemO("help.blender_website", icon='ICON_URL')
layout.itemO("help.blender_eshop", icon='ICON_URL')
layout.itemO("help.developer_community", icon='ICON_URL')
layout.itemO("help.user_community", icon='ICON_URL')
layout.itemS()
layout.itemO("help.report_bug", icon='ICON_URL')
layout.itemS()
layout.itemO("help.operator_cheat_sheet")
bpy.types.register(INFO_HT_header)
bpy.types.register(INFO_MT_file)
@@ -244,78 +278,89 @@ bpy.types.register(INFO_MT_help)
# Help operators
class HelpOperator(bpy.types.Operator):
def execute(self, context):
import webbrowser
webbrowser.open(self.__URL__)
return ('FINISHED',)
def execute(self, context):
import webbrowser
webbrowser.open(self._url)
return ('FINISHED',)
class HELP_OT_manual(HelpOperator):
'''The Blender Wiki manual'''
__idname__ = "help.manual"
__label__ = "Manual"
__URL__ = 'http://wiki.blender.org/index.php/Manual'
'''The Blender Wiki manual'''
bl_idname = "help.manual"
bl_label = "Manual"
_url = 'http://wiki.blender.org/index.php/Manual'
class HELP_OT_release_logs(HelpOperator):
'''Information about the changes in this version of Blender'''
__idname__ = "help.release_logs"
__label__ = "Release Logs"
__URL__ = 'http://www.blender.org/development/release-logs/'
'''Information about the changes in this version of Blender'''
bl_idname = "help.release_logs"
bl_label = "Release Logs"
_url = 'http://www.blender.org/development/release-logs/'
class HELP_OT_blender_website(HelpOperator):
'''The official Blender website'''
__idname__ = "help.blender_website"
__label__ = "Blender Website"
__URL__ = 'http://www.blender.org/'
'''The official Blender website'''
bl_idname = "help.blender_website"
bl_label = "Blender Website"
_url = 'http://www.blender.org/'
class HELP_OT_blender_eshop(HelpOperator):
'''Buy official Blender resources and merchandise online'''
__idname__ = "help.blender_eshop"
__label__ = "Blender e-Shop"
__URL__ = 'http://www.blender3d.org/e-shop'
'''Buy official Blender resources and merchandise online'''
bl_idname = "help.blender_eshop"
bl_label = "Blender e-Shop"
_url = 'http://www.blender3d.org/e-shop'
class HELP_OT_developer_community(HelpOperator):
'''Get involved with Blender development'''
__idname__ = "help.developer_community"
__label__ = "Developer Community"
__URL__ = 'http://www.blender.org/community/get-involved/'
'''Get involved with Blender development'''
bl_idname = "help.developer_community"
bl_label = "Developer Community"
_url = 'http://www.blender.org/community/get-involved/'
class HELP_OT_user_community(HelpOperator):
'''Get involved with other Blender users'''
__idname__ = "help.user_community"
__label__ = "User Community"
__URL__ = 'http://www.blender.org/community/user-community/'
'''Get involved with other Blender users'''
bl_idname = "help.user_community"
bl_label = "User Community"
_url = 'http://www.blender.org/community/user-community/'
class HELP_OT_report_bug(HelpOperator):
'''Report a bug in the Blender bug tracker'''
__idname__ = "help.report_bug"
__label__ = "Report a Bug"
__URL__ = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
'''Report a bug in the Blender bug tracker'''
bl_idname = "help.report_bug"
bl_label = "Report a Bug"
_url = 'http://projects.blender.org/tracker/?atid=498&group_id=9&func=browse'
class HELP_OT_operator_cheat_sheet(bpy.types.Operator):
__idname__ = "help.operator_cheat_sheet"
__label__ = "Operator Cheat Sheet (new textblock)"
def execute(self, context):
op_strings = []
tot = 0
for op_module_name in dir(bpy.ops):
op_module = getattr(bpy.ops, op_module_name)
for op_submodule_name in dir(op_module):
op = getattr(op_module, op_submodule_name)
text = repr(op)
if text.startswith('bpy.ops.'):
op_strings.append(text)
tot += 1
op_strings.append('')
bpy.ops.text.new() # XXX - assumes new text is always at the end!
textblock = bpy.data.texts[-1]
textblock.write('# %d Operators\n\n' % tot)
textblock.write('\n'.join(op_strings))
textblock.name = "OperatorList.txt"
print("See OperatorList.txt textblock")
return ('FINISHED',)
bl_idname = "help.operator_cheat_sheet"
bl_label = "Operator Cheat Sheet (new textblock)"
def execute(self, context):
op_strings = []
tot = 0
for op_module_name in dir(bpy.ops):
op_module = getattr(bpy.ops, op_module_name)
for op_submodule_name in dir(op_module):
op = getattr(op_module, op_submodule_name)
text = repr(op)
if text.startswith('bpy.ops.'):
op_strings.append(text)
tot += 1
op_strings.append('')
bpy.ops.text.new() # XXX - assumes new text is always at the end!
textblock = bpy.data.texts[-1]
textblock.write('# %d Operators\n\n' % tot)
textblock.write('\n'.join(op_strings))
textblock.name = "OperatorList.txt"
print("See OperatorList.txt textblock")
return ('FINISHED',)
bpy.ops.add(HELP_OT_manual)
bpy.ops.add(HELP_OT_release_logs)

Some files were not shown because too many files have changed in this diff Show More