Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arnold 7.1.4 support #92

Open
wants to merge 26 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
76f56c7
update adclm patching
JenusL Apr 2, 2023
782a156
add new triplanar parameters
JenusL Apr 2, 2023
e255b27
add dual-lobe phase to standard_volume
JenusL Apr 2, 2023
2977537
hide displacement from standard_volume ppg
JenusL Apr 2, 2023
2922804
add emission scaling to standard_volume
JenusL Apr 2, 2023
0043aca
add blackbody contrast to standard_volume
JenusL Apr 2, 2023
b3405c5
tweak min/max of standard_volume parameters
JenusL Apr 2, 2023
f8172ac
add AI_LOG_PLUGINS to info log level
JenusL Apr 2, 2023
f8b1300
adjust checkerboard ui
JenusL Apr 24, 2023
10fddfd
updated noIcon to exr and tx in testsuite
JenusL Apr 24, 2023
78dca32
add adp settings command
JenusL Apr 24, 2023
581aad4
bump min arnold version
JenusL Apr 24, 2023
530e75c
add support for curve basis and wrap_mode
JenusL Apr 24, 2023
06799af
skip export of min_pixel_width in unsupported modes
JenusL Apr 24, 2023
2fd68e5
add setting for auto maketx
JenusL Apr 24, 2023
01900fd
add support for multi output shaders
JenusL Apr 24, 2023
d39a199
add support for osl shaders in build system
JenusL Apr 24, 2023
2ccd993
don't create shaderdef for osl versions of default softimage shaders
JenusL Apr 24, 2023
846df76
add some osl shaders of standard softiamge shaders as example
JenusL Apr 24, 2023
ee1d863
multiple output shader test
JenusL Apr 24, 2023
c80bc60
version up
JenusL Apr 24, 2023
87b8a95
update abuild logic to use python or py launcher
JenusL Apr 24, 2023
6681df3
update dev env helper
JenusL Apr 24, 2023
cfca070
tiny change of osl build dir
JenusL Apr 24, 2023
ba98ba3
package adp and crashdump files
JenusL Apr 24, 2023
74e7611
delete scntoc file
JenusL Apr 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ under an Apache 2.0 open source license.
#### Requirements

* Softimage 2015 SP1
* Arnold 7.0.0.0 or newer
* Arnold 7.1.4.0 or newer
* Python 2.6 or newer
* Visual Studio 2015 (Windows)
* GCC 4.2.4 (Linux)
Expand Down Expand Up @@ -65,7 +65,7 @@ VS_HOME = r'C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC'
WINDOWS_KIT = r'C:/Program Files (x86)/Windows Kits/10'

XSISDK_ROOT = r'C:/Program Files/Autodesk/Softimage 2015 SP2/XSISDK'
ARNOLD_HOME = r'C:/SolidAngle/Arnold-7.0.0.0-windows'
ARNOLD_HOME = r'C:/SolidAngle/Arnold-7.1.4.0-windows'

TARGET_WORKGROUP_PATH = r'./Softimage_2015/Addons/SItoA'

Expand Down
20 changes: 15 additions & 5 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ if system.os() == 'windows':
duplicate = 0,
exports = 'env')

[SITOA_SHADERS, SITOA_SHADERS_PRJ] = env.SConscript(os.path.join('shaders', 'src', 'SConscript'),
[SITOA_SHADERS, SITOA_SHADERS_PRJ, SITOA_OSL_SHADERS] = env.SConscript(os.path.join('shaders', 'src', 'SConscript'),
variant_dir = os.path.join(BUILD_BASE_DIR, 'shaders'),
duplicate = 0,
exports = 'env')
Expand Down Expand Up @@ -338,7 +338,7 @@ else:
duplicate = 0,
exports = 'env')

SITOA_SHADERS = env.SConscript(os.path.join('shaders', 'src', 'SConscript'),
[SITOA_SHADERS, SITOA_OSL_SHADERS] = env.SConscript(os.path.join('shaders', 'src', 'SConscript'),
variant_dir = os.path.join(BUILD_BASE_DIR, 'shaders'),
duplicate = 0,
exports = 'env')
Expand Down Expand Up @@ -397,6 +397,9 @@ else:
PACKAGE_FILES = [
[os.path.join(plugin_binary_path, 'sitoa', DLLS), os.path.join(addon_path, bin_path)],
[os.path.join(plugin_binary_path, 'shaders', DLLS), os.path.join(addon_path, bin_path)],
[os.path.join(plugin_binary_path, 'shaders', 'osl', '*.oso'), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, 'ADPClientService%s' % get_executable_extension()), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, 'AdpSDKUtil%s' % get_executable_extension()), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, 'ArnoldLicenseManager%s' % get_executable_extension()), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, 'kick%s' % get_executable_extension()), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, 'maketx%s' % get_executable_extension()), os.path.join(addon_path, bin_path)],
Expand All @@ -408,6 +411,7 @@ PACKAGE_FILES = [
[os.path.join(ARNOLD_BINARIES, '*%s.*' % get_library_extension()), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, '*.pit'), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, '*.png'), os.path.join(addon_path, bin_path)],
[os.path.join(ARNOLD_BINARIES, 'senddmp'), os.path.join(addon_path, bin_path, 'senddmp')],
[ARNOLD_OCIO, os.path.join(addon_path, bin_path, '..', 'ocio')],
[ARNOLD_PLUGINS, os.path.join(addon_path, bin_path, '..', 'plugins')],
[os.path.join('plugins', 'helpers', '*.js'), os.path.join(addon_path, plugins_path)],
Expand Down Expand Up @@ -485,10 +489,14 @@ def make_patch_adlm(target, source, env):

def patch_adlm(wg_bin_path, env):
new_adlmint_last_char = '2' # ONLY ONE CHARACTER
size = 0

if system.os() == 'windows':
adclmhub_name = find_adclmhub(wg_bin_path, 'AdClmHub_')
if adclmhub_name == 'AdClmHub_2.0.0.dll':
if adclmhub_name == 'AdClmHub_3.1.1.dll':
size = 498696
seek_pos = 0x57F6C
elif adclmhub_name == 'AdClmHub_2.0.0.dll':
size = 524128
seek_pos = 367692
elif adclmhub_name == 'AdClmHub_1.1.1.dll':
Expand Down Expand Up @@ -536,7 +544,7 @@ def patch_adlm(wg_bin_path, env):
with open(adclmhub_path, 'r+b') as f:
f.seek(seek_pos)
letter = f.read(1)
if letter == 't':
if letter != new_adlmint_last_char:
print 'Patching {} ...'.format(adclmhub_name)
f.seek(seek_pos)
f.write(new_adlmint_last_char)
Expand Down Expand Up @@ -564,7 +572,8 @@ PATCH = env.Patch('patch', SITOA)
################################

env.Install(os.path.join(env['TARGET_WORKGROUP_PATH'], bin_path), [str(SITOA[0]),
str(SITOA_SHADERS[0])])
str(SITOA_SHADERS[0]),
SITOA_OSL_SHADERS])

env.Install(os.path.join(env['TARGET_WORKGROUP_PATH'], bin_path), [glob.glob(os.path.join(ARNOLD_BINARIES, '*'))])
env.Install(os.path.join(env['TARGET_WORKGROUP_PATH'], bin_path, '..', 'ocio'), [glob.glob(os.path.join(ARNOLD_OCIO, '*'))])
Expand Down Expand Up @@ -604,6 +613,7 @@ top_level_alias(env, 'testsuite', TESTSUITE)
env.AlwaysBuild(PACKAGE)
env.AlwaysBuild('install')

env.Depends(SITOA_SHADERS, SITOA_OSL_SHADERS)
env.Depends(PACKAGE, SITOA)
env.Depends(PACKAGE, SITOA_SHADERS)
env.Depends(DEPLOY, PACKAGE)
Expand Down
19 changes: 14 additions & 5 deletions abuild.bat
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
@echo off
set py=python

REM Use python launcher if it's found in PATH.
REM Use python launcher if python isn't found in PATH.
WHERE python >nul 2>nul
IF NOT ERRORLEVEL 1 GOTO :usepython

WHERE py >nul 2>nul
IF NOT ERRORLEVEL 1 (
set "py=py -2"
)
IF NOT ERRORLEVEL 1 GOTO :usepy

:usepython
set py=python
GOTO :end

:usepy
set "py=py -2"
GOTO :end

:end
@echo on

@REM invokes a local install of scons (forwarding all arguments)
Expand Down
2 changes: 1 addition & 1 deletion config/custom_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SHCXX = r'/usr/bin/gcc-4.2.4/bin/gcc-4.2.4'

XSISDK_ROOT = r'/usr/Softimage/Softimage_2015/XSISDK'
ARNOLD_HOME = r'/usr/SolidAngle/Arnold-7.0.0.0/linux'
ARNOLD_HOME = r'/usr/SolidAngle/Arnold-7.1.4.0/linux'

TARGET_WORKGROUP_PATH = './dist/Softimage_2015/Addons/SItoA'

Expand Down
2 changes: 1 addition & 1 deletion config/custom_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
WINDOWS_KIT = r'C:/Program Files (x86)/Windows Kits/10'

XSISDK_ROOT = r'C:/Program Files/Autodesk/Softimage 2015 SP2/XSISDK'
ARNOLD_HOME = r'C:/SolidAngle/Arnold-7.0.0.0-windows'
ARNOLD_HOME = r'C:/SolidAngle/Arnold-7.1.4.0-windows'

TARGET_WORKGROUP_PATH = r'./dist/Softimage_2015/Addons/SItoA'

Expand Down
11 changes: 9 additions & 2 deletions open_dev_console.cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
@echo off

rem Windows helper script to open a dev console by simply dubble-clicking the batch file.
rem Windows helper script to set the environment and open a dev console by simply dubble-clicking the batch file.
rem Update the paths below to the locations that is correct for your system.

set sitoa_dev_cmd="C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.0
set "Path=C:\Users\lindg\DEV\Portable Python-2.7.17 x64\App\Python;%Path%"
set "Path=C:\Users\lindg\DEV\SolidAngle\Arnold-7.1.4.4-windows\bin;%Path%"
set "Path=%~dp0dist\Softimage_2015\Addons\SItoA\Application\Plugins\bin\nt-x86-64;%Path%"

set "ARNOLD_PLUGIN_PATH=%~dp0dist\Softimage_2015\Addons\SItoA\Application\Plugins\bin\nt-x86-64"

set sitoa_dev_cmd="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 -vcvars_ver=14.0

WHERE wt.exe /Q
if %ERRORLEVEL% NEQ 0 (
Expand Down
5 changes: 5 additions & 0 deletions plugins/helpers/ArnoldMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ function AddHelpSubMenu(in_menu)
item = in_menu.AddCallbackItem("Licensing Home", "OnHelpMenu");
item = in_menu.AddCallbackItem("Licensing", "OnHelpMenu");
item = in_menu.AddSeparatorItem();
item = in_menu.AddCallbackItem("ADP Settings", "OnHelpMenu");
item = in_menu.AddSeparatorItem();
item = in_menu.AddCallbackItem("Legal Notice", "OnHelpMenu");
item = in_menu.AddCallbackItem("About SItoA", "OnHelpMenu");
}
Expand Down Expand Up @@ -416,6 +418,9 @@ function OnHelpMenu(in_ctxt)
case "Licensing":
Licensing();
return;
case "ADP Settings":
SITOA_ADPSettings();
return;
case "Legal Notice":
LegalNotice();
return;
Expand Down
7 changes: 3 additions & 4 deletions plugins/helpers/ArnoldProperties.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,7 @@ function AddParamsShape(in_prop)
function AddParamsCurve(in_prop, strands)
{
in_prop.AddParameter2("mode", siString, "ribbon", null, null, null, null, 0, siPersistable|siAnimatable);
in_prop.AddParameter2("basis", siString, "catmull-rom", null, null, null, null, 0, siPersistable|siAnimatable);
in_prop.AddParameter2("min_pixel_width", siFloat, 0.25, 0, 2, 0, 2, 0, siPersistable|siAnimatable);
}

Expand Down Expand Up @@ -781,7 +782,8 @@ function arnold_parameters_DefineLayout(io_Context)
{
xsiLayout.AddGroup("Arnold Curves Parameters", true, 50);
xsiLayout.AddItem("min_pixel_width", "Min. Pixel Width");
xsiLayout.AddEnumControl( "mode", Array( "Ribbon", "ribbon", "Thick", "thick", "Oriented Ribbon (ICE Strands)", "oriented"), "Mode", siControlCombo);
xsiLayout.AddEnumControl("mode", Array("Ribbon", "ribbon", "Thick", "thick", "Oriented Ribbon (ICE Strands)", "oriented"), "Mode", siControlCombo);
xsiLayout.AddEnumControl("basis", Array("B-Spline", "b-spline", "Catmull-Rom (ICE Strands)", "catmull-rom", "Linear", "linear"), "Basis", siControlCombo);
xsiLayout.EndGroup();
}
catch(exception)
Expand Down Expand Up @@ -1281,9 +1283,6 @@ function arnold_parameters_adaptive_subdivision_OnChanged()

function arnold_parameters_mode_OnChanged()
{
if (PPG.mode.Value=="thick")
PPG.min_pixel_width.Value = 0;

PPG.min_pixel_width.Enable(PPG.mode.Value=="ribbon" || PPG.mode.Value=="oriented");
}

Expand Down
15 changes: 15 additions & 0 deletions plugins/sitoa/common/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,21 @@ SITOA_CALLBACK SITOA_ShowMac_Execute(CRef& in_ctxt)
}


SITOA_CALLBACK SITOA_ADPSettings_Init(CRef& in_ctxt)
{
Context ctxt(in_ctxt);
Command oCmd = ctxt.GetSource();
oCmd.EnableReturnValue(false);
oCmd.SetFlag(siNoLogging, true);
return CStatus::OK;
}

SITOA_CALLBACK SITOA_ADPSettings_Execute(CRef& in_ctxt)
{
Context ctxt(in_ctxt);
AiADPDisplayDialogWindow();
return CStatus::OK;
}


// Run pitreg
Expand Down
29 changes: 25 additions & 4 deletions plugins/sitoa/common/ParamsShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ CRef GetParameterSource(const Parameter& in_param)
if (shader.GetShaderType() == siShader)
{
// we detect the output by the name out and result which is the most common case
if (shaderParam.GetScriptName() == L"out" || shaderParam.GetScriptName() == L"result" )
ShaderParamDef shaderParmDef = ShaderParameter(shaderParam).GetDefinition();
if (shaderParmDef.IsOutput())
target = shader.GetRef();
}

}
}
return target;
Expand Down Expand Up @@ -104,7 +104,9 @@ CStatus LoadShaderParameters(AtNode* in_node, CRefArray &in_paramsArray, double

// Ignoring Softimage nonused and output parameters
CString paramScriptName = param.GetScriptName();
if (paramScriptName.IsEqualNoCase(L"Name") || paramScriptName.IsEqualNoCase(L"out") || paramScriptName.IsEqualNoCase(L"result") )
ShaderParameter shaderParam(param);
ShaderParamDef paramDef = shaderParam.GetDefinition();
if (paramScriptName.IsEqualNoCase(L"Name") || paramDef.IsOutput())
continue;

// skip lights' filter plugs, they are loaded separately
Expand Down Expand Up @@ -194,7 +196,26 @@ CStatus LoadShaderParameter(AtNode* in_node, const CString &in_entryName, Parame
if (in_arrayElement != -1)
paramScriptName = in_arrayParamName + L"[" + CString(CValue(in_arrayElement).GetAsText()) + L"]";

AiNodeLink(shaderLinked, paramScriptName.GetAsciiString(), in_node);
const AtNodeEntry* node_entry = AiNodeGetNodeEntry(shaderLinked);
int num_outputs = AiNodeEntryGetNumOutputs(node_entry);
CString component = L"";

if (num_outputs > 1)
{
// if it's a multi output shader, we need to get the name of the source output.
ShaderParameter sourceParm = in_param.GetSource();
CRef parent = sourceParm.GetParent();
if (parent.IsA(siShaderID))
{
Shader parentShader(parent);
// if parent is a compound, we need to get the source
if (parentShader.GetShaderType() == siShaderCompound)
sourceParm = sourceParm.GetSource();
}
component = sourceParm.GetScriptName();
}

AiNodeLinkOutput(shaderLinked, component.GetAsciiString(), in_node, paramScriptName.GetAsciiString());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/sitoa/common/Tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace VERBOSITY
{
const int errors = AI_LOG_ERRORS | AI_LOG_TIMESTAMP | AI_LOG_MEMORY | AI_LOG_BACKTRACE;
const int warnings = AI_LOG_ERRORS | AI_LOG_TIMESTAMP | AI_LOG_MEMORY | AI_LOG_BACKTRACE | AI_LOG_WARNINGS;
const int info = AI_LOG_ERRORS | AI_LOG_TIMESTAMP | AI_LOG_MEMORY | AI_LOG_BACKTRACE | AI_LOG_WARNINGS | AI_LOG_INFO | AI_LOG_STATS | AI_LOG_PROGRESS;
const int info = AI_LOG_ERRORS | AI_LOG_TIMESTAMP | AI_LOG_MEMORY | AI_LOG_BACKTRACE | AI_LOG_WARNINGS | AI_LOG_INFO | AI_LOG_STATS | AI_LOG_PLUGINS | AI_LOG_PROGRESS;
const int all = AI_LOG_ALL;
};

Expand Down
4 changes: 3 additions & 1 deletion plugins/sitoa/loader/ICE.h
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,7 @@ class CIceObjectStrand : public CIceObjectBase, public CHair
AtArray* m_radius;
AtArray* m_orientations;
AtString m_mode; // thick...
AtString m_basis;
float m_minPixelWidth;
int m_nbPoints; // total number of points of the strand object, NOT of the Arnold node

Expand All @@ -807,6 +808,7 @@ class CIceObjectStrand : public CIceObjectBase, public CHair
m_radius = NULL;
m_orientations = NULL;
m_mode = AtString("thick");
m_basis = AtString("catmull-rom");
m_minPixelWidth = 0.0f;
m_nbPoints = 0;
}
Expand All @@ -816,7 +818,7 @@ class CIceObjectStrand : public CIceObjectBase, public CHair
}

CIceObjectStrand(const CIceObjectStrand &in_arg) :
CIceObjectBase(in_arg), CHair(in_arg), m_mode(in_arg.m_mode), m_minPixelWidth(in_arg.m_minPixelWidth), m_nbPoints(in_arg.m_nbPoints)
CIceObjectBase(in_arg), CHair(in_arg), m_mode(in_arg.m_mode), m_basis(in_arg.m_basis), m_minPixelWidth(in_arg.m_minPixelWidth), m_nbPoints(in_arg.m_nbPoints)
{
m_num_points = in_arg.m_num_points ? AiArrayCopy(in_arg.m_num_points) : NULL;
m_points = in_arg.m_points ? AiArrayCopy(in_arg.m_points) : NULL;
Expand Down
Loading