Integrating up through commit 90f050496

This commit is contained in:
alexpete
2021-04-07 14:03:29 -07:00
parent 8f2ed080a9
commit c2cbd430fe
2694 changed files with 285622 additions and 176874 deletions
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:12af868284907978494ea9e82004a4d11509aab1dc772b5a159614e26e6682b8
size 10259456
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fa7d1b5f34bf7b63a78d62cf7d59b24002fdfb4648182d76fe276347f7c20f32
size 11930624
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:62a5feec5e47cb0b6a41e7c1d15a8a39f9c26f58100cee32b94d66c757fac71e
size 12004352
@@ -1,18 +0,0 @@
@echo off
REM
REM All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
REM its licensors.
REM
REM REM For complete copyright and license terms please see the LICENSE at the root of this
REM distribution (the "License"). All use of this software is governed by the License,
REM or, if provided, by the license below or the license accompanying this file. Do not
REM remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM
REM
REM Provided as an example of how to run the Automated Launcher Test on a developer's local machine.
call ../../python/python.cmd run_launcher_tests_local_validation.py --dev-root-folder "../.." --project "StarterGame"
if %ERRORLEVEL% == 0 (
call ../../python/python.cmd run_launcher_tests_android.py --project-json-path "../../StarterGame/project.json" --project-launcher-tests-folder "../../StarterGame/LauncherTests"
)
@@ -1,13 +0,0 @@
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# Provided as an example of how to run the Automated Launcher Test on a developer's local machine.
../../python/python.sh run_launcher_tests_local_validation.py --dev-root-folder "../.." --project "StarterGame" || exit
# Current known limitation on iOS, only one test at a time is supported, see run_launcher_tests_ios.py run_test
../../python/python.sh run_launcher_tests_ios.py --project-json-path "../../StarterGame/project.json" --project-launcher-tests-folder "../../StarterGame/LauncherTests" --test-names "progress"
@@ -1,15 +0,0 @@
@echo off
REM
REM All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
REM its licensors.
REM
REM REM For complete copyright and license terms please see the LICENSE at the root of this
REM distribution (the "License"). All use of this software is governed by the License,
REM or, if provided, by the license below or the license accompanying this file. Do not
REM remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM
REM
REM Provided as an example of how to run the Automated Launcher Test on a developer's local machine.
../../python/python.cmd run_launcher_tests_win.py --project-json-path "../../MultiplayerSample/project.json" --project-launcher-tests-folder "../../MultiplayerSample/LauncherTests"
@@ -1,15 +0,0 @@
@echo off
REM
REM All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
REM its licensors.
REM
REM REM For complete copyright and license terms please see the LICENSE at the root of this
REM distribution (the "License"). All use of this software is governed by the License,
REM or, if provided, by the license below or the license accompanying this file. Do not
REM remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM
REM
REM Provided as an example of how to run the Automated Launcher Test on a developer's local machine.
../../python/python.cmd run_launcher_tests_win.py --project-json-path "../../StarterGame/project.json" --project-launcher-tests-folder "../../StarterGame/LauncherTests"
@@ -118,7 +118,7 @@ class AbstractResourceLocator(object):
def project(self):
"""
Return path to the project directory
ex. engine_root/dev/SamplesProject
ex. engine_root/dev/AutomatedTesting
:return: path to <engine_root>/dev/Project
"""
return os.path.join(self.dev(), self._project)
@@ -78,6 +78,8 @@ class AssetProcessor(object):
self._control_connection = None
self._function_name = None
self._failed_log_root = None
self._temp_log_directory = None
self._temp_log_root = None
self._disable_all_platforms = False
self._enabled_platform_overrides = dict()
@@ -96,7 +98,7 @@ class AssetProcessor(object):
"""
self.send_message("waitforidle")
result = self.read_message(read_timeout=timeout)
assert result == "idle", "Couldn't get idle state from AP"
assert result == "idle" or not self.process_exists(), f"Couldn't get idle state from AP, message {result}"
return True
def next_idle(self):
@@ -109,7 +111,7 @@ class AssetProcessor(object):
"""
self.send_message("signalidle")
result = self.read_message()
assert result == "idle", "Couldn't get idle state from AP"
assert result == "idle" or not self.process_exists(), f"Couldn't get idle state from AP, message {result}"
def send_quit(self):
"""
@@ -143,17 +145,17 @@ class AssetProcessor(object):
def read_message(self, read_timeout=DEFAULT_TIMEOUT_SECONDS):
"""
Read the next message from the AP Contorl socket. Must be running through gui_process/start method
Read the next message from the AP Control socket. Must be running through gui_process/start method
"""
if not self._ap_proc:
logger.warning("Attempted to read message to AP but not currently running")
return
return "no_process"
if not self._control_connection:
self.connect_control()
if not self._control_connection:
return
return "no_connection"
self._control_connection.settimeout(read_timeout)
try:
@@ -163,6 +165,8 @@ class AssetProcessor(object):
return result_message
except IOError as e:
logger.warning(f"Failed to read message from with error {e}")
return f"error_{e}"
def read_control_port(self):
@@ -178,15 +182,18 @@ class AssetProcessor(object):
start_time = time.time()
read_port_timeout = 10
while (time.time() - start_time) < read_port_timeout:
log = APLogParser(self._workspace.paths.ap_gui_log())
if len(log.runs):
try:
port = log.runs[-1][port_type]
if port:
logger.info(f"Read port type {port_type} : {port}")
return port
except:
pass
if not os.path.exists(self._workspace.paths.ap_gui_log()):
logger.debug(f"Log at {self._workspace.paths.ap_gui_log()} doesn't exist, sleeping")
else:
log = APLogParser(self._workspace.paths.ap_gui_log())
if len(log.runs):
try:
port = log.runs[-1][port_type]
if port:
logger.info(f"Read port type {port_type} : {port}")
return port
except:
pass
time.sleep(1)
logger.warning(f"Failed to read port type {port_type}")
return 0
@@ -201,8 +208,13 @@ class AssetProcessor(object):
"""
if not self._control_connection:
control_timeout = 60
return self.connect_socket("Control Connection", self.read_control_port,
try:
return self.connect_socket("Control Connection", self.read_control_port,
set_port_method=self.set_control_connection, timeout=control_timeout)
except AssetProcessorError as e:
# We dont want a failure of our test socket connection to fail the entire test automatically.
logger.error(f"Failed to connect control socket with error {e}")
pass
return True, None
def using_temp_workspace(self):
@@ -273,13 +285,13 @@ class AssetProcessor(object):
wait_timeout = timeout
try:
waiter.wait_for(lambda: not psutil.pid_exists(self.get_pid()), exc=AssetProcessorError, timeout=wait_timeout)
waiter.wait_for(lambda: not self.process_exists(), exc=AssetProcessorError, timeout=wait_timeout)
except AssetProcessorError:
logger.warning(f"Timeout attempting to quit asset processor after {wait_timeout} seconds, using terminate")
self.terminate()
raise
pass
if psutil.pid_exists(self.get_pid()):
if self.process_exists():
logger.warning(f"Failed to stop process {self.get_pid()} after {wait_timeout} seconds, using terminate")
self.terminate()
self._ap_proc = None
@@ -323,9 +335,9 @@ class AssetProcessor(object):
"""
Returns pid of asset processor proc currently executing the start command (Ap Gui)
:return: pid if exists, else 0
:return: pid if exists, else -1
"""
return self._ap_proc.pid if self._ap_proc else 0
return self._ap_proc.pid if self._ap_proc else -1
def get_process_list(self, name_filter: str = None):
"""
@@ -334,12 +346,13 @@ class AssetProcessor(object):
:param name_filter: Name to match against, such as AssetBuilder
:return: List of processes
"""
if not self._ap_proc or not self.get_pid():
my_pid = self.get_pid()
if my_pid is -1:
return []
return_list = []
try:
return_list = [psutil.Process(self.get_pid())]
return_list.extend(utils.child_process_list(self.get_pid()))
return_list = [psutil.Process(my_pid)]
return_list.extend(utils.child_process_list(my_pid))
except psutil.NoSuchProcess:
logger.warning("Process already finished calling get_process_list")
return return_list
@@ -400,9 +413,9 @@ class AssetProcessor(object):
def process_exists(self):
try:
my_pid = self.get_pid()
if my_pid == 0:
if my_pid == -1:
return False
return psutil.pid_exists(self.get_pid())
return psutil.pid_exists(my_pid)
except psutil.NoSuchProcess:
pass
return False
@@ -410,6 +423,7 @@ class AssetProcessor(object):
def batch_process(self, timeout=DEFAULT_TIMEOUT_SECONDS, fastscan=True, capture_output=False, platforms=None,
extra_params=None, add_gem_scan_folders=None, add_config_scan_folders=None, decode=True,
expect_failure=False, scan_folder_pattern=None):
self.create_temp_log_root()
ap_path = self._workspace.paths.asset_processor_batch()
command = self.build_ap_command(ap_path=ap_path, fastscan=fastscan, platforms=platforms,
extra_params=extra_params, add_gem_scan_folders=add_gem_scan_folders,
@@ -454,6 +468,7 @@ class AssetProcessor(object):
else:
extra_gui_params.append(extra_params)
self.create_temp_log_root()
command = self.build_ap_command(ap_path=ap_path, fastscan=fastscan, platforms=platforms,
extra_params=extra_gui_params, add_gem_scan_folders=add_gem_scan_folders,
add_config_scan_folders=add_config_scan_folders,
@@ -480,7 +495,7 @@ class AssetProcessor(object):
self.connect_listen()
if quitonidle:
waiter.wait_for(lambda: not psutil.pid_exists(self.get_pid()), timeout=timeout)
waiter.wait_for(lambda: not self.process_exists(), timeout=timeout)
elif run_until_idle and accept_input:
if not self.wait_for_idle():
return False, None
@@ -519,15 +534,17 @@ class AssetProcessor(object):
command.append(f'--regset="/Amazon/AzCore/Bootstrap/project_path={self._project_path}"')
# When using a scratch workspace we will set several options. The asset root controls where our
# cache lives, gives us a unique directory to place our logs in, and indicates we wish to randomize our
# cache lives.
# The logDir gives us a unique directory to place our logs in, and indicates we wish to randomize our
# listening port to avoid collisions. The port will be written to the logs which we'll retrieve it from
if self._temp_asset_root:
command.append("--assetroot")
command.append(f"{self._temp_asset_root}")
command.append("--logDir")
command.append(f"{self._temp_asset_root}")
command.append(f'--regset="/Amazon/AzCore/Bootstrap/project_cache_path={self.temp_project_cache_path()}"')
command.append("--randomListeningPort")
if self._temp_log_root:
command.append("--logDir")
command.append(f"{self._temp_log_root}")
if self._override_scan_folders:
command.append("--scanfolders")
command.append(f"{','.join(self._override_scan_folders)}")
@@ -699,11 +716,29 @@ class AssetProcessor(object):
self._temp_asset_directory = tempfile.TemporaryDirectory()
self._temp_asset_root = self._temp_asset_directory.name
self._copy_asset_root_files()
self._workspace.paths.set_ap_log_root(self._temp_asset_root)
self._project_path = os.path.join(self._temp_asset_root, self._workspace.project)
if project_scan_folder:
self.add_scan_folder(self._project_path)
def log_root(self):
"""
Return the temp log root
"""
return self._temp_log_root
def create_temp_log_root(self):
"""
Create a temp folder for logs. We want a unique temp folder for logs for each test using the AssetProcessor
test class rather than using the default logs folder which could contain any old data or be used by other
runs of asset processor.
"""
if self._temp_log_root:
logger.info(f'Cleaning up old log root at {self._temp_log_root}')
shutil.rmtree(self._temp_log_root, True)
self._temp_log_directory = tempfile.TemporaryDirectory()
self._temp_log_root = self._temp_log_directory.name
self._workspace.paths.set_ap_log_root(self._temp_log_root)
def add_scan_folder(self, folder_name) -> str:
"""
Add a new folder as one of the default folders which AP Batch should scan on the next run
@@ -51,7 +51,7 @@ def remote_console(request):
# Shared parameters & fixtures for all test methods inside the TestSystemExample class.
@pytest.mark.usefixtures("automatic_process_killer")
@pytest.mark.parametrize('project', ['SamplesProject'])
@pytest.mark.parametrize('project', ['AutomatedTesting'])
class TestSystemExample(object):
"""
Example test case class to hold a set of test case methods.
@@ -68,11 +68,11 @@ class TestSystemExample(object):
@pytest.mark.parametrize('level', ['simple_jacklocomotion'])
@pytest.mark.parametrize('load_wait', [120])
@pytest.mark.test_case_id('C16806863')
def test_SystemTestExample_AllSupportedPlatforms_LaunchSamplesProject(
def test_SystemTestExample_AllSupportedPlatforms_LaunchAutomatedTesting(
# launcher_platform, asset_processor_platform, # Re-add these here if you plan to use them.
self, launcher, remote_console, level, load_wait):
"""
Tests launching the SamplesProject then launches the Lumberyard client &
Tests launching the AutomatedTesting then launches the Lumberyard client &
loads the "simple_jacklocomotion" level using the remote console.
Assumes the user already setup & built their machine for the test.
"""
@@ -22,7 +22,6 @@ import pytest
import ly_test_tools._internal.managers.artifact_manager
pytestmark = pytest.mark.SUITE_smoke
TIMESTAMP_FORMAT = '%Y-%m-%dT%H-%M-%S-%f'
DATE = datetime.datetime.now().strftime(TIMESTAMP_FORMAT)
@@ -61,6 +61,7 @@ class TestAssetProcessor(object):
assert under_test._ap_proc is not None
mock_popen.assert_called_once_with([mock_ap_path, '--zeroAnalysisMode', '--regset="/Amazon/AzCore/Bootstrap/project_path=AutomatedTesting"',
'--logDir', under_test.log_root(),
'--acceptInput', '--platforms', 'bar'], cwd=os.path.dirname(mock_ap_path))
mock_connect.assert_called()
@@ -68,7 +69,8 @@ class TestAssetProcessor(object):
@mock.patch('subprocess.Popen')
@mock.patch('os.path.basename', mock.MagicMock(return_value=""))
@mock.patch('os.path.dirname', mock.MagicMock(return_value=""))
@mock.patch('ly_test_tools.environment.process_utils.kill_processes_with_name_not_started_from', mock.MagicMock(return_value=None))
@mock.patch('ly_test_tools.environment.process_utils.kill_processes_with_name_not_started_from',
mock.MagicMock(return_value=None))
@mock.patch('ly_test_tools.environment.process_utils.process_exists', mock.MagicMock(return_value=True))
@mock.patch('socket.socket.connect')
def test_Start_ProcAlreadyRunning_ProcNotChanged(self, mock_connect, mock_popen, mock_workspace):
@@ -101,7 +103,6 @@ class TestAssetProcessor(object):
mock_waiter.assert_called_once()
assert under_test._ap_proc is None
@mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager')
@mock.patch('subprocess.run')
def test_BatchProcess_NoFastscanBatchCompletes_Success(self, mock_run, mock_workspace):
@@ -112,7 +113,8 @@ class TestAssetProcessor(object):
result, _ = under_test.batch_process(1, False)
assert result
mock_run.assert_called_once_with([apb_path], close_fds=True, capture_output=False,
mock_run.assert_called_once_with([apb_path, '--logDir', under_test.log_root()],
close_fds=True, capture_output=False,
timeout=1)
@mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager')
@@ -126,9 +128,13 @@ class TestAssetProcessor(object):
result = under_test.batch_process(1, True)
assert result
mock_run.assert_called_once_with([apb_path, '--zeroAnalysisMode', '--regset="/Amazon/AzCore/Bootstrap/project_path=AutomatedTesting"'],
close_fds=True, capture_output=False,
timeout=1)
mock_run.assert_called_once_with(
[apb_path, '--zeroAnalysisMode', '--regset="/Amazon/AzCore/Bootstrap/project_path=AutomatedTesting"',
'--logDir',
under_test.log_root()],
close_fds=True, capture_output=False,
timeout=1)
@mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager')
@mock.patch('subprocess.run')
@@ -141,8 +147,8 @@ class TestAssetProcessor(object):
result, _ = under_test.batch_process(None, False)
assert not result
mock_run.assert_called_once_with([apb_path], close_fds=True, capture_output=False, timeout=28800.0)
mock_run.assert_called_once_with([apb_path, '--logDir', under_test.log_root()],
close_fds=True, capture_output=False, timeout=28800.0)
@mock.patch('ly_test_tools._internal.managers.workspace.AbstractWorkspaceManager')
def test_EnableAssetProcessorPlatform_AssetProcessorObject_Updated(self, mock_workspace):
@@ -181,5 +187,3 @@ class TestAssetProcessor(object):
mock_stop.assert_called()
mock_restore_ap.assert_called()
@@ -138,9 +138,9 @@ class TestFixtures(object):
@mock.patch("ly_test_tools.builtin.helpers.create_builtin_workspace")
def test_Workspace_MockFixturesAndExecTeardown_ReturnWorkspaceRegisterTeardown(self, mock_create, mock_setup):
test_module = 'example.tests.test_system_example'
test_class = ('TestSystemExample.test_SystemTestExample_AllSupportedPlatforms_LaunchSamplesProject'
'[120-simple_jacklocomotion-SamplesProject-all-profile-win_x64_vs2017]')
test_method = 'test_SystemTestExample_AllSupportedPlatforms_LaunchSamplesProject'
test_class = ('TestSystemExample.test_SystemTestExample_AllSupportedPlatforms_LaunchAutomatedTesting'
'[120-simple_jacklocomotion-AutomatedTesting-all-profile-win_x64_vs2017]')
test_method = 'test_SystemTestExample_AllSupportedPlatforms_LaunchAutomatedTesting'
artifact_folder_name = 'TheArtifactFolder'
artifact_path = "PathToArtifacts"
@@ -183,7 +183,7 @@ class TestFixtures(object):
mock_workspace.artifact_manager.generate_folder_name.assert_called_with(
test_module.split('.')[-1], # 'example.tests.test_system_example' -> 'test_system_example'
test_class.split('.')[0], # 'TestSystemExample.test_SystemTestExample_...' -> 'TestSystemExample'
test_method # 'test_SystemTestExample_AllSupportedPlatforms_LaunchSamplesProject'
test_method # 'test_SystemTestExample_AllSupportedPlatforms_LaunchAutomatedTesting'
)
@mock.patch('os.path.exists', mock.MagicMock(return_value=True))
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:22384a5b5ce513704462873caeeb7dadf021a24151a30a575b2fdbc0cd5fda4f
size 859136
-90
View File
@@ -1,90 +0,0 @@
<?xml version='1.0' ?>
<!--
============================ Quick Guide =======================================
File: filters.xml
Author: Dario Sancho (2014)
Important: This file neesd to be placed in the executable's folder.
This file allows you to define your own filters and associated accions.
Feel free to add/remove/modify the contents of this file to suit your needs.
The initial content is intended to be an example of usage.
How does this work?
* <Filter Name="Example">
This attribute is used to specify the filter. In this example, any log that
contains the word "Example" will be added to this filter's tab.
* <Label>My Example</Label>
This parameter is optional. If included it will be used to label the filter Tab.
Otherwise, the "Name" attribute in Filter will be used.
* <Color>FF0000</Color>
Optional. Specifies the color of the text in the filter. Format R8G8B8.
* <RegExp>\!(\w*)\]</RegExp>
Optional. Specifies a regular expression to be used as filter. The given example
would would added to this filter's tab any log that contains something of the
kind "...!....]", i.e. has an exclamation mark and at certain point later a "]"
* <Exec Type="DosCmd">dir c:</Exec>
Optional. Specifies an action to be taken if a particular filter is activated.
It can be used for instance to trigger a snapshot or a video when certain log
message is sent (e.g. a debugging message).
It can be very useful for debugging and QA.
There are two types of actions that can be executed:
+ <Exec Type="Macro">ScreenShot</Exec>
Executes a Macro (in this case ScreenShot, defined in this file)
+ <Exec Type="DosCmd">dir c:</Exec>
Executes a dos command (in this case "dir c:")
-->
<Filters>
<Filter Name="RegExp">
<Color>#000088</Color>
<RegExp>\!(\w*)\]</RegExp>
<!-- Exec Type="DosCmd">dir c:</Exec -->
</Filter>
<Filter Name="ApplicationView">
<Label>ApplicationViewSource</Label>
<Color>FF8C00</Color>
<!-- Exec Type="DosCmd">dir c:</Exec -->
</Filter>
<Filter Name="OnPLMEvent">
<Label>OnPLMEvent</Label>
<Color>#000000</Color>
<!-- Exec Type="Macro">ScreenShot</Exec -->
</Filter>
<!--Filter Name="Loading">
<Label>Loading</Label>
<Color>#0022FF</Color>
</Filter-->
<Filter Name="Actor">
<Label>Actor</Label>
<Color>#000000</Color>
</Filter>
<Filter Name="[CG]">
<Label>Color Grading</Label>
<Color>#000000</Color>
</Filter>
<Filter Name="GFE">
<Label>GeForce Experience</Label>
<Color>#000000</Color>
</Filter>
<Filter Name="MipMapped">
<Label>MipMapped</Label>
<Color>#000000</Color>
</Filter>
</Filters>
-193
View File
@@ -1,193 +0,0 @@
<?xml version='1.0' ?>
<root>
<Definitions>
<Definition group="Macros" type="MenuMacro"/>
<Definition group="GamePlays" type="MenuGamePlay"/>
<Definition group="Buttons" type="ButtonMacro"/>
<Definition group="Sliders" type="SliderMacro"/>
<Definition group="Toggles" type="ToggleMacro"/>
<Definition group="Targets" type="MenuTarget"/>
</Definitions>
<Parameters>
<!-- ============= TARGETS ============== -->
<Targets>
<Target name="PC" ip="localhost" port="4600"/>
<Target name="Provo" ip="10.11.110.202" port="4600"/>
</Targets>
<!-- ============= Macros ============== -->
<Generic>
<Item name="Enable Profile Info" midi="37" pad="0">
<CVar>r_displayInfo=1</CVar>
<CVar>profile=1</CVar>
</Item>
<Item name="Disable Profile Info" midi="36" pad="0">
<CVar>r_displayInfo=0</CVar>
<CVar>profile=0</CVar>
</Item>
<Item name="Disable InFa/InPak">
<CVar>sys_pakloginvalidFileAccess 0</CVar>
</Item>
<Item name="ScreenShot">
<CVar>r_getscreenshot 2</CVar>
</Item>
<Item name="Enable Time Of Day" midi="66" pad="1">
<CVar>sv_timeofdayenabled 1</CVar>
</Item>
</Generic>
<!-- ============= Macros ============== -->
<WF1 icon="s1-dice.png">
<Item name="CG ON">
<CVar>r_displayinfo 0</CVar>
<CVar>/g_cheats 1</CVar>
<CVar>/g_godMode 1</CVar>
<CVar>r_colorgradingchartimage 'chr' textures/colorcharts/kosovo2.dds</CVar>
<CVar>r_ColorGradingCharts 2</CVar>
</Item>
<Item name="CG ON - Test">
<CVar>r_displayinfo 0</CVar>
<CVar>/g_cheats 1</CVar>
<CVar>/g_godMode 1</CVar>
<CVar>r_colorgradingchartimage 'chr' textures/colorcharts/default_char_l2_cch.tif</CVar>
<CVar>r_colorgradingchartimage 'env' textures/colorcharts/default_env_cch.tif</CVar>
</Item>
<Item name="CG OFF">
<CVar>r_colorgradingchartimage 'chr'</CVar>
<CVar>r_colorgradingchartimage 'env'</CVar>
</Item>
<Item name="CG MT on">
<CVar>r_ColorGradingMultiTarget 1</CVar>
</Item>
<Item name="CG MT off">
<CVar>r_ColorGradingMultiTarget 0</CVar>
</Item>
<Item name="Auto-gen MIPS">
<CVar>r_autogenMips 1</CVar>
</Item>
<Item name="Auto-gen MIPS - Disable">
<CVar>r_autogenMips 0</CVar>
</Item>
</WF1>
<!-- ============= Macros ============== -->
<MacrosOther>
<Item name="Disable Archers Grammar" midi="49" pad="1">
<CVar>i_grammar_enable archers 0</CVar>
</Item>
<Item name="Debug Input On">
<CVar>i_debugdigitalButtons 127</CVar>
</Item>
</MacrosOther>
<!-- ============= GamePlay ============== -->
<GamePlays>
<Item name="Camera 3P">
<CVar>SetViewMode:0</CVar>
</Item>
<Item name="Camera FP">
<CVar>SetViewMode:1</CVar>
</Item>
<Item name="Camera Orbit">
<CVar>SetViewMode:2</CVar>
</Item>
<Item name="Goto">
<CVar>GotoTagPoint:0</CVar>
</Item>
</GamePlays>
<!-- ============= Macros ============== -->
<Maps>
<Item name="Airfield">
<CVar>map airfield</CVar>
</Item>
<Item name="Forest">
<CVar>map forest</CVar>
</Item>
</Maps>
<!-- ============= Buttons ============== -->
<Buttons>
<Item name="Screen Shot" icon="s1-camera.png">>
<CVar>r_getscreenshot 2</CVar>
</Item>
<Item name="Record Clip" icon="s1-film.png">>
<CVar>RecordClip</CVar>
</Item>
</Buttons>
<!-- ============= Sliders ============== -->
<Sliders onMenu="true">
<Item name="Log Verbosity" min="0" max="5" delta="1" forceInt="true">
<CVar>log_verbosity #</CVar>
</Item>
<Item name="Time Scale" min="0" max="3.5" delta="0.1" default="2" midi="0" pad="1">
<CVar>t_scale #</CVar>
</Item>
<Item name="Fov" min="20" max="80" delta="5" default="55" midi="1" pad="1">
<CVar>cl_fov #</CVar>
</Item>
<Item name="Render Width" min="320" max="1600" delta="100" default="1600">
<CVar>r_width #</CVar>
</Item>
<Item name="Render Height" min="200" max="900" delta="100" default="900">
<CVar>r_height #</CVar>
</Item>
<Item name="Time of Day" min="0" max="24" delta="0.02" default="12" midi="18" pad="1">
<CVar>e_TimeOfDay #</CVar>
</Item>
<Item name="Input Debug Info" min="0" max="127" delta="1" default="0" forceInt="true" midi="19" pad="1">
<CVar>i_debugdigitalButtons #</CVar>
</Item>
</Sliders>
<Toggles onMenu="true">
<Item group="WF1-Multi Color Grading" name="Enable" on="1" off="0">
<CVar>r_colorgradingmultitarget #</CVar>
</Item>
<Item group="WF1-Multi Color Grading" name="Show Charts" on="2" off="0">
<CVar>r_colorgradingcharts #</CVar>
</Item>
<Item group="Debug Info" name="Display Info" on="1" off="0">
<CVar>r_displayInfo #</CVar>
</Item>
<Item group="Profile" name="Enable" on="1" off="0">
<CVar>profile #</CVar>
</Item>
<Item group="Shadows Cascade" name="Debug" on="1" off="0">
<CVar>e_ShadowsCascadesDebug #</CVar>
</Item>
<Item group="Shadows Cascade" name="Static Map level" on="2" off="0">
<CVar>r_ShadowsStaticMap #</CVar>
</Item>
</Toggles>
</Parameters>
</root>
@@ -0,0 +1,44 @@
@ECHO OFF
REM
REM All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
REM its licensors.
REM
REM For complete copyright and license terms please see the LICENSE at the root of this
REM distribution (the "License"). All use of this software is governed by the License,
REM or, if provided, by the license below or the license accompanying this file. Do not
REM remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM
SETLOCAL EnableDelayedExpansion
CALL %~dp0gradle_windows.cmd
IF NOT %ERRORLEVEL%==0 GOTO :error
IF NOT EXIST "%LY_3RDPARTY_PATH%" (
ECHO [ci_build] LY_3RDPARTY_PATH is invalid or not set
GOTO :error
)
IF NOT EXIST "%LY_ANDROID_SDK%" (
SET LY_ANDROID_SDK=!LY_3RDPARTY_PATH!/android-sdk/platform-29
)
IF NOT EXIST "%LY_ANDROID_SDK%" (
ECHO [ci_build] FAIL: LY_ANDROID_SDK=!LY_ANDROID_SDK!
GOTO :error
)
SET PYTHON=python\python.cmd
ECHO [ci_build] %PYTHON% Tools\build\JenkinsScripts\build\Platform\Android\run_test_on_android_simulator.py --android-sdk-path %LY_ANDROID_SDK% --build-path %OUTPUT_DIRECTORY% --build-config %CONFIGURATION%
CALL %PYTHON% Tools\build\JenkinsScripts\build\Platform\Android\run_test_on_android_simulator.py --android-sdk-path %LY_ANDROID_SDK% --build-path %OUTPUT_DIRECTORY% --build-config %CONFIGURATION%
IF NOT %ERRORLEVEL%==0 GOTO :popd_error
EXIT /b 0
:popd_error
POPD
:error
ECHO ERROR
EXIT /b 1
@@ -141,7 +141,28 @@
"OUTPUT_DIRECTORY":"build\\android_gradle",
"GAME_PROJECT": "AutomatedTesting",
"ANDROID_NDK_PLATFORM": "21",
"ANDROID_SDK_PLATFORM": "29"
"ANDROID_SDK_PLATFORM": "29",
"SIGN_APK": "false",
"GRADLE_BUILD_CMD": "build",
"ADDITIONAL_GENERATE_ARGS": ""
}
},
"periodic_test_profile": {
"TAGS":[
"nightly",
"weekly-build-metrics"
],
"COMMAND":"build_and_run_unit_tests.cmd",
"PARAMETERS": {
"CONFIGURATION":"profile",
"OUTPUT_DIRECTORY":"build\\android_unittest",
"GAME_PROJECT": "AutomatedTesting",
"ANDROID_NDK_PLATFORM": "21",
"ANDROID_SDK_PLATFORM": "29",
"SIGN_APK": "true",
"GRADLE_BUILD_CMD": "assemble",
"ADDITIONAL_GENERATE_ARGS": "--unit-test"
}
}
}
@@ -10,6 +10,8 @@ REM remove or modify any license notices. This file is distributed on an "AS IS"
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM
SETLOCAL EnableDelayedExpansion
IF NOT EXIST "%LY_3RDPARTY_PATH%" (
ECHO [ci_build] LY_3RDPARTY_PATH is invalid or not set
GOTO :error
@@ -40,19 +42,27 @@ IF NOT EXIST "%LY_NINJA_PATH%" (
GOTO :error
)
REM Make sure that Ninja in the Path variable
ECHO Testing ninja on the current path variable
call ninja --version
IF %ERRORLEVEL%==0 GOTO ninja_on_path
ECHO Ninja wasnt in the call path, add the value set by LY_NINJA_PATH
SET PATH=%PATH%;%LY_NINJA_PATH%
:ninja_on_path
IF NOT EXIST "%LY_ANDROID_SDK%" (
SET LY_ANDROID_SDK=%LY_3RDPARTY_PATH%/android-sdk/platform-29
SET LY_ANDROID_SDK=!LY_3RDPARTY_PATH!/android-sdk/platform-29
)
IF NOT EXIST "%LY_ANDROID_SDK%" (
ECHO [ci_build] FAIL: LY_ANDROID_SDK=%LY_ANDROID_SDK%
ECHO [ci_build] FAIL: LY_ANDROID_SDK=!LY_ANDROID_SDK!
GOTO :error
)
IF NOT EXIST "%LY_ANDROID_NDK%" (
set LY_ANDROID_NDK=%LY_3RDPARTY_PATH%/android-ndk/r21d
set LY_ANDROID_NDK=!LY_3RDPARTY_PATH!/android-ndk/r21d
)
IF NOT EXIST "%LY_ANDROID_NDK%" (
ECHO [ci_build] LY_ANDROID_NDK=%LY_ANDROID_NDK%
ECHO [ci_build] LY_ANDROID_NDK=!LY_ANDROID_NDK!
GOTO :error
)
@@ -61,7 +71,7 @@ IF "%CLEAN_OUTPUT_DIRECTORY%"=="true" (
IF EXIST %OUTPUT_DIRECTORY% (
ECHO [ci_build] CLEAN_OUTPUT_DIRECTORY option set with value "%CLEAN_OUTPUT_DIRECTORY%"
ECHO [ci_build] Deleting "%OUTPUT_DIRECTORY%"
DEL /s /q /f %OUTPUT_DIRECTORY%
DEL /s /q /f %OUTPUT_DIRECTORY% 1>nul
)
)
@@ -73,27 +83,134 @@ REM Jenkins reports MSB8029 when TMP/TEMP is not defined, define a dummy folder
SET TMP=%cd%/temp
SET TEMP=%cd%/temp
IF NOT EXIST %TMP% (
mkdir temp
mkdir %TMP%
)
SET PYTHON=python\python.cmd
ECHO [ci_build] %PYTHON% cmake\Tools\Platform\Android\generate_android_project.py --project-path=%GAME_PROJECT% --engine-root=. --build-dir=%OUTPUT_DIRECTORY% --gradle-install-path=%GRADLE_HOME% --cmake-install-path=%CMAKE_HOME% --ninja-install-path=%LY_NINJA_PATH% --third-party-path=%LY_3RDPARTY_PATH% --android-ndk-path=%LY_ANDROID_NDK% --android-sdk-path=%LY_ANDROID_SDK% --android-ndk-version=%ANDROID_NDK_PLATFORM% --android-sdk-version=%ANDROID_SDK_PLATFORM%
CALL %PYTHON% cmake\Tools\Platform\Android\generate_android_project.py --project-path="%GAME_PROJECT%" --engine-root=. --build-dir="%OUTPUT_DIRECTORY%" --gradle-install-path="%GRADLE_HOME%" --cmake-install-path="%CMAKE_HOME%" --ninja-install-path="%LY_NINJA_PATH%" --third-party-path="%LY_3RDPARTY_PATH%" --android-ndk-path="%LY_ANDROID_NDK%" --android-sdk-path="%LY_ANDROID_SDK%" --android-ndk-version=%ANDROID_NDK_PLATFORM% --android-sdk-version=%ANDROID_SDK_PLATFORM%
IF NOT %ERRORLEVEL%==0 GOTO :error
REM Optionally sign the APK if we are generating an APK
SET GENERATE_SIGNED_APK=false
IF "%SIGN_APK%"=="true" (
IF "%GRADLE_BUILD_CMD%"=="assemble" (
SET GENERATE_SIGNED_APK=true
)
)
SET PYTHON=python\python.cmd
REM Regardless of whether or not we generate a signing key, apparently we must set variables outside of
REM an IF clause otherwise it will not work.
REM First look for the JDK HOME in the environment variable
IF EXIST "%JDK_HOME%" (
ECHO JDK Home found in Environment: !JDK_HOME!
GOTO JDK_FOUND
)
REM Next, look in the registry
FOR /F "skip=2 tokens=1,2*" %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.8" /v "JavaHome" 2^>nul') DO (
SET JDK_REG_VALUE=%%C
)
IF EXIST "%JDK_REG_VALUE%" (
SET JDK_HOME=!JDK_REG_VALUE!
ECHO JDK Home found in registry: !JDK_HOME!
GOTO JDK_FOUND
)
ECHO Unable to locate JDK_HOME
GOTO error
:JDK_FOUND
SET JDK_BIN=%JDK_HOME%\bin
IF NOT EXIST "%JDK_BIN%" (
ECHO The environment variable JDK_HOME is not set to a valid JDK 1.8 folder %JDK_BIN%
ECHO Make sure the variable is set to your local JDK 1.8 installation
GOTO error
)
SET KEYTOOL_PATH=%JDK_BIN%\keytool.exe
IF NOT EXIST "%KEYTOOL_PATH%" (
ECHO The environment variable JDK_HOME is not set to a valid JDK 1.8 folder. Cannot find keytool at %JDK_BIN%\keytool.exe
ECHO Make sure the variable is set to your local JDK 1.8 installation
GOTO error
)
SET CI_ANDROID_KEYSTORE_FILE=ly-android-dev.keystore
SET CI_ANDROID_KEYSTORE_ALIAS=ly-android
SET CI_ANDROID_KEYSTORE_PASSWORD=lumberyard
SET CI_ANDROID_KEYSTORE_DN=cn=LY Developer, ou=Lumberyard, o=Amazon, c=US
SET CI_KEYSTORE_VALIDITY_DAYS=10000
SET CI_KEYSTORE_CERT_DN=cn=LY Developer, ou=Lumberyard, o=Amazon, c=US
REM Clear out any existing keystore file since the password/alias may have changed
SET CI_ANDROID_KEYSTORE_FILE_ABS=%cd%\%OUTPUT_DIRECTORY%\%CI_ANDROID_KEYSTORE_FILE%
IF "%GENERATE_SIGNED_APK%"=="true" (
REM Prepare a temporary keystore just for this unit test session
REM Generate the keystore file if needed
IF NOT EXIST "%CI_ANDROID_KEYSTORE_FILE_ABS%" (
ECHO [ci_build] Generating keystore file %CI_ANDROID_KEYSTORE_FILE%
ECHO [ci_build] "%KEYTOOL_PATH%" -genkeypair -v -keystore %CI_ANDROID_KEYSTORE_FILE_ABS% -storepass %CI_ANDROID_KEYSTORE_PASSWORD% -alias %CI_ANDROID_KEYSTORE_ALIAS% -keypass %CI_ANDROID_KEYSTORE_PASSWORD% -keyalg RSA -keysize 2048 -validity %CI_KEYSTORE_VALIDITY_DAYS% -dname "%CI_KEYSTORE_CERT_DN%"
CALL "%KEYTOOL_PATH%" -genkeypair -v -keystore %CI_ANDROID_KEYSTORE_FILE_ABS% -storepass %CI_ANDROID_KEYSTORE_PASSWORD% -alias %CI_ANDROID_KEYSTORE_ALIAS% -keypass %CI_ANDROID_KEYSTORE_PASSWORD% -keyalg RSA -keysize 2048 -validity %CI_KEYSTORE_VALIDITY_DAYS% -dname "%CI_KEYSTORE_CERT_DN%" 2> nul
IF errorlevel 1 (
ECHO Unable to generate keystore file "%CI_ANDROID_KEYSTORE_FILE_ABS%"
GOTO error
)
) ELSE (
ECHO Using keystore file at %CI_ANDROID_KEYSTORE_FILE_ABS%
)
ECHO [ci_build] %PYTHON% cmake\Tools\Platform\Android\generate_android_project.py --engine-root=. --build-dir=%OUTPUT_DIRECTORY% -g %GAME_PROJECT% --gradle-install-path=%GRADLE_HOME% --cmake-install-path=%CMAKE_HOME% --ninja-install-path=%LY_NINJA_PATH% --third-party-path=%LY_3RDPARTY_PATH% --android-ndk-path=%LY_ANDROID_NDK% --android-sdk-path=%LY_ANDROID_SDK% --android-ndk-version=%ANDROID_NDK_PLATFORM% --android-sdk-version=%ANDROID_SDK_PLATFORM% --signconfig-store-file %CI_ANDROID_KEYSTORE_FILE_ABS% --signconfig-store-password %CI_ANDROID_KEYSTORE_PASSWORD% --signconfig-key-alias %CI_ANDROID_KEYSTORE_ALIAS% --signconfig-key-password %CI_ANDROID_KEYSTORE_PASSWORD% %OPTIONAL_TEST_FLAG% %ADDITIONAL_GENERATE_ARGS% --overwrite-existing
CALL %PYTHON% cmake\Tools\Platform\Android\generate_android_project.py --engine-root=. --build-dir=%OUTPUT_DIRECTORY% -g %GAME_PROJECT% --gradle-install-path=%GRADLE_HOME% --cmake-install-path=%CMAKE_HOME% --ninja-install-path=%LY_NINJA_PATH% --third-party-path=%LY_3RDPARTY_PATH% --android-ndk-path=%LY_ANDROID_NDK% --android-sdk-path=%LY_ANDROID_SDK% --android-ndk-version=%ANDROID_NDK_PLATFORM% --android-sdk-version=%ANDROID_SDK_PLATFORM% --signconfig-store-file %CI_ANDROID_KEYSTORE_FILE_ABS% --signconfig-store-password %CI_ANDROID_KEYSTORE_PASSWORD% --signconfig-key-alias %CI_ANDROID_KEYSTORE_ALIAS% --signconfig-key-password %CI_ANDROID_KEYSTORE_PASSWORD% %ADDITIONAL_GENERATE_ARGS% --overwrite-existing
) ELSE (
ECHO [ci_build] %PYTHON% cmake\Tools\Platform\Android\generate_android_project.py --engine-root=. --build-dir=%OUTPUT_DIRECTORY% -g %GAME_PROJECT% --gradle-install-path=%GRADLE_HOME% --cmake-install-path=%CMAKE_HOME% --ninja-install-path=%LY_NINJA_PATH% --third-party-path=%LY_3RDPARTY_PATH% --android-ndk-path=%LY_ANDROID_NDK% --android-sdk-path=%LY_ANDROID_SDK% --android-ndk-version=%ANDROID_NDK_PLATFORM% --android-sdk-version=%ANDROID_SDK_PLATFORM% %ADDITIONAL_GENERATE_ARGS% --overwrite-existing
CALL %PYTHON% cmake\Tools\Platform\Android\generate_android_project.py --engine-root=. --build-dir=%OUTPUT_DIRECTORY% -g %GAME_PROJECT% --gradle-install-path=%GRADLE_HOME% --cmake-install-path=%CMAKE_HOME% --ninja-install-path=%LY_NINJA_PATH% --third-party-path=%LY_3RDPARTY_PATH% --android-ndk-path=%LY_ANDROID_NDK% --android-sdk-path=%LY_ANDROID_SDK% --android-ndk-version=%ANDROID_NDK_PLATFORM% --android-sdk-version=%ANDROID_SDK_PLATFORM% %ADDITIONAL_GENERATE_ARGS% --overwrite-existing
)
REM Validate the android project generation
IF %ERRORLEVEL%==0 GOTO generate_project_success
ECHO Error Generating Android Project
goto error
:generate_project_success
REM Run the gradle build from the output directory
PUSHD %OUTPUT_DIRECTORY%
REM Stop any running or orphaned gradle daemon
ECHO [ci_build] gradlew --stop
gradlew --stop
CALL gradlew --stop
ECHO [ci_build] gradlew --no-daemon -build%CONFIGURATION%
gradlew --no-daemon build%CONFIGURATION%
IF NOT %ERRORLEVEL%==0 GOTO :popd_error
ECHO [ci_build] gradlew --no-daemon %GRADLE_BUILD_CMD%%CONFIGURATION%
CALL gradlew --no-daemon %GRADLE_BUILD_CMD%%CONFIGURATION%
IF %ERRORLEVEL%==0 GOTO gradle_build_success
REM Do another build with the debug flag to try to get the failure reasons
GOTO error
ECHO Error building gradle. Rebuilding with debug information
ECHO [ci_build] gradlew --debug --full-stacktrace --no-daemon %GRADLE_BUILD_CMD%%CONFIGURATION%
CALL gradlew --debug --full-stacktrace --no-daemon %GRADLE_BUILD_CMD%%CONFIGURATION%
ECHO [ci_build] gradlew --stop
CALL gradlew --stop
POPD
GOTO error
:gradle_build_success
ECHO [ci_build] gradlew --stop
gradlew --stop
CALL gradlew --stop
POPD
EXIT /b 0
@@ -102,7 +219,4 @@ POPD
:error
ECHO [ci_build] gradlew --stop
gradlew --stop
EXIT /b 1
@@ -1,7 +1,7 @@
{
"ENV": {
"GRADLE_HOME": "C:/Gradle/gradle-5.6.4",
"NODE_LABEL": "windows",
"NODE_LABEL": "windows-047e5cdf",
"LY_3RDPARTY_PATH": "C:/ly/3rdParty",
"TIMEOUT": 30,
"WORKSPACE": "D:/workspace",
@@ -10,6 +10,9 @@
"PIPELINE_ENV_OVERRIDE": {
"daily-pipeline-metrics": {
"CLEAN_WORKSPACE": true
},
"packaging": {
"CLEAN_WORKSPACE": true
}
}
}
@@ -0,0 +1,544 @@
#
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or the license accompanying this file. Do not
# remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#
import argparse
import os
import pathlib
import re
import sys
import subprocess
import time
import logging
CURRENT_PATH = pathlib.Path(os.path.dirname(__file__)).absolute()
ENGINE_ROOT = CURRENT_PATH.parent.parent.parent.parent.parent.parent
class AndroidEmuError(Exception):
pass
def get_android_sdk_path():
try:
android_sdk_path = pathlib.Path(os.getenv('LY_ANDROID_SDK'))
if not android_sdk_path:
raise AndroidEmuError(f"LY_ANDROID_SDK environment variable is not set")
if not android_sdk_path.is_dir():
raise AndroidEmuError(f"Android SDK Path ('{android_sdk_path}') set with the LY_ANDROID_SDK variable is invalid")
#TODO: Sanity check on necessary files
return android_sdk_path
except Exception as err:
raise AndroidEmuError(f"Unable to determine android SDK path: {err}")
class Command(object):
def __init__(self, tool_name, tool_path, run_as_shell=True):
if not tool_path.is_file():
raise AndroidEmuError(f"Invalid path for {tool_name}. Cannot find ('{tool_path.absolute()}')")
self.tool_path = tool_path
self.run_as_shell = run_as_shell
def run_return_output(self, cmd_args):
args = [str(self.tool_path)]
if isinstance(cmd_args, str):
args.append(cmd_args)
elif isinstance(cmd_args, list):
args.extend(cmd_args)
else:
assert False, "run_return_output argument must be a string or list of strings"
full_cmd = subprocess.list2cmdline(args)
logging.debug(f"run_return_output: {full_cmd}")
run_result = subprocess.run(args,
capture_output=True,
encoding='UTF-8',
errors='ignore',
shell=self.run_as_shell)
if run_result.returncode != 0:
raise AndroidEmuError(f"Error executing command '{full_cmd}' (return code {run_result.returncode}): {run_result.stderr}")
return run_result.stdout
def run(self, cmd_args, cwd=None, suppress_output=False):
args = [str(self.tool_path)]
if isinstance(cmd_args, str):
args.append(cmd_args)
elif isinstance(cmd_args, list):
args.extend(cmd_args)
else:
assert False, "run_return_output argument must be a string or list of strings"
full_cmd = subprocess.list2cmdline(args)
logging.debug(f"run: {full_cmd}")
run_result = subprocess.run(args,
#stdout=subprocess.DEVNULL if suppress_output else subprocess.STDOUT,
capture_output=False,
shell=self.run_as_shell,
cwd=cwd)
if run_result.returncode != 0:
raise AndroidEmuError(f"Error executing command '{full_cmd}' (return code {run_result.returncode}): {run_result.stderr}")
def run_process(self, cmd_args):
args = [str(self.tool_path)]
if isinstance(cmd_args, str):
args.append(cmd_args)
elif isinstance(cmd_args, list):
args.extend(cmd_args)
else:
assert False, "run_return_output argument must be a string or list of strings"
full_cmd = subprocess.list2cmdline(args)
logging.debug(f"run_process: {full_cmd}")
process = subprocess.Popen(args,
shell=True,
stdout=subprocess.PIPE,
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP | subprocess.NORMAL_PRIORITY_CLASS |
subprocess.CREATE_NO_WINDOW,
encoding='UTF-8',
errors='ignore')
return process
class AndroidEmulatorManager(object):
UNIT_TEST_AVD_NAME = "LY_UNITTEST_AVD"
UNIT_TEST_SYSTEM_IMAGE_PACKAGE = "android-30;google_apis;x86_64"
UNIT_TEST_DEVICE_TEMPLATE_NAME = "pixel_xl"
UNIT_TEST_DEVICE_SETTINGS_MAP = {
"disk.dataPartition.size": "32G",
"vm.heapSize": "1024",
"hw.ramSize": "2048",
"hw.sdCard": "no"
}
EMULATOR_STARTUP_TIMEOUT_SECS = 60*5 # Set the emulator startup timeout to 5 minutes
def __init__(self, base_android_sdk_path, hide_emulator_windows=True, force_avd_creation=False, emulator_startup_timeout=EMULATOR_STARTUP_TIMEOUT_SECS):
self.android_sdk_path = base_android_sdk_path
self.force_avd_creation = force_avd_creation
self.unit_test_avd_name = AndroidEmulatorManager.UNIT_TEST_AVD_NAME
self.unit_test_device_template_name = AndroidEmulatorManager.UNIT_TEST_DEVICE_TEMPLATE_NAME
self.unit_test_device_settings_map = AndroidEmulatorManager.UNIT_TEST_DEVICE_SETTINGS_MAP
self.unit_test_avd_system_image = AndroidEmulatorManager.UNIT_TEST_SYSTEM_IMAGE_PACKAGE
self.hide_emulator_windows = hide_emulator_windows
self.emulator_startup_timeout = emulator_startup_timeout
self.emulator_cmd = Command("Emulator", self.android_sdk_path / 'emulator' / 'emulator.exe')
self.avd_manager_cmd = Command("AVD Manager", self.android_sdk_path / 'tools' / 'bin' / 'avdmanager.bat')
self.sdk_manager_cmd = Command("SDK Manager", self.android_sdk_path / 'tools' / 'bin' / 'sdkmanager.bat')
self.adb_cmd = Command("ADB", self.android_sdk_path / 'platform-tools' / 'adb.exe')
def collect_android_sdk_list(self):
"""
Use the SDK Manager to get the list of installed, available, and updateable packages
:return: tuple of 3 lists: installed, available, and updateable packages
"""
result_str = self.sdk_manager_cmd.run_return_output(['--list'])
# the result will be listed out in 3 sections: Installed packages, Available Packages, and Available updates
# and each item is represented by 3 columns separated by a '|' character
installed_packages = []
available_packages = []
available_updates = []
current_append_list = None
for avd_item in result_str.split('\n'):
avd_item_stripped = avd_item.strip()
if not avd_item_stripped:
continue
if '|' not in avd_item_stripped:
if avd_item_stripped.upper() == 'INSTALLED PACKAGES:':
current_append_list = installed_packages
elif avd_item_stripped.upper() == 'AVAILABLE PACKAGES:':
current_append_list = available_packages
elif avd_item_stripped.upper() == 'AVAILABLE UPDATES:':
current_append_list = available_updates
else:
current_append_list = None
continue
item_parts = [split.strip() for split in avd_item_stripped.split('|')]
if len(item_parts) < 3:
continue
elif item_parts[1].upper() in ('VERSION', 'INSTALLED', '-------'):
continue
elif current_append_list is None:
continue
if current_append_list is not None:
current_append_list.append(item_parts)
return installed_packages, available_packages, available_updates
def install_system_package_if_necessary(self):
"""
Make sure that we have the correct system image installed, and install if not
"""
installed_packages, available_packages, _ = self.collect_android_sdk_list()
unit_test_sdk_package_name = f'system-images;{self.unit_test_avd_system_image}'
detected_sdk_package_version = None
for package_line_items in installed_packages:
if package_line_items[0] == unit_test_sdk_package_name:
detected_sdk_package_version = package_line_items[0]
if detected_sdk_package_version:
# Already installed
logging.info(f"Detected installed system image {self.unit_test_avd_system_image} version {detected_sdk_package_version}")
return
# Make sure its an available image to install
detected_available_sdk_package_version = None
for package_line_items in available_packages:
if package_line_items[0] == unit_test_sdk_package_name:
detected_available_sdk_package_version = package_line_items[0]
if not detected_available_sdk_package_version:
raise AndroidEmuError(f"Unable to install required system image {self.unit_test_avd_system_image}, not found by the Android SDK Manager")
# Install the package
logging.info(f"Installing system image {self.unit_test_avd_system_image}...")
self.sdk_manager_cmd.run(['--install', unit_test_sdk_package_name])
logging.info(f"Installed Completed")
def find_device_id_by_name(self, device_name):
"""
Find a device id (from AVD Manager) by the device name
:param device_name: Name to lookup
:return: The device id
"""
result_str = self.avd_manager_cmd.run_return_output(['list', 'device'])
result_lines = [result_line.strip() for result_line in result_str.split('\n')]
result_line_count = len(result_lines)
current_index = 0
device_to_id_map = {}
while current_index < result_line_count:
current_line = result_lines[current_index]
current_index += 1
# This assumes the pattern "id: <id> or "<device name>"
if current_line.startswith('id:') and 'or' in current_line:
id_and_name_combo = current_line.split('or')
id_and_value_combo = id_and_name_combo[0].split(' ')
name = id_and_name_combo[1].replace('"', '').strip().upper()
id = id_and_value_combo[1]
device_to_id_map[name] = id
if current_line.startswith('Available Android targets:'):
break
device_id = device_to_id_map.get(device_name.upper())
if not device_id:
raise AndroidEmuError(f"Unable to locate device id for '{device_name}'")
return device_id
def query_installed_avds(self):
"""
Get maps of all valid and invalid AVDs installed on the current system
:return: tuple of 2 maps (AVD Name -> Path): Valid and invalid
"""
result_str = self.avd_manager_cmd.run_return_output(['list', 'avd'])
result_lines = [result_line.strip() for result_line in result_str.split('\n')]
line_count = len(result_lines)
current_index = 0
current_name = None
current_path = None
valid_avd_to_path_map = {}
invalid_avd_to_path_map = {}
current_avd_to_path_map = valid_avd_to_path_map
while current_index < line_count:
current_line = result_lines[current_index]
current_index += 1
if current_line.startswith('Name:'):
name = current_line[6:].strip()
if current_name is not None:
current_avd_to_path_map[current_name] = current_path
current_path = None
current_name = name
elif current_line.startswith('Path:'):
current_path = current_line[6:].strip()
elif current_line.startswith('Device:'):
pass
elif 'could not be loaded:' in current_line:
if current_name is not None:
current_avd_to_path_map[current_name] = current_path
current_avd_to_path_map = invalid_avd_to_path_map
current_path = None
current_name = None
if current_name is not None:
current_avd_to_path_map[current_name] = current_path
return valid_avd_to_path_map, invalid_avd_to_path_map
def create_unitest_avd(self):
"""Create the unit test AVD"""
self.install_system_package_if_necessary()
device_id = self.find_device_id_by_name(self.unit_test_device_template_name)
self.avd_manager_cmd.run(['--silent',
'create', 'avd',
'--name', self.unit_test_avd_name,
'--package', f'system-images;{self.unit_test_avd_system_image}',
'--device', device_id])
valid_avd_map, _ = self.query_installed_avds()
unit_test_avd_path = valid_avd_map.get(self.unit_test_avd_name)
if not unit_test_avd_path:
raise AndroidEmuError(f"Unable to create unit test AVD {self.unit_test_avd_name}")
unit_test_avd_config_path = pathlib.Path(unit_test_avd_path) / 'config.ini'
if not unit_test_avd_config_path.is_file():
raise AndroidEmuError(f"Unable to create unit test AVD {self.unit_test_avd_name}: The expected config file '{unit_test_avd_config_path}' does not exist.")
config_content_full = unit_test_avd_config_path.read_text(encoding='UTF-8', errors='ignore')
for item, value in self.unit_test_device_settings_map.items():
regex_friendly_str = item.replace('.', '\\.')
repl_pattern = f"{regex_friendly_str}\\s*=\\s*[\\d]+"
repl_value = f"{item}={value}"
if re.search(repl_pattern, config_content_full):
config_content_full = re.sub(repl_pattern, repl_value, config_content_full)
else:
if not config_content_full.endswith('\n'):
config_content_full += '\n'
config_content_full += f"{repl_value}\n"
unit_test_avd_config_path.write_text(config_content_full)
def query_emulator_device_id(self):
result_str = self.adb_cmd.run_return_output(['devices', '-l'])
emulators = []
for result_line in result_str.split('\n'):
if not result_line.startswith('emulator-'):
continue
emulator = result_line[:result_line.find(' ')].strip()
emulators.append(emulator)
if len(emulators) > 1:
logging.warning(f"Found multiple emulators connect ({','.join(emulators)}). Defaulting to {emulators[0]}")
return emulators[0] if len(emulators) > 0 else None
def install_unit_test_avd(self):
"""
Install the unit test AVD (Android Virtual Device)
"""
valid_avd_map, invalid_avd_map = self.query_installed_avds()
if not self.unit_test_avd_name in valid_avd_map:
create_avd = True
elif self.force_avd_creation or self.unit_test_avd_name in invalid_avd_map:
logging.info(f"Deleting AVD {self.unit_test_avd_name}..")
self.avd_manager_cmd.run(['delete', 'avd', '--name', self.unit_test_avd_name])
create_avd = True
else:
create_avd = False
if create_avd:
self.create_unitest_avd()
def uninstall_unit_test_avd(self):
"""
Uninstall the unit test AVD
"""
logging.info(f"Uninstalling AVD {self.unit_test_avd_name}..")
self.avd_manager_cmd.run(['delete', 'avd', '--name', self.unit_test_avd_name])
def launch_emulator_process(self):
"""
Launch the emulator process for the unit test avd and return the process handle and its device id
:return: tuple of the process handle and the device id for the emulator
"""
emulator_device_id = None
process = None
try:
# Launch the emulator process
emulator_process_args = [
"-avd",
self.unit_test_avd_name
]
if self.hide_emulator_windows:
emulator_process_args.append("-no-window")
process = self.emulator_cmd.run_process(emulator_process_args)
# Wait for the emulator to signal that its bootup is complete
boot_completed = False
start_time = time.time()
timeout_secs = 360
while process.poll() is None:
elapsed_time = time.time() - start_time
if elapsed_time > timeout_secs > 0:
break
line = process.stdout.readline()
print(line, end='')
if "boot completed" in line:
boot_completed = True
break
if not boot_completed:
raise AndroidEmuError("Bootup of emulator timed out")
# query ADB to get the emulator ID
emulator_device_id = self.query_emulator_device_id()
return process, emulator_device_id
except Exception:
if process:
if emulator_device_id:
self.terminate_emulator_process(emulator_device_id)
else:
process.kill()
raise
def terminate_emulator_process(self, device_id):
# Terminate the emulator
kill_emu_args = [
'-s', device_id,
'emu', 'kill'
]
self.adb_cmd.run(kill_emu_args)
def run_emulation_process(self, process_func):
"""
Execute a function that relies on the session based android simulator.
:param process_func: The process function to execute. Function requires one argument which will be the device id
:return: The return value of the process function
"""
emulator_device_id = None
try:
emulator_process, emulator_device_id = self.launch_emulator_process()
return process_func(emulator_device_id)
finally:
if emulator_device_id is not None:
self.terminate_emulator_process(emulator_device_id)
def process_unit_test_on_simulator(base_android_sdk_path, build_path, build_config):
"""
Run the android unit tests on a sessioned simulator
:param base_android_sdk_path: The path to where the Android SDK exists
:param build_path: The build path relative to the engine root where the android unit test project is configured and built
:param build_config: The configuration of the build unit test APK to run
"""
python_cmd = Command("Python", ENGINE_ROOT / 'python' / 'python.cmd')
android_script_root = ENGINE_ROOT / 'cmake' / 'Tools' / 'Platform' / 'Android'
assert android_script_root.is_dir(), "Missing the android scripts path in the engine folder hierarchy"
deploy_android_py_path = android_script_root / 'deploy_android.py'
assert deploy_android_py_path.is_file(), "Missing the android deployment script in the engine folder hierarchy"
launch_android_ptest_py_path = android_script_root / 'launch_android_test.py'
assert launch_android_ptest_py_path.is_file(), "Missing the android unit test launcher script in the engine folder hierarchy"
def _install_and_run_unit_tests(emulator_id):
# install unit test on the emulator
install_apk_args = [
str(deploy_android_py_path),
'-b', build_path,
'-c', build_config,
'--device-id-filter', emulator_id,
'--clean'
]
python_cmd.run(cmd_args=install_apk_args,
cwd=os.path.normpath(str(ENGINE_ROOT)))
try:
# Launch the unit test on the emulator
launch_apk_args = [
str(launch_android_ptest_py_path),
'-b', build_path,
'-c', build_config,
'--device-serial', emulator_id
]
python_cmd.run(cmd_args=launch_apk_args,
cwd=os.path.normpath(str(ENGINE_ROOT)))
return True
except AndroidEmuError:
print("\n\n")
raise AndroidEmuError("Unit Tests Failed")
# Prepare the emulator manager
manager = AndroidEmulatorManager(base_android_sdk_path=base_android_sdk_path,
force_avd_creation=True)
# First Install or overwrite the unit test emulator
manager.install_unit_test_avd()
# Run the emulator-dependent process based on the session AVD created by the manager
manager.run_emulation_process(_install_and_run_unit_tests)
# Uninstall the AVD when done
manager.uninstall_unit_test_avd()
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Install and an android unit test APK on a android simulator.")
parser.add_argument('--android-sdk-path',
help='Path to the Android SDK')
parser.add_argument('--build-path',
help='The build path (relative to the engine root) where the project was generated and the APK is built',
required=True)
parser.add_argument('--build-config',
help='The build config of the built APK',
required=True)
parser.add_argument('--debug',
help='Enable debug messages from this script',
action="store_true")
parsed_args = parser.parse_args(sys.argv[1:])
logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.DEBUG if parsed_args.debug else logging.INFO)
try:
base_android_sdk_path = pathlib.Path(parsed_args.android_sdk_path) if parsed_args.android_sdk_path else get_android_sdk_path()
process_unit_test_on_simulator(base_android_sdk_path=base_android_sdk_path,
build_path=parsed_args.build_path,
build_config=parsed_args.build_config)
exit(0)
except AndroidEmuError as e:
print(e)
exit(1)
@@ -14,11 +14,14 @@ set -o errexit # exit on the first failure encountered
# Delete output directory if CLEAN_OUTPUT_DIRECTORY env variable is set
if [[ $CLEAN_OUTPUT_DIRECTORY == "true" ]]; then
if [[ -d Cache ]]; then
echo "[ci_build] CLEAN_OUTPUT_DIRECTORY option set with value \"${CLEAN_OUTPUT_DIRECTORY}\""
echo "[ci_build] Deleting \"Cache\""
rm -rf Cache
fi
for project in $(echo $CMAKE_LY_PROJECTS | sed "s/;/ /g")
do
if [[ -d "$project/Cache" ]]; then
echo "[ci_build] CLEAN_OUTPUT_DIRECTORY option set with value \"${CLEAN_OUTPUT_DIRECTORY}\""
echo "[ci_build] Deleting \"$project/Cache\""
rm -rf $project/Cache
fi
done
fi
if [[ ! -d $OUTPUT_DIRECTORY ]]; then
@@ -9,6 +9,9 @@
"PIPELINE_ENV_OVERRIDE": {
"daily-pipeline-metrics": {
"CLEAN_WORKSPACE": true
},
"packaging": {
"CLEAN_WORKSPACE": true
}
}
}
@@ -14,11 +14,14 @@ set -o errexit # exit on the first failure encountered
# Delete output directory if CLEAN_OUTPUT_DIRECTORY env variable is set
if [[ $CLEAN_OUTPUT_DIRECTORY == "true" ]]; then
if [[ -d Cache ]]; then
echo "[ci_build] CLEAN_OUTPUT_DIRECTORY option set with value \"${CLEAN_OUTPUT_DIRECTORY}\""
echo "[ci_build] Deleting \"Cache\""
rm -rf Cache
fi
for project in $(echo $CMAKE_LY_PROJECTS | sed "s/;/ /g")
do
if [[ -d "$project/Cache" ]]; then
echo "[ci_build] CLEAN_OUTPUT_DIRECTORY option set with value \"${CLEAN_OUTPUT_DIRECTORY}\""
echo "[ci_build] Deleting \"$project/Cache\""
rm -rf $project/Cache
fi
done
fi
if [[ ! -d $OUTPUT_DIRECTORY ]]; then
@@ -9,6 +9,9 @@
"PIPELINE_ENV_OVERRIDE": {
"daily-pipeline-metrics": {
"CLEAN_WORKSPACE": true
},
"packaging": {
"CLEAN_WORKSPACE": true
}
}
}
@@ -14,11 +14,13 @@ SETLOCAL EnableDelayedExpansion
REM Delete output directory if CLEAN_OUTPUT_DIRECTORY env variable is set
IF "%CLEAN_OUTPUT_DIRECTORY%"=="true" (
IF EXIST Cache (
ECHO [ci_build] CLEAN_OUTPUT_DIRECTORY option set with value "%CLEAN_OUTPUT_DIRECTORY%"
ECHO [ci_build] Deleting "Cache"
DEL /s /q /f Cache
)
FOR %%P in (%CMAKE_LY_PROJECTS%) do (
IF EXIST %%P\Cache (
ECHO [ci_build] CLEAN_OUTPUT_DIRECTORY option set with value "%CLEAN_OUTPUT_DIRECTORY%"
ECHO [ci_build] Deleting "%%P\Cache"
DEL /s /q /f %%P\Cache 1>nul
)
)
)
IF NOT EXIST %OUTPUT_DIRECTORY% (
@@ -4,6 +4,7 @@
"default"
],
"steps": [
"scrubbing",
"validation"
]
},
@@ -27,18 +28,14 @@
]
},
"scrubbing": {
"TAGS": [
"weekly-build-metrics"
],
"TAGS": [],
"COMMAND": "python_windows.cmd",
"PARAMETERS": {
"SCRIPT_PATH": "Tools/build/JenkinsScripts/build/scrubbing_job.py"
}
},
"validation": {
"TAGS": [
"weekly-build-metrics"
],
"TAGS": [],
"COMMAND": "python_windows.cmd",
"PARAMETERS": {
"SCRIPT_PATH": "scripts/commit_validation/validate_file_or_folder.py"
@@ -100,7 +97,7 @@
"CMAKE_LY_PROJECTS": "AutomatedTesting",
"CMAKE_TARGET": "TEST_SUITE_smoke TEST_SUITE_main",
"CMAKE_NATIVE_BUILD_ARGS": "/m /nologo",
"CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -T Test"
"CTEST_OPTIONS": "-L \"(SUITE_smoke|SUITE_main)\" -LE \"(REQUIRES_gpu)\" -T Test"
}
},
"profile_vs2019": {
@@ -151,9 +148,11 @@
}
},
"test_gpu_profile_vs2019": {
"TAGS": [],
"PIPELINE_ENV": {
"NODE_LABEL": "windows-gpu"
"TAGS":[
"nightly"
],
"PIPELINE_ENV":{
"NODE_LABEL":"windows-gpu"
},
"COMMAND": "build_test_windows.cmd",
"PARAMETERS": {
@@ -19,7 +19,7 @@ IF "%CLEAN_OUTPUT_DIRECTORY%"=="true" (
IF EXIST %OUTPUT_DIRECTORY% (
ECHO [ci_build] CLEAN_OUTPUT_DIRECTORY option set with value "%CLEAN_OUTPUT_DIRECTORY%"
ECHO [ci_build] Deleting "%OUTPUT_DIRECTORY%"
DEL /s /q /f %OUTPUT_DIRECTORY%
DEL /s /q /f %OUTPUT_DIRECTORY% 1>nul
)
)
@@ -1,6 +1,6 @@
{
"ENV": {
"NODE_LABEL": "windows",
"NODE_LABEL": "windows-047e5cdf",
"LY_3RDPARTY_PATH": "C:/ly/3rdParty",
"TIMEOUT": 30,
"WORKSPACE": "D:/workspace",
@@ -9,6 +9,9 @@
"PIPELINE_ENV_OVERRIDE": {
"daily-pipeline-metrics": {
"CLEAN_WORKSPACE": true
},
"packaging": {
"CLEAN_WORKSPACE": true
}
}
}
@@ -9,6 +9,9 @@
"PIPELINE_ENV_OVERRIDE": {
"daily-pipeline-metrics": {
"CLEAN_WORKSPACE": true
},
"packaging": {
"CLEAN_WORKSPACE": true
}
}
}
@@ -146,16 +146,23 @@ def gather_build_metrics(current_dir, build_config_filename, platform):
print(f'[ci_build_metrics] {reason}', flush=True)
continue
# Clean the output
output_directory = build_parameters['OUTPUT_DIRECTORY']
# Clean the build output
output_directory = build_parameters['OUTPUT_DIRECTORY'] if 'OUTPUT_DIRECTORY' in build_parameters else None
if not output_directory:
metrics['result'] = -1
reason = f'OUTPUT_DIRECTORY entry in {build_config_abspath} is missing.'
metrics['reason'] = reason
print(f'[ci_build_metrics] {reason}', flush=True)
continue
folders_of_interest = [output_directory]
folders_of_interest = ['Cache', 'AssetProcessorTemp', output_directory]
# Clean the AP output
cmake_ly_projects = build_parameters['CMAKE_LY_PROJECTS'] if 'CMAKE_LY_PROJECTS' in build_parameters else None
if cmake_ly_projects:
projects = cmake_ly_projects.split(';')
for project in projects:
folders_of_interest.append(os.path.join(project, 'user', 'AssetProcessorTemp'))
folders_of_interest.append(os.path.join(project, 'Cache'))
metrics['build_metrics'] = []
build_metrics = metrics['build_metrics']
@@ -1,13 +0,0 @@
Contact: l-infrastructure@amazon.com
Last Updated: 2015.02.13
Description:
LYKey.ppk is the keyfile for the EC2 instance hosted on the AWS account lumberyard-distribution@amazon.com.
https://wiki.labcollab.net/confluence/display/lmbr/Build+Distribution+Proprosal
@@ -0,0 +1,309 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
import BuildThirdPartyArgs
import BuildThirdPartyUtils
import SDKPackager
import ThirdPartySDKAWS
import json
import os
import re
import sys
import urlparse
importDir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(importDir, "..")) #Required for AWS_PyTools
from AWS_PyTools import LyChecksum
from AWS_PyTools import LyCloudfrontOps
# Some files are in the 3rd party folder and not associated with any SDK/Versions.
fileIgnorelist = [
"boost/Boost_Autoexp.dat",
"boost/CryEngine Customizations.txt",
"boost/CryREADME.txt",
"boost/LICENSE_1_0.txt",
"boost/lumberyard-1.61.0.patch",
"Qwt/license.txt",
"lz4/git checkout.txt"
"3rdParty.txt"
]
class SDK(object):
def __init__(self):
self.fileList = []
self.path = ""
self.versionFolder = ""
def getListFromFile(file):
openFile = open(file, 'r')
filePaths = openFile.readlines()
openFile.close()
return filePaths
def addUntrackedSDKs(sdks):
# Not all SDKs are represented in SetupAssistantConfig.json yet.
untrackedSDKs = {
"OpenEXR20": ["OpenEXR/2.0", "2.0"],
"OpenEXR22": ["OpenEXR/2.2", "2.2"],
}
for sdkName, untrackedSDK in untrackedSDKs.iteritems():
sdk = SDK()
sdk.path = untrackedSDK[0]
sdk.versionFolder = untrackedSDK[1]
sdks[sdkName] = sdk
def getSDKsToPathsDict(thirdPartyVersionsFile):
versionsList = getListFromFile(thirdPartyVersionsFile)
sdks = {}
for version in versionsList:
match = re.match(r"(.*)(\.package.dir=)(.*)", version)
if not match:
BuildThirdPartyUtils.printError('SDK version file {0} has invalid formatting on line {1}'.format(
thirdPartyVersionsFile,
version))
sdkName = match.group(1)
# Store the SDK Path with forward slashes to make matching easier.
sdkPath = match.group(3).replace('\\', '/')
sdk = SDK()
sdk.path = sdkPath
versionMatch = re.search(r"([^/\\\\]*)$", sdkPath)
if not versionMatch:
BuildThirdPartyUtils.printError('SDK version file {0} has invalid formatting on line {1}'.format(
thirdPartyVersionsFile,
version))
sdk.versionFolder = versionMatch.group(1)
sdks[sdkName] = sdk
addUntrackedSDKs(sdks)
return sdks
def populateSDKFilePaths(sdks, sdkFileListFile):
fileList = getListFromFile(sdkFileListFile)
lastSDKName = ""
for file in fileList:
slashesFixed = file.replace('\\', '/')
match = re.search("3rdParty/(.*)", slashesFixed)
if not match:
BuildThirdPartyUtils.printError("Could not find third party folder in file path {0}".format(file))
localPath = match.group(1)
sdkFound = False
# Files are generally grouped by SDK in the file list,
# caching the last SDK used can save a search through the loop.
if lastSDKName:
if localPath.startswith(sdks[lastSDKName].path):
sdk.fileList.append(file)
sdkFound = True
continue
for sdkName, sdk in sdks.iteritems():
if localPath.startswith(sdk.path):
sdk.fileList.append(file)
sdkFound = True
lastSDKName = sdkName
break
# Some files are loose and not trackable within the current system. For now we're going to ignore them,
# and they will need to be included in the package manually.
for ignore in fileIgnorelist:
if localPath == ignore:
sdkFound = True
break
if not sdkFound:
BuildThirdPartyUtils.printError("File {0} is not associated with any known SDKs".format(
file,
sdkFileListFile))
def checkForSDKStagingErrors(bucket, baseBucketPath, sdkPath, sdkPlatform, filesetHash):
tmpDirPath = SDKPackager.getTempDir(sdkPath, sdkPlatform)
filelistFileName = SDKPackager.getFilelistFileName(sdkPlatform)
filelistLocalPath = os.path.join(tmpDirPath, filelistFileName)
filelistStagingPath = ThirdPartySDKAWS.getS3StagingPath(baseBucketPath, sdkPath) + filelistFileName
if not os.path.exists(tmpDirPath):
os.makedirs(tmpDirPath)
bucket.download_file(filelistStagingPath, filelistLocalPath)
filelistData = open(filelistLocalPath, 'r')
filelistJsonData = json.load(filelistData)
filelistData.close()
assert(filelistData != ""), "Failed to load from " + filelistLocalPath
filelistChecksum = filelistJsonData["filelist"]["checksum"]
if filelistChecksum != filesetHash.hexdigest():
# If the checksums don't match, then the SDK has been modified without changing the version. This is an error.
return True
return False
def checkForExistingSDK(ignoreExisting,
bucket,
baseBucketPath,
sdkName,
versionFolder,
sdkPath,
sdkPlatform,
filesetHash):
returnCode = 0
statusMessage = None
# Check for existing manifest
manifestExists, filelistExists = ThirdPartySDKAWS.getSDKStagingStatus(bucket,
baseBucketPath,
sdkPath,
sdkPlatform)
if ignoreExisting:
return statusMessage, returnCode
# If the manifest or filelist is missing, but one is available, then the SDK likely failed to upload.
# In this case, just continue on and generate the SDK package.
if manifestExists and filelistExists:
# If the manifest and filelist both exist, this SDK.version.package has been uploaded already.
stagingError = checkForSDKStagingErrors(bucket,
baseBucketPath,
sdkPath,
sdkPlatform,
filesetHash)
if stagingError:
statusMessage = "ERROR: The file list manifests do not match for SDK {0}, Version {1}, Platform {2}".format(sdkName,
versionFolder,
sdkPlatform)
returnCode = 1
else:
statusMessage = "\tEverything is up to date for SDK {0}, Version {1}, Platform {2}".format(sdkName,
versionFolder,
sdkPlatform)
if statusMessage:
print statusMessage
return statusMessage, returnCode
def getListFromJsonFile(jsonFile, root):
if not jsonFile:
return []
if not os.path.isfile(jsonFile):
print "{} is not a valid file, please check the filename specified.".format(jsonFile)
exit(1)
with open(jsonFile, 'r') as source:
source_json = json.load(source)
try:
sdks_list = source_json[root]
return sdks_list
except KeyError:
print "Unknown json root {}, please check the json root specified.".format(root)
exit(1)
############################
def main():
print "Building third party packages"
args = BuildThirdPartyArgs.createArgs()
print "Parsing file lists"
ignoreExistingSDKList = getListFromJsonFile(args.ignoreExistingList, args.sdkPlatform)
sdkBlacklist = getListFromJsonFile(args.sdkBlacklist, "Blacklist")
sdks = getSDKsToPathsDict(args.thirdPartyVersions)
populateSDKFilePaths(sdks, args.sdkFilelist)
cloudfrontDist = LyCloudfrontOps.getCloudfrontDistribution(args.cloudfrontDomain, args.awsProfile)
bucket = LyCloudfrontOps.getBucket(cloudfrontDist, args.awsProfile)
baseBucketPath = LyCloudfrontOps.buildBucketPath(urlparse.urljoin(args.cloudfrontDomain, args.stagingFolderPath), cloudfrontDist)
baseCloudfrontUrl = args.cloudfrontDomain # we assume that the domain ends in a trailing '/'
if args.stagingFolderPath:
baseCloudfrontUrl += args.stagingFolderPath # we assume that the folder path ends in a trailing '/'
returnCode = 0
sdksGenerated = []
sdkCount = len(sdks)
currentSDK = -1
for sdkName, sdk in sdks.iteritems():
currentSDK += 1
print "{0}/{1} - Processing {2}".format(currentSDK, sdkCount, sdkName)
# Don't process SDKs in the blacklist.
if sdkName in sdkBlacklist:
print "\tSkipping blacklist SDK {0}".format(sdkName)
continue
# Hash all files for the SDK
filesetHash = LyChecksum.generateFilesetChecksum(sdk.fileList)
if args.internalPackage:
ignoreExisting = True
else:
ignoreExisting = sdkName in ignoreExistingSDKList
statusMessage, sdkReturnCode = checkForExistingSDK(ignoreExisting,
bucket,
baseBucketPath,
sdkName,
sdk.versionFolder,
sdk.path,
args.sdkPlatform,
filesetHash)
# The final return should be the highest reported return code.
returnCode = max(returnCode, sdkReturnCode)
if statusMessage:
continue
manifestPath, filelistPath, zipFiles = SDKPackager.generateSDKPackage(baseCloudfrontUrl,
sdkName,
sdk.versionFolder,
sdk.path,
args.sdkPlatform,
filesetHash,
sdk.fileList,
args.archiveMaxSize)
if not args.skipUpload:
ThirdPartySDKAWS.uploadSDKToStaging(bucket,
baseBucketPath,
sdkName,
sdk.versionFolder,
sdk.path,
args.sdkPlatform,
manifestPath,
filelistPath,
zipFiles)
print "{0}/{1} - Completed Processing {2}".format(currentSDK+1, sdkCount, sdkName)
sdksGenerated.append(sdkName)
# If any SDKs were updated, and we were told to make a file to output
# the list of updated SDKs to, then make said file and write out the list
if len(sdksGenerated) > 0 and args.updatesFile:
try:
with open(args.updatesFile, 'w') as out:
out.writelines('\n'.join(sdksGenerated))
except:
BuildThirdPartyUtils.printError("Failed to write list of updated SDKs to {0}. Backup zip files will not be created properly for this build.".format(args.updatesFile))
return returnCode
if __name__ == "__main__":
sys.exit(main())
@@ -0,0 +1,29 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
import sys
def printError(message):
print(message)
sys.exit(1)
def reportIterationStatus(index, count, reportFrequency, message):
# Reporting on the first, last, and at a frequency that is a good balance of not spamming the logs
frequency = count / reportFrequency
lastPercent = float(index-1) / float(count)
percentComplete = float(index) / float(count)
lastReportSlice = int(lastPercent * frequency)
thisReportSlice = int(percentComplete * frequency)
shouldPrint = lastReportSlice != thisReportSlice or index == 1 or index == count
if shouldPrint:
print "\t{0}% complete, {1}/{2} {3}".format(int(percentComplete*100), index, count, message)
@@ -0,0 +1,207 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
import zipfile
import os.path
import re
import json
import sys
import ThirdPartySDKAWS
import BuildThirdPartyUtils
import tempfile
importDir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(importDir, "..")) #Required for AWS_PyTools
from AWS_PyTools import LyChecksum
class SDKZipFile(object):
def __init__(self):
self.file = None
self.filePath = None
self.contents = []
self.compressedSize = 0
self.uncompressedSize = 0
self.compressedHash = 0
def getFilelistVersion():
return "1.0.0"
def getFilelistFileName(sdkPlatform):
return "filelist." + getFilelistVersion() + "." + sdkPlatform + ".json"
def getManifestVersion():
return "1.0.0"
def getManifestFileName(sdkPlatform):
return "manifest." + getManifestVersion() + "." + sdkPlatform + ".json"
def toArchivePath(filePath):
# Archives are generated relative to 3rdParty folder, so strip everything before that in the path.
# zipfile is very particular in how paths to files within it are formatted.
slashesFixed = filePath.replace('\\', '/')
match = re.search("3rdParty/(.*)", slashesFixed)
if not match:
BuildThirdPartyUtils.printError("Could not find third party folder in file path {0}".format(filePath))
archivePath = match.group(1).strip("/").strip("\n")
return archivePath
def prepFilesystemForFile(filePath):
directory = os.path.dirname(filePath)
if not os.path.exists(directory):
os.makedirs(directory)
if os.path.isfile(filePath):
os.remove(filePath)
def createJSONString(dataToFormat):
return json.dumps(dataToFormat, sort_keys=True, indent=4, separators=(',', ': '))
def generateSDKPackage(baseCloudfrontUrl,
sdkName,
sdkVersion,
sdkPath,
sdkPlatform,
filesetHash,
filePaths,
archiveMaxSize):
zipFiles = zipPackage(sdkName, sdkVersion, sdkPath, sdkPlatform, filePaths, archiveMaxSize)
filelistPath = buildFilelistJSON(sdkPath, sdkPlatform, filesetHash, filePaths)
manifestPath = buildManifestJSON(baseCloudfrontUrl,
sdkName,
sdkPath,
sdkPlatform,
zipFiles,
filelistPath)
return manifestPath, filelistPath, zipFiles
def getTempDir(sdkPath, sdkPlatform):
tempDir = os.path.join(tempfile.tempdir, "LY", "3rdPartySDKs", sdkPath, sdkPlatform)
return os.path.expandvars(tempDir)
def zipPackage(sdkName, sdkVersion, sdkPath, sdkPlatform, filePaths, archiveMaxSize):
try:
import zlib
compression = zipfile.ZIP_DEFLATED
except:
compression = zipfile.ZIP_STORED
tempDir = getTempDir(sdkPath, sdkPlatform)
zipFiles = []
currentZipFile = None
fileIndex = 0
fileCount = len(filePaths)
for filePath in filePaths:
filePath = filePath.strip("\n")
archivePath = toArchivePath(filePath)
if currentZipFile is None or currentZipFile.file is None or currentZipFile.compressedSize > archiveMaxSize:
if currentZipFile and currentZipFile.file:
currentZipFile.file.close()
currentZipFile = SDKZipFile()
zipFiles.append(currentZipFile)
currentZipFile.filePath = os.path.join(tempDir, sdkName + "." + str(sdkPlatform) + "." + str(len(zipFiles)) + ".zip")
prepFilesystemForFile(currentZipFile.filePath)
currentZipFile.file = zipfile.ZipFile(currentZipFile.filePath, mode='w')
currentZipFile.file.write(filePath, compress_type=compression, arcname=archivePath)
fileInfo = currentZipFile.file.getinfo(archivePath)
currentZipFile.compressedSize += fileInfo.compress_size
currentZipFile.uncompressedSize += fileInfo.file_size
currentZipFile.contents.append(filePath)
fileIndex += 1
BuildThirdPartyUtils.reportIterationStatus(fileIndex, fileCount, 25, "files zipped")
if currentZipFile and currentZipFile.file:
currentZipFile.file.close()
for zipFile in zipFiles:
zipFile.compressedHash = LyChecksum.getChecksumForSingleFile(zipFile.filePath)
return zipFiles
def buildFilelistJSON(sdkPath, sdkPlatform, filesetHash, filePaths):
jsonFormatFiles = []
for filePath in filePaths:
scrubbedFile = toArchivePath(filePath)
jsonFormatFiles.append(scrubbedFile)
filelistInfo = {
"filelist": {
"filelistVersion": getFilelistVersion(),
"checksum": filesetHash.hexdigest(),
"files": jsonFormatFiles,
}
}
filelistJSON = createJSONString(filelistInfo)
filelistName = getFilelistFileName(sdkPlatform)
filelistPath = getTempDir(sdkPath, sdkPlatform)
filelistFullPath = os.path.join(filelistPath, filelistName)
prepFilesystemForFile(filelistFullPath)
outputFile = open(filelistFullPath, 'w')
outputFile.write(filelistJSON)
outputFile.close()
return filelistFullPath
def buildManifestJSON(baseCloudfrontUrl, sdkName, sdkPath, sdkPlatform, zipFiles, filelistPath):
uncompressedSize = 0
packageArchives = []
for zipFile in zipFiles:
uncompressedSize += zipFile.uncompressedSize
archiveUrl = ThirdPartySDKAWS.getProductionUrl(baseCloudfrontUrl, sdkPath, zipFile.filePath)
packageArchive = {
"archiveUrl": archiveUrl,
"archiveSize": str(zipFile.compressedSize),
"archiveChecksum": zipFile.compressedHash.hexdigest()
}
packageArchives.append(packageArchive)
filelistChecksum = LyChecksum.getChecksumForSingleFile(filelistPath)
filelistUrl = ThirdPartySDKAWS.getProductionUrl(baseCloudfrontUrl, sdkPath, filelistPath)
packageInfo = {
"package":
{
"manifestVersion": getManifestVersion(),
"identifier": sdkName,
"platform": sdkPlatform,
"uncompressedSize": str(uncompressedSize),
"filelistUrl": filelistUrl,
"filelistChecksum": filelistChecksum.hexdigest(),
"archives": packageArchives
}
}
manifestJSON = createJSONString(packageInfo)
manifestName = getManifestFileName(sdkPlatform)
manifestPath = getTempDir(sdkPath, sdkPlatform)
manifestFullPath = os.path.join(manifestPath, manifestName)
prepFilesystemForFile(manifestFullPath)
outputFile = open(manifestFullPath, 'w')
outputFile.write(manifestJSON)
outputFile.close()
return manifestFullPath
@@ -0,0 +1,76 @@
"""
All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
its licensors.
For complete copyright and license terms please see the LICENSE at the root of this
distribution (the "License"). All use of this software is governed by the License,
or, if provided, by the license below or the license accompanying this file. Do not
remove or modify any license notices. This file is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""
import os.path
import sys
import urlparse
import SDKPackager
import BuildThirdPartyUtils
importDir = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(importDir, "..")) #Required for AWS_PyTools
from AWS_PyTools import LyCloudfrontOps
def getS3StagingPath(stagingFolderPath, sdkPath):
# The staging path is used for the build machines to upload new builds of 3rd party packages.
# The Setup Assistant supports a global override so Lumberyard team members can pull from the staging location.
return urlparse.urljoin(stagingFolderPath, sdkPath.replace(' ', '_')) + '/'
def getProductionUrl(cloudfrontUrl, sdkPath, filePath):
# The production path is the final path customers will download the SDK from.
# These links get baked into the manifest, which the Setup Assistant executable uses to acquire these SDKs.
# TODO : Generate an actual cloudfront production link.
#return cloudfrontUrl + getS3StagingPath(stagingFolderPath, sdkPath.replace(' ', '_')) + os.path.basename(filePath)
# we assume that the cloudfront url and the result of getS3stagingPath have a trailing '/'
return getS3StagingPath(cloudfrontUrl, sdkPath) + os.path.basename(filePath)
def getSDKStagingStatus(bucket, baseBucketPath, sdkPath, sdkPlatform):
pathToSDK = getS3StagingPath(baseBucketPath, sdkPath)
pathToFilelist = pathToSDK + SDKPackager.getFilelistFileName(sdkPlatform)
pathToManifest = pathToSDK + SDKPackager.getManifestFileName(sdkPlatform)
manifestExists = False
filelistExists = False
objs = list(bucket.objects.filter(Prefix=pathToManifest))
if len(objs) > 0 and objs[0].key == pathToManifest:
manifestExists = True
else:
manifestExists = False
objs = list(bucket.objects.filter(Prefix=pathToFilelist))
if len(objs) > 0 and objs[0].key == pathToFilelist:
filelistExists = True
else:
filelistExists = False
return manifestExists, filelistExists
def uploadSDKToStaging(bucket, baseBucketPath, sdkName, sdkVersion, sdkPath, sdkPlatform, manifestPath, filelistPath, zipFiles):
print "\tUploading SDK: {0} ({1},{2})".format(sdkName, sdkVersion, sdkPlatform)
manifestStagingPath = getS3StagingPath(baseBucketPath, sdkPath) + os.path.basename(manifestPath)
bucket.upload_file(manifestPath, manifestStagingPath)
print "\tUploaded manifest"
filelistStagingPath = getS3StagingPath(baseBucketPath, sdkPath) + os.path.basename(filelistPath)
bucket.upload_file(filelistPath, filelistStagingPath)
print "\tUploaded filelist"
filesUploaded = 0
totalFilesCount = len(zipFiles)
for zipFile in zipFiles:
fileLocalPath = zipFile.filePath
fileStagingPath = getS3StagingPath(baseBucketPath, sdkPath) + os.path.basename(zipFile.filePath)
bucket.upload_file(fileLocalPath, fileStagingPath)
filesUploaded += 1
BuildThirdPartyUtils.reportIterationStatus(filesUploaded, totalFilesCount, 5, "files uploaded")
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-68
View File
@@ -1,68 +0,0 @@
-------------------------------------------------------------------------------
-- cryInfoFloater.ms
-- Version 1.2
-- by Christopher Evans
-------------------------------------------------------------------------------
if cryInfoFloater != undefined do ( destroydialog cryInfoFloater )
rollout cryInfoFloater "cryInfo 1.4"
(
edittext cryInfo_txt text:"cryInfo" fieldWidth:390 height:260 pos:[1,3]
button saveinfo_txt "Save Updated Info" pos:[3,269]
button runEmbed "Run Embedded Scripts" pos:[115,269] enabled:false
-- on cryinfo open
on cryInfoFloater open do
(
if $cryInfo != undefined then
(
cryInfo_txt.text = (getUserPropBuffer $cryInfo)
)
if $cryInfo == undefined then
(
cryInfo_txt.text = "There is no cryInfo node present.\nType info in here and press \"Save Updated Info\" to save cryInfo in this file."
)
if $cryEmbed == undefined then
(
runEmbed.enabled = false
)
else
(
runEmbed.enabled = true
)
)
-- on save info pressed
on saveinfo_txt pressed do
(
if $cryInfo == undefined then
(
dummy name:"cryInfo" pos:[0,0,0] boxsize:[1,1,1]
)
setUserPropBuffer $cryInfo cryInfo_txt.text
)
-- on runembed pressed
on runEmbed pressed do
(
runme = (getUserPropBuffer $cryEmbed)
execute runme
)
-- on resized do
on cryInfoFloater resized size do
(
size1 = size as string
size2 = filterstring size1 "[],"
cryInfo_txt.width = ((size2[1] as float) - 10)
cryInfo_txt.height = ((size2[2] as float) - 35)
saveinfo_txt.pos = [4, (cryInfoFloater.height - 26)]
)
)
createDialog cryInfoFloater 400 295 bgcolor:black fgcolor:white style:#(#style_resizing, #style_titlebar, #style_border, #style_sysmenu)
-76
View File
@@ -1,76 +0,0 @@
-------------------------------------------------------------------------------
-- cryInfoLoader.ms
-- This checks for cryinfo on load of every file.
-- Version 1.2
-- by Christopher Evans
-------------------------------------------------------------------------------
if cryInfoFloater != undefined do ( destroydialog cryInfoFloater )
if $cryInfo == undefined then
(
print "No cryInfo detected"
)
else
(
rollout cryInfoFloater "cryInfo 1.4"
(
edittext cryInfo_txt text:"cryInfo" fieldWidth:390 height:260 pos:[1,3]
button saveinfo_txt "Save Updated Info" pos:[3,269]
button runEmbed "Run Embedded Scripts" pos:[115,269] enabled:false
-- on cryinfo open
on cryInfoFloater open do
(
if $cryInfo != undefined then
(
cryInfo_txt.text = (getUserPropBuffer $cryInfo)
)
if $cryInfo == undefined then
(
cryInfo_txt.text = "There is no cryInfo node present.\nType info in here and press \"Save Updated Info\" to save cryInfo in this file."
)
if $cryEmbed == undefined then
(
runEmbed.enabled = false
)
else
(
runEmbed.enabled = true
)
)
-- on save info pressed
on saveinfo_txt pressed do
(
if $cryInfo == undefined then
(
dummy name:"cryInfo" pos:[0,0,0] boxsize:[1,1,1]
)
setUserPropBuffer $cryInfo cryInfo_txt.text
)
-- on runembed pressed
on runEmbed pressed do
(
runme = (getUserPropBuffer $cryEmbed)
execute runme
)
-- on resized do
on cryInfoFloater resized size do
(
size1 = size as string
size2 = filterstring size1 "[],"
cryInfo_txt.width = ((size2[1] as float) - 10)
cryInfo_txt.height = ((size2[2] as float) - 35)
saveinfo_txt.pos = [4, (cryInfoFloater.height - 26)]
)
)
createDialog cryInfoFloater 400 295 bgcolor:black fgcolor:white style:#(#style_resizing, #style_titlebar, #style_border, #style_sysmenu)
)
-150
View File
@@ -1,150 +0,0 @@
function createBlendFromMaxMat obj idx =
(
local blendShader = ""
local msg = ""
global buildPathFull_crytools
if buildPathFull_crytools == undefined then (
local scriptPath = getSourceFileName()
scriptPath = substituteString scriptPath "\\CryMakeBlendShader.ms" ""
print scriptPath
blendShader = (scriptPath + "\\fx\\cryBlendShader.fx")
) else (
blendShader = (buildPathFull_crytools + "Tools\\maxscript\\fx\\cryBlendShader.fx")
)
--local obj = $
local mat = obj.material
local numSubMats = getNumSubMtls mat
local matSlotOrig = (idx * 2) - 1
setMeditMaterial matSlotOrig mat
if (numSubMats > 0) then
(
local newMat = multiMaterial()
newMat.numsubs = numSubMats
newMat.name = (mat.name + "_DX")
local newSlot = matSlotOrig+1
setMeditMaterial newSlot newMat
activeMeditSlot = newSlot
print ("New MultiMaterial: "+newMat.name)
msg = ("Created mat: "+newMat.name+" in slot "+(newSlot as string))
local subMats = mat.materialList
for i = 1 to numSubMats do
(
newMat.materialList[i] = DirectX_9_Shader ()
newMat.materialList[i].effectFile = blendShader
newMat.materialList[i].name = mat.materialList[i].name
newMat.names[i] = mat.materialList[i].name
if (isValidObj mat.materialList[i].diffuseMap) then
(
print ("Creating submat "+mat.materialList[i].name+"...")
local bmFilename = mat.materialList[i].diffuseMap.fileName
if (doesFileExist(bmFilename)) then
(
local bm = openBitMap bmFilename
newMat.materialList[i].diffuseTexture1 = bm
) else (
print ("WARNING: File Not Found: "+bmFilename)
)
)
if (isValidObj mat.materialList[i].bumpMap) then
(
local bmFilename = mat.materialList[i].bumpMap.fileName
if (doesFileExist(bmFilename)) then
(
local bm = openBitMap bmFilename
newMat.materialList[i].normalMap = bm
) else (
print ("WARNING: File Not Found: "+bmFilename)
)
)
)
) else (
local newMat = Material()
newMat.name = (mat.name + "_DX")
local newSlot = matSlotOrig+1
setMeditMaterial newSlot newMat
activeMeditSlot = newSlot
print ("New Material: "+newMat.name)
msg = ("Created mat: "+newMat.name+" in slot "+(newSlot as string))
newMat = DirectX_9_Shader ()
newMat.effectFile = blendShader
if (isValidObj mat.diffuseMap) then
(
local bmFilename = mat.diffuseMap.fileName
if (doesFileExist(bmFilename)) then
(
local bm = openBitMap bmFilename
newMat.diffuseTexture1 = bm
) else (
print ("WARNING: File Not Found: "+bmFilename)
)
)
if (isValidObj mat.bumpMap) then
(
local bmFilename = mat.bumpMap.fileName
if (doesFileExist(bmFilename)) then
(
local bm = openBitMap bmFilename
newMat.normalMap = bm
) else (
print ("WARNING: File Not Found: "+bmFilename)
)
)
)
msg = (msg + "\n\nNow pick Dirt textures and apply new material to your object.")
MatEditor.Open()
messageBox msg title:"Cry Make Blend Shader"
)
try(destroyDialog CryBlendShader_rollout)catch()
rollout CryBlendShader_rollout "CryMakeBlendShader" width:200
(
button cryMakeBlend_button "Create Blend Shader" toolTip:"Create a DirectX Blend shader from the selected object's Max material(s)"
label cryMakeBlendMsg1 "Select an object, and press button"
label cryMakeBlendMsg2 "to create Blend Shader."
on cryMakeBlend_button pressed do
(
if ($ == undefined) then
(
cryMakeBlendMsg1.text = "You must select an object first"
) else (
for i=1 to selection.count do
(
createBlendFromMaxMat selection[i] i
)
)
)
)
createDialog CryBlendShader_rollout
-432
View File
@@ -1,432 +0,0 @@
struct CModelling(
GetNrstEdg, NxtEdg, IsSameLoop, SelLimELoop, NxtEdgRing, IsSameRing, SelLimERing, VertsInSameLoop, SelVertLoop,
SelVertRing, IsQuadPoly, SelPolyLoop
)
CryModelling = cmodelling()
-------------------------Limited Edge Loop---------------------------
CryModelling.GetNrstEdg = fn GetNrstEdg Edg1 Edg2 Target =
(
Edg1Vrts = (polyop.getvertsusingedge $ Edg1) as array
Edg2Vrts = (polyop.getvertsusingedge $ Edg2) as array
TrgtVrts = (polyop.getvertsusingedge $ Target) as array
mP1 = (((polyop.getvert $ Edg1Vrts[1]) + (polyop.getvert $ Edg1Vrts[2]))/2)
mP2 = (((polyop.getvert $ Edg2Vrts[1]) + (polyop.getvert $ Edg2Vrts[2]))/2)
TmP = (((polyop.getvert $ TrgtVrts[1]) + (polyop.getvert $ TrgtVrts[2]))/2)
if (distance Tmp mP1) > (distance Tmp mP2) then Edg2 else Edg1
)
CryModelling.NxtEdg = fn NxtEdg edg trg =
(
EdgsSel = polyop.getedgeselection $
Verts = (polyop.getEdgeVerts $ edg) as array
Tmp = #()
NEdg = #()
VEdgs = undefined
for vert in Verts do
(
VEdgs = (((polyop.getedgesUsingVert $ vert) - #{edg}) * EdgsSel) as array
--print VEdgs
for x in VEdgs do
(
append Tmp x
)
)
--print Tmp.count
if Tmp.count == 1 then append NEdg Tmp[1]
else
(
append NEdg (CryModelling.GetNrstEdg Tmp[1] Tmp[2] trg)
)
NEdg[1]
)
CryModelling.IsSameLoop = fn IsSameLoop =
(
with undo off
(
EdgSel = (polyop.getedgeselection $) as array
polyop.setEdgeSelection $ EdgSel[1]
$.buttonOp #selectEdgeLoop
NSel = polyop.getedgeselection $
polyop.setEdgeSelection $ EdgSel
if ((NSel * (EdgSel as bitarray)) as array).count != 2 then false else true
)
)
CryModelling.SelLimELoop = fn SelLimELoop =
(
try
(
EdgeSel = (polyop.getEdgeSelection $) as array
if CryModelling.IsSameLoop() == true then
(
with undo on
(
with redraw off
(
TargEdg = EdgeSel[2]
SEdg = EdgeSel[1]
NEdg = EdgeSel[1]
FinalSel = #(EdgeSel[1], EdgeSel[2])
$.buttonOp #selectEdgeLoop
while NEdg != EdgeSel[2] do
(
Edg = CryModelling.NxtEdg NEdg TargEdg
append FinalSel Edg
NEdg = Edg
)
)
)
polyop.setEdgeSelection $ FinalSel
)
else
(
$.buttonOp #selectEdgeLoop
)
)
catch (print "The tool works only on EditablePoly Objects.")
)
-------------------------Limited Edge Ring---------------------------
CryModelling.NxtEdgRing = fn NxtEdgRing edg trg =
(
EdgsSel = polyop.getedgeselection $
Verts = polyop.getEdgeVerts $ edg
Edg1 = polyop.getedgesusingvert $ Verts[1]
Edg2 = polyop.getedgesusingvert $ Verts[2]
EdgFaces = (polyop.getEdgeFaces $ edg) as array
NEdgs = #()
if EdgFaces.count == 1 then
(
Edgs = polyop.getFaceEdges $ EdgFaces[1] as bitarray
if Edgs.numberset == 4 do
(
(((Edgs - Edg1) - Edg2) as array)[1]
)
)
else
(
FEdgs1 = (polyop.getFaceEdges $ EdgFaces[1]) as bitarray
FEdgs2 = (polyop.getFaceEdges $ EdgFaces[2]) as bitarray
if FEdgs1.numberset == 4 do
(
append NEdgs (((FEdgs1 - Edg1) - Edg2) as array)[1]
)
if FEdgs2.numberset == 4 do
(
append NEdgs (((FEdgs2 - Edg1) - Edg2) as array)[1]
)
CryModelling.GetNrstEdg NEdgs[1] NEdgs[2] trg
)
)
CryModelling.IsSameRing = fn IsSameRing =
(
with undo off
(
EdgSel = (polyop.getedgeselection $) as array
polyop.setEdgeSelection $ EdgSel[1]
$.buttonOp #selectEdgeRing
NSel = polyop.getedgeselection $
polyop.setEdgeSelection $ EdgSel
if ((NSel * (EdgSel as bitarray)) as array).count != 2 then false else true
)
)
CryModelling.SelLimERing = fn SelLimERing =
(
try
(
EdgeSel = (polyop.getEdgeSelection $) as array
if CryModelling.IsSameRing() == true then
(
with undo on
(
with redraw off
(
TargEdg = EdgeSel[2]
SEdg = EdgeSel[1]
NEdg = EdgeSel[1]
FinalSel = #(EdgeSel[1], EdgeSel[2])
$.buttonOp #selectEdgeRing
while NEdg != EdgeSel[2] do
(
Edg = CryModelling.NxtEdgRing NEdg TargEdg
append FinalSel Edg
NEdg = Edg
)
)
)
polyop.setEdgeSelection $ FinalSel
)
else
(
$.buttonOp #selectEdgeRing
)
)
catch (print "The tool works only on EditablePoly Objects.")
)
-------------------------Limited Vert Loop----------------------------
CryModelling.VertsInSameLoop = fn VertsInSameLoop =
(
Verts = polyop.GetVertSelection $
Edgs = #()
for x in Verts do
(
Edges = polyop.GetEdgesUsingVert $ x
polyop.setEdgeSelection $ Edges
$.ButtonOp #SelectEdgeLoop
Tmp = polyop.GetEdgeSelection $
append Edgs Tmp
)
if (Edgs[1]*Edgs[2]).numberset != 0 then true else false
)
CryModelling.SelVertLoop = fn SelVertLoop =
(
try
(
if CryModelling.VertsInSameLoop() == true then
(
with undo on
(
with redraw off
(
Verts = polyop.GetVertSelection $
Edgs = #()
for x in Verts do
(
Edges = polyop.GetEdgesUsingVert $ x
polyop.setEdgeSelection $ Edges
$.ButtonOp #SelectEdgeLoop
Tmp = polyop.GetEdgeSelection $
append Edgs Tmp
)
LoopEdgs = Edgs[1]*Edgs[2]
V1Edges = (polyop.GetEdgesUsingVert $ (Verts as array)[1]) * LoopEdgs
V2Edges = (polyop.GetEdgesUsingVert $ (Verts as array)[2]) * LoopEdgs
LoopArr = #()
for i = 1 to 2 do
(
VEdgs = polyop.setEdgeSelection $ #{(V1Edges as array)[i], (V2Edges as array)[i]}
CryModelling.SelLimELoop()
append LoopArr (polyop.getEdgeSelection $)
)
FEdgs = LoopArr[1]*LoopArr[2]
FVerts = #{}
for x in FEdgs do
(
FVerts = FVerts + (polyop.GetVertsUsingEdge $ x)
)
polyop.setVertSelection $ FVerts
)
redrawViews()
)
)
else
(
print "Verts are not in the same loop!"
)
)
catch (print "The tool works only on EditablePoly Objects.")
)
-------------------------Limited Vert Ring------------------------------
CryModelling.SelVertRing = fn SelVertRing =
(
try
(
with undo on
(
with redraw off
(
VertSel = polyop.GetVertSelection $
UserEdgs = polyop.GetEdgeSelection $
Edgs = #{}
FEdgs = #{}
for v in VertSel do
(
Vedgs = polyop.GetEdgesUsingVert $ v
if Edgs.numberset != 0 then
(
Inter = Edgs * Vedgs
if Inter.numberset != 0 then
(
FEdgs = FEdgs + Inter
)
else
(
Edgs = Edgs + Vedgs
)
)
else
(
Edgs = Edgs + Vedgs
)
)
polyop.SetEdgeSelection $ FEdgs
SelLimERing()
ESel = polyop.GetEdgeSelection $
FVerts = #{}
for edg in ESel do
(
FVerts = FVerts + (polyop.GetVertsUsingEdge $ edg)
)
polyop.setEdgeSelection $ UserEdgs
polyop.setVertSelection $ FVerts
)
redrawviews()
)
)
catch (print "The tool works only on EditablePoly Objects.")
)
-------------------------Limited Poly Loop------------------------------
CryModelling.IsQuadPoly = fn IsQuadPoly =
(
Arr = #()
for x in $.selectedfaces do
(
a = (polyop.getFaceEdges $ x.index) as array
if a.count == 4 then
(
append Arr x
)
)
if Arr.count == $.selectedfaces.count then true else false
)
CryModelling.SelPolyLoop = fn SelPolyLoop =
(
try
(
if CryModelling.IsQuadPoly() == true then
(
EdgeCount = #{}
for x in $.selectedFaces do
(
a = (polyop.GetFaceEdges $ x.index) as array
for x in a do
(
append EdgeCount x
)
)
if (EdgeCount as array).count == ($.selectedFaces.count * 4) then
(
if $.selectedFaces.count == 1 then
(
with undo on
(
with redraw off
(
Sel = #{}
dg = polyop.SetEdgeSelection $ ((polyop.GetFaceEdges $ $.selectedFaces[1].index) as array)
$.buttonOp #selectEdgeRing
for x in $.selectedEdges do
(
a = (polyop.getEdgeFaces $ x.index) as array
for x in a do
(
if ((polyop.getFaceEdges $ x)as array).count == 4 then
(
append Sel x
)
)
)
polyop.SetFaceSelection $ Sel
)
redrawviews()
)
)
else
(
with undo on
(
with redraw off
(
Face1 = $.selectedFaces[1].index
Face2 = $.selectedFaces[2].index
Edgs1 = polyop.GetEdgesUsingFace $ Face1
Edgs2 = polyop.GetEdgesUsingFace $ Face2
UserSel = polyop.getedgeselection $
polyop.setEdgeSelection $ Edgs1
$.ButtonOp #SelectEdgeRing
NSel = (polyop.GetEdgeSelection $) - Edgs1
CrosSel = NSel * Edgs2
if CrosSel.numberset != 0 then
(
polyop.setEdgeSelection $ CrosSel
$.ButtonOp #SelectEdgeRing
NSel = (polyop.GetEdgeSelection $) - Edgs2
CrosSel2 = NSel * Edgs1
FinalEdgs = #{}
for i = 1 to 2 do
(
SelEdg = polyop.setEdgeSelection $ #((CrosSel as array)[i], (CrosSel2 as array)[i])
CryModelling.SelLimERing ()
FinalEdgs = FinalEdgs + (polyop.getedgeselection $)
)
polyop.setEdgeSelection $ UserSel
FinalFaces = #{}
for x in FinalEdgs do
(
Faces = polyop.getFacesUsingEdge $ x
for f in Faces do
(
if ((polyop.GetEdgesUsingFace $ f)*FinalEdgs).numberset == 2 then
(
append FinalFaces f
)
)
)
polyop.setFaceSelection $ FinalFaces
)
redrawViews()
)
)
)
)
else
(
if $.selectedFaces.count == 2 then
(
with undo on
(
with redraw off
(
Ar1 = #()
for x in $.selectedFaces do
(
Edg = polyop.getEdgesUsingFace $ x.index
append Ar1 Edg
)
FEdg = (Ar1[1]*Ar1[2])
polyop.setedgeselection $ FEdg
$.buttonOp #selectEdgeRing
Sel = #{}
for x in $.selectededges do
(
a = (polyop.getEdgeFaces $ x.index) as array
for x in a do
(
if ((polyop.getFaceEdges $ x)as array).count == 4 then
(
append Sel x
)
)
)
polyop.SetFaceSelection $ Sel
)
redrawviews ()
)
)
)
)
)
catch (print "The tool works only on EditablePoly Objects.")
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-682
View File
@@ -1,682 +0,0 @@
-------------------------------------------------------------------------------
-- Diagnostics.ms
-- Version 2.5
-- General cryTools control panel
-------------------------------------------------------------------------------
if diagnostics != undefined then
(
destroydialog diagnostics
)
rollout diagnostics "cryTools Control Panel 2.5"
(
group "Art"
(
checkbox warnMatsCheck "Check for Crytek shader at export"
checkbox reparentTwistCheck "Re-parent biped twist bones at export"
)
group "Animation"
(
checkbox loadOldAnimTools "Load Old Animation Tools"
checkbox noUnparentWeapons "Do not unparent $weapon_bone children at export"
--checkbox updateCollectionsCheck "Auto-update pose collections on max file open" --enabled:false
--checkbox syncCollectionsAtLoad "Sync pose collections at max start (P4)" --enabled:false
)
Group "Misc"
(
checkbox checkBeforeExport "Check before Export" checked:true
checkbox suppressWarningsCheck "Suppress all export warnings"
checkbox showSplashCheck "Show splash screen"
)
Group "Update/Uninstall/Rollback"
(
button update_btn " Reload/Install Updates From Your Local Build " align:#center enabled:false
button update_btnAB "Retrieve Latest Tools\Sync" align:#left enabled:false
checkbox BuildOn "LAN" offset:[150,-22] enabled:false
checkBox PerfOn "PerForce" offset:[195,-20] checked:true enabled:false
checkbox HTTPOn "CryHTTP" offset:[262,-20] enabled:false
checkbutton rollback_exporter "Rollback Exporter" offset:[-112,0] enabled:false
button uninstall_tools "Uninstall CryTools" offset:[-7,-26] enabled:false
label current_exportTXT "LOCAL BUILD: Cannot find Code_Changes.txt" align:#center enabled:false
)
button dumpCryToolsGlobals "dump crytools global vars" offset:[-100,0]
button callbackList "dump callbacks" offset:[18,-26]
button callbackRemove "remove callbacks" offset:[117,-26] tooltip:"right click to activate" enabled:true
--checkbox weaponChild "Remove $weapon_bone children (anim assets)" enabled:false
--label spacer01 ""
label maxVersionNum_crytools_LBL "MAX VERSION:" align:#left
label maxDirTxt_LBL "MAX PATH:" align:#left
label project_name_crytools_LBL "PROJECT: " align:#left
edittext projectEnter text:"NONE" offset:[60,-20] fieldWidth:180 --enabled:false
button pickProject "PICK" offset:[105,-21] height:15 --enabled:false
button setProject "SET" offset:[148,-21] height:15 --enabled:false
label domain_LBL "DOMAIN: " align:#left
label BuildPathFull_LBL "BUILD PATH: " align:#left
label cryINI_LBL "CRYEXPORT.INI PATH:" align:#left
label cryToolsINI_LBL "CRYTOOLS.INI PATH:" align:#left
label editorpath_LBL "EDITOR PATH:" align:#left
label cbaPath_LBL "CBA PATH: UNDEFINED" align:#left
label rollback_status_LBL "ROLLBACK STATUS:" align:#left
label localBuildNumber_crytools_LBL "LOCAL BUILD #: " align:#left
label latestbuildnumber_crytools_LBL "LATEST BUILD #:" align:#left
label latest_build_crytools_LBL "LATEST BUILD ON SERVER: " align:#left
--button refresh "REFRESH" offset:[140,-20]
--button getPoses "Get latest (P4)" offset:[120,-493] --enabled:false
on diagnostics open do
(
mat_dump = #("true","false","crytools.warnmats:")
--warn mats set
if crytools.warnmats == true then
(
warnMatsCheck.checked = true
)
else
(
warnMatsCheck.checked = false
)
--reparent twist set
if crytools.reparenttwist == true then
(
reparenttwistcheck.checked = true
)
else
(
reparenttwistcheck.checked = false
)
--check before export
if crytools.checkbeforeexport == true then
(
checkBeforeExport.checked = true
)
else
(
checkBeforeExport.checked = false
)
--suppress warnings set
if crytools.suppresswarnings == true then
(
suppressWarningsCheck.checked = true
)
else
(
suppressWarningsCheck.checked = false
)
--do not unparent weapon_bone children
if crytools.nounparentw == true then
(
noUnparentWeapons.checked = true
)
else
(
noUnparentWeapons.checked = false
)
--ActivateAnimTools
if crytools.loadoldanimtools == true then
(
loadOldAnimTools.checked = true
)
else
(
loadOldAnimTools.checked = false
)
--show splash
if crytools.showSplash == true then
(
showSplashCheck.checked = true
)
else
(
showSplashCheck.checked = false
)
/*
--update collections
if crytools.updateCollections == true then
(
updateCollectionsCheck.checked = true
)
else
(
updateCollectionsCheck.checked = false
)
*/
/*
--sync collections
if crytools.syncCollections == true then
(
syncCollectionsAtLoad.checked = true
)
else
(
syncCollectionsAtLoad.checked = false
)
*/
maxDirTxt_LBL.text = ("MAX PATH: " + crytools.maxDirTxt)
maxVersionNum_crytools_LBL.text = ("MAX VERSION: " + crytools.maxVersionNum as string)
--crytools.rollback_status
if crytools.rollback_status == undefined then
(
rollback_status_LBL.text = ("ROLLBACK STATUS: UNDEFINED")
)
else
(
rollback_status_LBL.text = ("ROLLBACK STATUS: " + crytools.rollback_status)
)
--crytools.project_name
/*if crytools.project_name == undefined then
(
project_name_crytools_LBL.text = ("PROJECT: UNDEFINED")
)
else
(
project_name_crytools_LBL.text = ("PROJECT: " + crytools.project_name)
)*/
/*
if crytools.project_name == undefined then
(
projectEnter.text = NONE
)
else
(
projectEnter.text = crytools.project_name
)
*/
if crytools.BuildPathFull == undefined then
projectEnter.text = "NONE"
else
projectEnter.text = crytools.BuildPathFull
--DOMAIN
if crytools.DOMAIN == undefined then
(
domain_LBL.text = ("DOMAIN: UNDEFINED")
)
else
(
domain_LBL.text = ("DOMAIN: " + crytools.DOMAIN)
)
cryINI_LBL.text = ("CRYEXPORT.INI PATH: " + crytools.cryINI)
cryToolsINI_LBL.text = ("CRYTOOLS.INI PATH: " + (sysInfo.tempDir + "cry_temp\\crytools.ini"))
editorpath_LBL.text = ("EDITOR PATH: " + crytools.editorPath)
cbaPath_LBL.text = ("CBA PATH: " + crytools.cbaPath)
--crytools.BuildPathFull
if crytools.BuildPathFull ==undefined then
(
BuildPathFull_LBL.text = ("BUILD PATH: UNDEFINED")
)
else
(
BuildPathFull_LBL.text = ("BUILD PATH: " + crytools.BuildPathFull)
)
if crytools.latest_build != undefined then
(
localBuildNumber_crytools_LBL.text = ("LOCAL BUILD #: " + crytools.localBuildNumber as string)
latestbuildnumber_crytools_LBL.text = ("LATEST BUILD #: " + crytools.latestbuildnumber as string)
latest_build_crytools_LBL.text = ("LATEST BUILD ON SERVER: " + crytools.latest_build)
)
-- in from updateTools
current_exportTXT.text = ("LOCAL BUILD: " + crytools.localBuildNumber as String+ " LATEST BUILD: " + crytools.latestbuildnumber as String)
if crytools.rollback_status == "true" do (rollback_exporter.checked = true)
if crytools.rollback_status == "false" do (rollback_exporter.checked = false)
)
on getPoses pressed do
(
p4Update = ("p4 sync " + crytools.BuildPathFull + "_Production\\Art\\Animation\\Human\\Resources\\poses\\...")
crytools.scmd p4Update true
)
on dumpCryToolsGlobals pressed do
(
print (apropos "crytools")
)
on callbacklist pressed do
(
print (callbacks.show())
)
on callbackRemove rightclick do
(
callbacks.removescripts()
)
--warn mats checked
on warnMatsCheck changed state do
(
cryTools.outToINI "CryTools" "warnmats" (state as String)
crytools.warnmats = state
)
--reparent checked
on reparentTwistCheck changed state do
(
cryTools.outToINI "CryTools" "reparent" (state as String)
crytools.reparenttwist = state
)
--no unparent $weapon_bone checked
on noUnparentWeapons changed state do
(
cryTools.outToINI "CryTools" "no_unparent_weapons" (state as String)
crytools.nounparentw = state
)
--Activate Anim Tools
on loadOldAnimTools changed state do
(
cryTools.outToINI "CryTools" "loadOld_animTools" (state as String)
if loadOldAnimTools.checked == false then
(
try closeRolloutfloater CryAnimationTools catch()
try
(
filein (crytools.BuildPathFull + "Tools\\maxscript\\cryAnim\\load.ms")
)
catch ( print "No load.ms in cryAnim found" )
)
else
(
if cryTools.cryAnim != undefined then
(
cryTools.cryAnim.base.killCryAnim()
filein (crytools.BuildPathFull + "Tools\\maxscript\\CryAnimationTools.ms")
)
)
cryTools.loadoldanimtools = state
crytools.generateMenu()
)
--check before export
on checkBeforeExport changed state do
(
cryTools.outToINI "CryTools" "checkExport" (state as String)
crytools.checkbeforeexport = state
)
--suppress warnings checked
on suppressWarningsCheck changed state do
(
cryTools.outToINI "CryTools" "suppress" (state as String)
crytools.suppresswarnings = state
)
--show splash checked
on showSplashCheck changed state do
(
cryTools.outToINI "CryTools" "splash" (state as String)
crytools.showSplash = state
)
/*
--auto update collections
on updateCollectionsCheck changed state do
(
if updateCollectionsCheck.checked == false then
(
oldData = (crytools.inFromINI (sysInfo.tempDir + "cry_temp\\crytools.ini") false)
oldData[11] = "UPDATE_COLLECTIONS:false"
crytools.outtoini oldData (sysInfo.tempDir + "cry_temp\\crytools.ini") false
crytools.updateCollections = false
callbacks.removescripts #filePostOpen id:#updateCollections
)
else
(
oldData = (crytools.inFromINI (sysInfo.tempDir + "cry_temp\\crytools.ini") false)
oldData[11] = "UPDATE_COLLECTIONS:true"
crytools.outtoini oldData (sysInfo.tempDir + "cry_temp\\crytools.ini") false
crytools.updateCollections = true
txt = "if $bip01 != undefined then (\n"
txt += "biped_ctrl = $bip01.controller\n"
txt += "biped.deleteallcopycollections biped_ctrl\n"
txt += "try(\n"
txt += "biped.loadCopyPasteFile biped_ctrl \"J:/Game02_Production/Art/Animation/Human/Resources/poses/crysis_male.cpy\"\n"
txt += "biped.loadCopyPasteFile biped_ctrl \"J:/Game02_Production/Art/Animation/Human/Resources/poses/crysis_female.cpy\"\n"
txt += "biped.loadCopyPasteFile biped_ctrl \"J:/Game02_Production/Art/Animation/Human/Resources/poses/crysis_male_combat.cpy\"\n"
txt += "biped.loadCopyPasteFile biped_ctrl \"J:/Game02_Production/Art/Animation/Human/Resources/poses/crysis_male_crouch.cpy\"\n"
txt += "biped.loadCopyPasteFile biped_ctrl \"J:/Game02_Production/Art/Animation/Human/Resources/poses/crysis_male_prone.cpy\"\n"
txt += "biped.loadCopyPasteFile biped_ctrl \"J:/Game02_Production/Art/Animation/Human/Resources/poses/crysis_male_relaxed.cpy\"\n"
txt += "biped.loadCopyPasteFile biped_ctrl \"J:/Game02_Production/Art/Animation/Human/Resources/poses/crysis_male_stealth.cpy\")\n"
txt += "catch (messagebox \"Cannot locate pose files\"))"
callbacks.addscript #filePostOpen txt id:#updateCollections
)
)
*/
/*
on syncCollectionsAtLoad changed state do
(
if syncCollectionsAtLoad.checked == false then
(
oldData = (crytools.inFromINI (sysInfo.tempDir + "cry_temp\\crytools.ini") false)
oldData[12] = "SYNC_COLLECTIONS:false"
crytools.outtoini oldData (sysInfo.tempDir + "cry_temp\\crytools.ini") false
crytools.syncCollections = false
)
else
(
oldData = (crytools.inFromINI (sysInfo.tempDir + "cry_temp\\crytools.ini") false)
oldData[12] = "SYNC_COLLECTIONS:true"
crytools.outtoini oldData (sysInfo.tempDir + "cry_temp\\crytools.ini") false
crytools.syncCollections = true
)
)
*/
on pickProject pressed do
(
local tempVar = (getSavePath caption:"Project Directory" initialDir:crytools.BuildPathFull)
if tempVar != undefined then
(
if tempVar[tempVar.count] != "\\" then
append tempVar "\\"
--crytools.BuildPathFull = tempVar
projectEnter.text = tempVar
)
)
on setProject pressed do
(
local buildPathNew = ""
local buildPathFilter = filterString projectEnter.text "\\"
for i = 1 to (buildPathFilter.count - 1) do
buildPathNew += buildPathFilter[i] + "\\"
buildPathNew += buildPathFilter[buildPathFilter.count]
if (queryBox ("Changing your project path to a bad location can render yout tools unusable.\nThis effects not only CryTools, but CryTif and others.\n\nAre you sure you would like to change your path to:\n" + buildPathNew) title:"Tread Carefullly.." beep:true) == true then
(
if crytools.maxversionnum >= 10 then
(
registry.openKey HKEY_CURRENT_USER "Software\\Crytek\\Settings\\" accessRights:#all key:&key1
registry.setValue key1 "RootPath" #REG_SZ buildPathNew
)
else
(
messagebox "The ability to edit the registry has been limited to versions of Max10 and later.\nWe used to dynamically generate, execute, and delete VBScripts to accomplish this.\nWindows Vista does not like this, and it was a hack anyway."
return undefined
)
)
else
(
return undefined
)
local animlistPathNew = buildPathNew + "Game\Animations\Animations.cba"
local folderArray = getDirectories (buildPathNew + "*")
local folderArrayNew = #()
if folderArray.count > 0 then
(
for i = 1 to folderArray.count do
(
tempArray = #(folderArray[i])
--// Add subFolderFiles to list
join tempArray (getDirectories (folderArray[i] + "*" ))
join folderArrayNew tempArray
)
)
local RCPath = ""
for i = 1 to folderArrayNew.count do
(
local tempArray = getFiles (folderArrayNew[i] + "*.*")
for f = 1 to tempArray.count do
(
if (findString tempArray[f] "rc.exe") != undefined then
(
RCPath = folderArrayNew[i]
exit
)
if RCPath != "" then
exit
)
)
local editorPathNew = ""
if RCPath != "" then
(
editorPathFilter = filterString RCPath "\\"
for i = 1 to (editorPathFilter.count - 1) do
editorPathNew += editorPathFilter[i] + "\\"
editorPathNew += "Editor.exe"
)
/*setINISetting (getDir #maxroot + "Plugins\\CryExport.ini") "SandBox" "path" editorPathNew
cryTools.editorPath = editorPathNew
setINISetting (getDir #maxroot + "Plugins\\CryExport.ini") "SandBox" "buildPath" buildPathNew
cryTools.buildPathFull = buildPathNew
setINISetting (getDir #maxroot + "Plugins\\CryExport.ini") "SandBox" "animlistpath" animlistPathNew
cryTools.cbapath = animlistPathNew*/
fileIn (getDir #maxroot + "scripts\\startup\\loadCryTools.ms")
)
--------------------------------------------------------------------------
-- UPDATE / UNINSTALL / ROLLBACK
--------------------------------------------------------------------------
on BuildOn changed state do
(
if BuildOn.checked == true then
(
PerfOn.checked = false
HTTPOn.checked = false
)
)
on PerfOn changed state do
(
if PerfOn.checked == true then
(
BuildOn.checked = false
HTTPOn.checked = false
)
)
on HTTPOn changed state do
(
if HTTPOn.checked == true then
(
PerfOn.checked = false
BuildOn.checked = false
)
)
on update_btn pressed do
(
filein (crytools.BuildPathFull + "Tools\\maxscript\\AddCryTools.ms")
current_exportTXT.text = ("LOCAL BUILD: " + crytools.localBuildNumber + " LATEST BUILD: " + crytools.latestbuildnumber)
print ("Build updated from " + crytools.BuildPathFull)
--destroyDialog checkForUpdate
)
-- Get Latest From AB and Latest Build
-------------------------------------------------------------------------------
on update_btnAB pressed do
(
try
(
if crytools.BuildPathFull == "J:\\Game04\\" then
(
messagebox "You are on Game04"
return undefined
)
-- AB Stuff
if HTTPOn.checked == true then
(
rollout httpSock "httpSock" width:0 height:0
(
activeXControl port "Microsoft.XMLHTTP" setupEvents:false releaseOnClose:false
);
createDialog httpSock pos:[-100,-100];
destroyDialog httpSock;
httpSock.port.open "GET" "http://www.crytek.com/index.htm" false;
httpSock.port.setrequestheader "If-Modified-Since" "Sat, 1 Jan 1900 00:00:00 GMT";
httpSock.port.send();
print (httpSock.port.responsetext);
)
-- P4 stuff
if perfOn.checked == true then
(
p4Update = ("p4 sync " + crytools.BuildPathFull + "Tools\...")
crytools.scmd p4Update true
)
if BuildOn.checked == true then
(
-- Latest Build Stuff
rollback_check = openFile (sysInfo.tempDir + "cry_temp\\crytools.rollback_status.ini")
if rollback_check == undefined then (crytools.rollback_status = "false")
crytools.rollback_status = "false"
latestCryExport = (crytools.md5 ("\\\\Storage\\builds\\" + crytools.latest_build + "\\Tools\\CryExport8.dlu"))
if crytools.md5 (crytools.maxDirTxt + "plugins\\CryExport8.dlu") != latestCryExport then
(
if crytools.existfile ("\\\\storage\\builds\\" + crytools.latest_build + "\\Tools\\CryExport8.dlu") == false then
(
messageBox ("There is no exporter on the build server in the latest folder [" + crytools.latest_build + "]") title: "No Exporter Found!"
)
else
(
messageBox ("There is a new exporter available in build " + crytools.latestbuildnumber) title: "New Exporter Found!"
crytools.scmd (("copy /Y \\\\storage\\builds\\" + crytools.latest_build + "\\Tools\\CryExport8.dlu ") + (crytools.BuildPathFull + "Tools\\")) true
)
)
)
)
catch
(
messageBox "Either cannot locate the build server [\\\\Storage\\], or you do not have crytools.alienBrain correctly installed." title: "Something is wrong!"
)
messageBox ("CryTools has checked Build [" + crytools.latestbuildnumber + "] for updates.\nPlease click the \"Check/Install Updates From Your Latest Build\" button to install any updates it found.") title: ("Checked Build \\Tools (" + localTime + ") - Checked Plugins From Build #" + crytools.latestbuildnumber)
)
-- Rollback Exporter
-------------------------------------------------------------------------------
on rollback_exporter changed state do
(
try
if (rollback_exporter.checked == true) then
(
crytools.rollback_status = "true"
crytools.scmd ("mkdir \"" + sysInfo.tempDir + "cry_temp\\bad\\\"") true
crytools.scmd ("move /Y " + ("\"" + crytools.maxDirTxt + "plugins\\CryExport8.dlu\"") + " " + (sysInfo.tempDir + "cry_temp\\bad\\")) true
crytools.scmd ("move /Y " + ("\"" +sysInfo.tempDir + "cry_temp\\CryExport8.dlu\"") + " " + (crytools.maxDirTxt + "plugins\\")) true
print "CryExport8.dlu has been rolled back to the previous version."
output_rollbackINI = openfile (sysInfo.tempDir + "\\cry_temp\\crytools.rollback_status.ini") mode:"w"
format crytools.rollback_status to: output_rollbackINI
close output_rollbackINI
messageBox "CryExport8.dlu has been rolled back to the previous version.\nTo get a newer exporter later you must click \"Get Latest Tools From crytools.alienBrain/Current Build\", or update your build." title: "CryExport8.dlu Rolled Back!"
)
else
(
crytools.rollback_status = "false"
output_rollbackINI = openfile (sysInfo.tempDir + "\\cry_temp\\crytools.rollback_status.ini") mode:"w"
format crytools.rollback_status to: output_rollbackINI
close output_rollbackINI
messageBox "You are no longer in rollback mode.\nTo get a newer exporter later you must click \"Get Latest Tools From crytools.alienBrain/Current Build\", or update your build." title: "CryExport8.dlu No Longer Rolled Back!"
)
catch
(
messageBox "Rollback error 1442." title:"Error!"
return undefined
)
)
-- Uninstall
-------------------------------------------------------------------------------
on uninstall_tools pressed do
(
rollout areYouSure "CryTools Uninstallation"
(
label doyouwant "Are you sure you want to completely remove CryTools?" align:#center
button uninstallNow "Yes" pos:[110,25]
button donotuninstall "No" pos:[150,25]
on donotuninstall pressed do
(
destroyDialog areYouSure
)
on uninstallNow pressed do
(
subMenu = menuMan.findMenu "CryTools"
menuMan.unRegisterMenu subMenu
deleteFile "$UI\\MacroScripts\\CryTools-UpdateTools.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryRigging.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryMorphManager.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryAnimation.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-SceneBrowser.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-help.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryMorphManager.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryInfoLoader.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryInfo.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryArtistTools.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-ControlPanel.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-UVscaleUniform.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-UVcollapseVertical.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-CryKeys-UVcollapseHorizontal.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-showVertexColors.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-resetXformCollapse.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-preserveUV.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-exportNodes.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-exportAnim.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-changeRefCoordSys.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-CenterPivot.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-showHideVertexColors.mcr"
deleteFile "$UI\\MacroScripts\\CryKeys-UVcollapseHorizontal.mcr"
crytools.maxDirTxt = (getdir #maxroot)
crytools.minusr (crytools.maxDirTxt + "scripts\\startup\\LoadCryTools.ms")
sleep 1
deleteFile (crytools.maxDirTxt + "scripts\\startup\\LoadCryTools.ms")
print (sysInfo.username + " has uninstalled CryTools.")
destroyDialog areYouSure
--destroyDialog checkForUpdate
messageBox ("CryExport8.dlu is still in your plugins folder because it is in use.\n" + sysInfo.username + ", cryTools has been uninstalled.") title: "Uninstallation complete!"
)
)
createDialog areYouSure 300 60 bgcolor:black fgcolor:white
)
/*on button refresh pressed do
(
filein (crytools.BuildPathFull + "tools\\maxscript\\Diagnostics.ms")
)*/
)
createDialog diagnostics 350 600 style:#(#style_resizing,#style_titlebar,#style_minimizebox,#style_sunkenedge,#style_sysmenu)
-227
View File
@@ -1,227 +0,0 @@
/*
[DESCRIPTION]
FBX to Bip conversion script.
[USAGE]
With a merged in FBX bone structure and a matching biped in the scene run this script.
It will go frame by frame and align the Bip structure to the Bone structure.
One limitation, the script is hardcoded to work with the Bone structure names with "_Bip01" as a prefix and the matching bip being named "Bip01"
This will be adressed in the future.
[CREATION INFO]
Author:Paul Hormis
Last Updated: July 17, 2006
[VERSION HISTORY]
v1.00 Created
Copyright (C) 2006 Paul Hormis
*/
Global FBXtoBipXFer, AnimXferProgress
Struct FBXtoBipXFerStruct
(
PelvisRef = undefined,
PelvisRot = undefined,
PelvisRotFinal = undefined,
LThighRef = undefined,
RThighRef = undefined,
BipPartStep = 100.0 / 51.0,
function DoCreatePointAtPivot ObjectForNull: =
(
try
(
tempRet = undefined
for MSobj in ObjectForNull do
with animate off
(
PivotPointHelper = Point pos:(MSobj.transform.pos) isSelected:off size:3 centermarker:off axistripod:off cross:on Box:off constantscreensize:off drawontop:off wirecolor:yellow
PivotPointHelper.name = ((MSobj.name as string) + "_PivotPoint")
in coordsys world PivotPointHelper.rotation = inverse(MSobj.transform.rotationPart)
in coordsys world PivotPointHelper.pos = MSobj.transform.pos
tempRet = PivotPointHelper
)
return tempRet
)catch()
),
function DoPosRotConst SelectedObj PARENTOBJ =
(
SelectedObj.position.controller = position_constraint()
SelectedObj.rotation.controller = orientation_constraint()
SelectedObj.position.controller.appendTarget PARENTOBJ 100
SelectedObj.rotation.controller.appendTarget PARENTOBJ 100
SelectedObj.position.controller.relative = false
SelectedObj.rotation.controller.relative = false
),
fn DoRotConst SelectedObj PARENTOBJ =
(
SelectedObj.rotation.controller = orientation_constraint()
SelectedObj.rotation.controller.appendTarget PARENTOBJ 100
SelectedObj.rotation.controller.relative = false
),
function SetBipPosAndRot BipTarget: BoneSource: step: =
(
biped.setTransform BipTarget #pos BoneSource.pos true
biped.setTransform BipTarget #rotation BoneSource.transform.rotation true
),
function SetBipRot BipTarget: BoneSource: step: =
(
biped.setTransform BipTarget #rotation BoneSource.transform.rotation true
),
function SetBipPos BipTarget: BoneSource: step: =
(
biped.setTransform BipTarget #pos BoneSource.pos true
),
function DoFBXtoBipXFer =
(
FBXtoBipXFer.LThighRef = (FBXtoBipXFerStruct.DoCreatePointAtPivot ObjectForNull:#($'_Bip01 L Thigh'))
FBXtoBipXFer.RThighRef = (FBXtoBipXFerStruct.DoCreatePointAtPivot ObjectForNull:#($'_Bip01 R Thigh'))
FBXtoBipXFer.LThighRef.parent = $'_Bip01 L Thigh'
FBXtoBipXFer.RThighRef.parent = $'_Bip01 R Thigh'
FBXtoBipXFer.PelvisRef = point name:"PelvisReferenceLocation" size:3
FBXtoBipXFerStruct.DoPosRotConst FBXtoBipXFer.PelvisRef FBXtoBipXFer.LThighRef
FBXtoBipXFerStruct.DoPosRotConst FBXtoBipXFer.PelvisRef FBXtoBipXFer.RThighRef
FBXtoBipXFer.PelvisRot = point pos:(FBXtoBipXFer.PelvisRef.transform.pos) name:"PelvisReferenceRotation" size:3 isSlected:off cross:off box:on
FBXtoBipXFer.PelvisRot.parent = FBXtoBipXFer.PelvisRef
FBXtoBipXFerStruct.DoRotConst FBXtoBipXFer.PelvisRot $'_Bip01 Pelvis'
FBXtoBipXFer.PelvisRotFinal = (FBXtoBipXFerStruct.DoCreatePointAtPivot ObjectForNull:FBXtoBipXFer.PelvisRot)
in coordsys local rotate FBXtoBipXFer.PelvisRotFinal (angleaxis 90 [0,1,0])
in coordsys local rotate FBXtoBipXFer.PelvisRotFinal (angleaxis 90 [0,0,1])
FBXtoBipXFer.PelvisRotFinal.parent = FBXtoBipXFer.PelvisRot
setCommandPanelTaskMode mode:#create -- Sets the command panel to create. Motion panel slows down processing.
cui.commandPanelOpen = false -- hides the command panel
clearSelection() -- clears the selection
if (viewport.getlayout()) != #layout_1 do (max tool maximize) -- If the viewport is not maximized then it will do so.
StartFrame = animationRange.start.frame as integer
EndFrame = animationRange.end.frame as integer
frameCount = EndFrame - StartFrame
progressFrameSteps = undefined
progressFrameSteps = 100.0 / frameCount
rollout AnimXferProgress "AnimationTransfer Progress" width:525 height:32
(
label ProgressInfo "Processing Animation Transfer" pos:[10,2] width:300 height:15
label CurrentFrameLabel "Frame:" pos:[400,2] width:35 height:15
label CurrentFrame "" pos:[440,2] width:80 height:15
progressBar SubProgress "" pos:[10,17] width:505 height:7 color:blue
progressBar MainProgress "" pos:[10,23] width:505 height:7 color:green
)
createdialog AnimXferProgress
animButtonState = true
for x = 0 to frameCount do
with redraw off
(
slidertime = (StartFrame + x)
AnimXferProgress.CurrentFrame.text = (slidertime.frame as integer) as string
AnimXferProgress.MainProgress.value = (progressFrameSteps * x + 1) -- I commented this out for speed
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01' BoneSource:FBXtoBipXFer.PelvisRotFinal
biped.setTransform $'Bip01 Pelvis' #rotation $'Bip01 Pelvis'.transform.rotation true
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 Spine' BoneSource:$'_Bip01 Spine' step:2
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 Spine1' BoneSource:$'_Bip01 Spine1' step:3
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 Spine2' BoneSource:$'_Bip01 Spine2' step:3
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 Spine3' BoneSource:$'_Bip01 Spine3' step:3
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 Neck' BoneSource:$'_Bip01 Neck' step:4
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 Head' BoneSource:$'_Bip01 Head' step:5
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Clavicle' BoneSource:$'_Bip01 L Clavicle' step:6
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L UpperArm' BoneSource:$'_Bip01 L UpperArm' step:7
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Forearm' BoneSource:$'_Bip01 L Forearm' step:8
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Hand' BoneSource:$'_Bip01 L Hand' step:9
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger0' BoneSource:$'_Bip01 L Finger0' step:10
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger01' BoneSource:$'_Bip01 L Finger01' step:11
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger02' BoneSource:$'_Bip01 L Finger02' step:12
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger1' BoneSource:$'_Bip01 L Finger1' step:13
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger11' BoneSource:$'_Bip01 L Finger11' step:14
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger12' BoneSource:$'_Bip01 L Finger12' step:15
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger2' BoneSource:$'_Bip01 L Finger2' step:16
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger21' BoneSource:$'_Bip01 L Finger21' step:17
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger22' BoneSource:$'_Bip01 L Finger22' step:18
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger3' BoneSource:$'_Bip01 L Finger3' step:19
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger31' BoneSource:$'_Bip01 L Finger31' step:20
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger32' BoneSource:$'_Bip01 L Finger32' step:21
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger4' BoneSource:$'_Bip01 L Finger4' step:22
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger41' BoneSource:$'_Bip01 L Finger41' step:23
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Finger42' BoneSource:$'_Bip01 L Finger42' step:24
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Clavicle' BoneSource:$'_Bip01 R Clavicle' step:25
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R UpperArm' BoneSource:$'_Bip01 R UpperArm' step:26
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Forearm' BoneSource:$'_Bip01 R Forearm' step:27
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Hand' BoneSource:$'_Bip01 R Hand' step:28
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger0' BoneSource:$'_Bip01 R Finger0' step:29
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger01' BoneSource:$'_Bip01 R Finger01' step:30
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger02' BoneSource:$'_Bip01 R Finger02' step:31
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger1' BoneSource:$'_Bip01 R Finger1' step:31
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger11' BoneSource:$'_Bip01 R Finger11' step:33
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger12' BoneSource:$'_Bip01 R Finger12' step:34
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger2' BoneSource:$'_Bip01 R Finger2' step:35
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger21' BoneSource:$'_Bip01 R Finger21' step:36
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger22' BoneSource:$'_Bip01 R Finger22' step:37
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger3' BoneSource:$'_Bip01 R Finger3' step:38
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger31' BoneSource:$'_Bip01 R Finger31' step:39
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger32' BoneSource:$'_Bip01 R Finger32' step:40
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger4' BoneSource:$'_Bip01 R Finger4' step:41
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger41' BoneSource:$'_Bip01 R Finger41' step:42
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Finger42' BoneSource:$'_Bip01 R Finger42' step:43
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Thigh' BoneSource:$'_Bip01 L Thigh' step:44
--FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Calf' BoneSource:$'_Bip01 L Calf' step:45
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Foot' BoneSource:$'_Bip01 L Foot' step:46
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 L Toe0' BoneSource:$'_Bip01 L Toe0' step:47
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Thigh' BoneSource:$'_Bip01 R Thigh' step:48
--FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Calf' BoneSource:$'_Bip01 R Calf' step:49
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Foot' BoneSource:$'_Bip01 R Foot' step:50
FBXtoBipXFer.SetBipPosAndRot BipTarget:$'Bip01 R Toe0' BoneSource:$'_Bip01 R Toe0' step:51
gc() -- I added this garbage collection to try to speed up the script.
)
delete FBXtoBipXFer.PelvisRef
delete FBXtoBipXFer.PelvisRot
delete FBXtoBipXFer.PelvisRotFinal
delete FBXtoBipXFer.LThighRef
delete FBXtoBipXFer.RThighRef
animButtonState = false
destroyDialog AnimXferProgress
cui.commandPanelOpen = true
)
)
FBXtoBipXFer = FBXtoBipXFerStruct()
FBXtoBipXFer.DoFBXtoBipXFer()
-61
View File
@@ -1,61 +0,0 @@
-------------------------------------------------------------------------------
-- LoadCryTools.ms
-- Version 2.2 External
-- By: Christopher Evans
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Get The Build Dirs
-------------------------------------------------------------------------------
-- Local Build Dir
if csexport != undefined then
(
global maxDirTxt_crytools = (getdir #maxroot)
global cryINI_crytools = (getdir #maxroot + "plugins\\CryExport.ini")
errorFound = false
try ( global buildPathFull_crytools = csexport.get_root_path() + "\\" )
catch
(
global buildPathFull_crytools = getINISetting cryINI_crytools "SandBox" "buildPath"
if buildPathFull_crytools == "" then
(
messageBox "Incompatible version of CryTools and CryExport" title:"Error loading CryTools"
errorFound = true
)
else
print "Loading CryTools from INI file"
)
if (doesfileexist(buildPathFull_crytools + "Bin64vc141\\Editor.exe") == true then
global editorPath_crytools = buildPathFull_crytools + "Bin64vc141\\Editor.exe"
else if (doesfileexist(buildPathFull_crytools + "Bin64vc140\\Editor.exe") == true then
global editorPath_crytools = buildPathFull_crytools + "Bin64vc140\\Editor.exe"
else
messagebox("I cannot find Editor.exe")
-- Load CryTools
-------------------------------------------------------------------------------
if errorFound == false then
(
if buildPathFull_crytools != "" then
(
if (doesfileexist (BuildPathFull_crytools + "Tools\\maxscript\\AddCryTools.ms")) == true then
FileIn (BuildPathFull_crytools + "Tools\\maxscript\\AddCryTools.ms")
else
messagebox ("I cannot find" + (BuildPathFull_crytools + "Tools\\maxscript\\AddCryTools.ms"))
)
else
messageBox "Can't find local Build from cryExport.ini" title:"Error loading CryTools"
)
)
else
messageBox "Error initialising CryTools: CryExport plugin not found"
-268
View File
@@ -1,268 +0,0 @@
--sceneView . Christopher Evans . Crytek
if sceneView != undefined then
(
destroyDialog sceneView
)
ilTv = dotNetObject "System.Windows.Forms.ImageList"
ilTv.imageSize = dotNetObject "System.Drawing.Size" 16 15
rollout sceneView "SceneView v.001"
(
fn getIconFromBitmap thePath number iconFileName =
(
theFileName = getDir #image +"\\icon_"+ iconFileName +".bmp"
if not doesFileExist theFileName do
(
tempBmp = openBitmap thePath
iconBmp = bitmap 16 15
for v = 0 to 14 do
setPixels iconBmp [0,v] (getPixels tempBmp [(number-1)*16, v] 16)
iconBmp.filename = theFileName
save iconBmp
close iconBmp
close tempBmp
)
img = dotNetClass "System.Drawing.Image" --create an image
ilTv.images.add (img.fromFile theFileName) --add to the list
)
fn initTreeView tv =
(
tv.Indent= 28
tv.CheckBoxes = true --same as in ActiveX
tv.labelEdit = true
tv.Indent = 15
tv.Scrollable = true
colorTest = dotNetClass "System.Drawing.Color"
tv.BackColor = colorTest.FromArgb 255 196 196 196
iconDir = (getDir #ui) + "\\icons\\"
--We call our function for each icon, this time also passing a
--third argument with the icon name suffix.
getIconFromBitmap (iconDir + "Standard_16i.bmp") 2 "Sphere"
getIconFromBitmap (iconDir + "Standard_16i.bmp") 1 "Box"
getIconFromBitmap (iconDir + "Lights_16i.bmp") 3 "Light"
getIconFromBitmap (iconDir + "Cameras_16i.bmp") 2 "Camera"
getIconFromBitmap (iconDir + "Helpers_16i.bmp") 1 "Helper"
getIconFromBitmap (iconDir + "Splines_16i.bmp") 2 "Shape"
getIconFromBitmap (iconDir + "Systems_16i.bmp") 1 "Bone"
--At the end, we assign the ImageList to the TreeView.
tv.imageList = ilTv
)
fn addChildren theNode theChildren =
(
for c in theChildren do
(
newNode = theNode.Nodes.add c.name c.name
newNode.tag = dotNetMXSValue c
--newNode.count = c.handle
--By default, all nodes will use icon 0 (the first one) unless
--specified otherwise via the .iconIndex and .selectedIconIndex
--properties. We set both of them to the icon corresponding to
--the superclass of the scene object:
newNode.imageIndex = newNode.selectedImageIndex = case superclassof c of
(
Default: 1
GeometryClass:
(
case (c.classid[1]) of
(
Default: 1
683634317: 6 -- bones
37157: 6 -- biped objects
)
)
Light: 2
Camera: 3
Helper: 4
)
newNode.checked = not c.isHidden --same as in ActiveX
--For the color, we create a DotNet color class from the
--wirecolor of the object and assign to the .forecolor of
--the TreeView node:
--newNode.forecolor = (dotNetClass "System.Drawing.Color").fromARGB c.wirecolor.r c.wirecolor.g c.wirecolor.b
addChildren newNode c.children
)
)
--Since every node uses icon with index 0 unless specified otherwise
--the Root Node will use the first icon by default.
fn fillInTreeView tv =
(
theRoot = sceneview.tv.Nodes.add "WORLD" "WORLD"
rootNodes = for o in objects where o.parent == undefined collect o
sceneview.addChildren theRoot rootNodes
)
fn refresh =
(
sceneview.tv.nodes.clear()
sceneview.fillInTreeView tv
sceneview.tv.topnode.expand()
)
fn getSelectedNode =
(
try
(
if selection[1] != undefined then
(
--print selection[1].name
sceneview.tv.SelectedNode = (sceneview.tv.nodes.Find selection[1].name true)[1]
sceneview.tv.SelectedNode.EnsureVisible()
colorTest = dotNetClass "System.Drawing.Color"
sceneview.tv.selectednode.backColor = colorTest.FromArgb 255 221 221 221
sceneview.tv.refresh()
)
)
catch -- for undo
(
refresh()
if selection[1] != undefined then
(
sceneview.tv.SelectedNode = (sceneview.tv.nodes.Find selection[1].name true)[1]
sceneview.tv.SelectedNode.EnsureVisible()
colorTest = dotNetClass "System.Drawing.Color"
sceneview.tv.selectednode.backColor = colorTest.FromArgb 255 221 221 221
)
)
)
fn hideNode =
(
if selection != undefined then
(
for obj in selection do
(
sceneview.tv.SelectedNode = (sceneview.tv.nodes.Find obj.name true)[1]
sceneview.tv.selectednode.checked = false
)
)
)
fn unhideNode =
(
if selection != undefined then
(
for obj in selection do
(
sceneview.tv.SelectedNode = (sceneview.tv.nodes.Find obj.name true)[1]
sceneview.tv.selectednode.checked = true
)
)
)
dotNetControl tv "TreeView" width:290 height:565 align:#center
button layerM "Layer Manager" offset:[-9,0] Align:#left
label info " (X) + all (C/V) +- children" offset:[5,-22]
on layerM pressed do
(
macros.run "layers" "layermanager"
)
on tv Click arg do
(
hitNode = tv.GetNodeAt (dotNetObject "System.Drawing.Point" arg.x arg.y)
if hitNode != undefined do
try(select hitNode.tag.value) catch(max select none)
)
on tv AfterCheck arg do
(
try (arg.node.tag.value.isHidden = not arg.node.checked)catch()
)
on tv AfterLabelEdit arg do
(
if arg.label != undefined then
(
arg.node.tag.value.name = arg.label
)
)
on tv keyUp arg do
(
--print arg.keyValue
case arg.keyValue of
(
67: tv.selectedNode.collapse() -- c key
88: tv.expandAll() -- x key
86: tv.selectedNode.ExpandAll() -- v key
13: tv.selectedNode.beginEdit() -- enter key
113: tv.selectedNode.beginEdit() -- F2
116: refresh() -- F5
)
)
fn OnClick sender args =
(
--print sender.Text
case sender.Text of
(
"Expand branches": if tv.selectedNode != undefined then tv.selectedNode.ExpandAll()
)
)
on tv beforeSelect arg do
(
colorTest = dotNetClass "System.Drawing.Color"
try (sceneview.tv.selectednode.backColor = colorTest.FromArgb 255 196 196 196) catch()
)
on tv nodeMouseClick arg do
(
if arg.button == tv.mousebuttons.right then
(
contextMenu = dotNetObject "System.Windows.Forms.ContextMenu"
contextMenu.MenuItems.Clear()
dotnet.addeventhandler (contextMenu.MenuItems.Add("Select all children")) "Click" OnClick
dotnet.addeventhandler (contextMenu.MenuItems.Add("Expand branches")) "Click" OnClick
pointTest = (dotNetObject "System.Drawing.Point" arg.x arg.y)
contextmenu.Show tv pointTest
)
)
on sceneView open do
(
initTreeView tv
fillInTreeView tv
tv.topnode.expand()
callbacks.addScript #nodeCreated "sceneView.refresh()" id:#upDateSceneView
callbacks.addScript #nodePostDelete "sceneView.refresh()" id:#upDateSceneView
callbacks.addScript #nodeRenamed "sceneView.refresh()" id:#upDateSceneView
callbacks.addScript #postNodesCloned "sceneView.refresh()" id:#upDateSceneView
callbacks.addScript #postMirrorNodes "sceneView.refresh()" id:#upDateSceneView
callbacks.addScript #selectionSetChanged "sceneView.getSelectedNode()" id:#upDateSceneView
callbacks.addScript #nodeHide "sceneView.hideNode()" id:#upDateSceneView
--callbacks.addScript #nodeUnhide "sceneView.unhideNode()" id:#upDateSceneView
callbacks.addScript #sceneUndo "sceneView.refresh()" id:#upDateSceneView
callbacks.addScript #sceneRedo "sceneView.refresh()" id:#upDateSceneView
)
on sceneView close do
(
callbacks.removeScripts id:#upDateSceneView
)
on sceneView resized size do
(
size1 = size as string
size2 = filterstring size1 "[],"
layerM.pos = [4, (sceneView.height - 26)]
info.pos = [100, (sceneView.height - 23)]
tv.height = ((size2[2] as float) - 35)
tv.width = ((size2[1] as float) - 10)
)
)
createDialog sceneView 300 600 style:#(#style_resizing, #style_titlebar, #style_border, #style_sysmenu)
@@ -1,992 +0,0 @@
--
-- This is a modified copy of ui\usermacros\Macro_SkinTools.mcr from 3DS MAX 2011 package.
--
/*
Skin Operations Macro Script File
Created: Aug 6 2000
Author : Peter Watje
Version: 3ds max 6
12 dec 2003, Pierre-Felix Breton,
added product switcher: this macro file can be shared with all Discreet products
*/
--***********************************************************************************************
-- MODIFY THIS AT YOUR OWN RISK
--
fn getSkinOps = (
try (
if(crySkinOps.isCrySkin(modPanel.GetcurrentObject())) then
(crySkinOps)
else
(skinOps)
)
catch (
(skinOps)
)
)
MacroScript SkinLoopSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Loop Selection"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Loop Selection (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).loopSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinRingSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Ring Selection"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Ring Selection (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ringSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinGrowSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Grow Selection"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Grow Selection (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).growSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinShrinkSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Shrink Selection"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Shrink Selection (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).shrinkSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinSelectVerticesByBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Select Vertices By Bone"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Vertices By Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).selectVerticesByBone (modPanel.GetcurrentObject())
)
)
MacroScript WeightTable_Dialog
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Weight Table Dialog"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Weight Table Dialog (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then
(
((getSkinOps()).isWeightTableOpen (modPanel.GetcurrentObject()) != 0)
)
else
(
false
)
)
on closeDialogs do
(
(getSkinOps()).closeWeightTable (modPanel.GetcurrentObject())
)
on execute do
(
(getSkinOps()).WeightTable (modPanel.GetcurrentObject())
)
)
MacroScript BlendWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Blend Weights"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Blend Weights (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).blendSelected (modPanel.GetcurrentObject())
)
)
MacroScript RemoveZeroWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Remove Zero Weights"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Remove Zero Weights (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).RemoveZeroWeights (modPanel.GetcurrentObject())
)
)
MacroScript WeightTool_Dialog
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Weight Tool Dialog"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Weight Tool Dialog (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then
(
((getSkinOps()).isWeightToolOpen (modPanel.GetcurrentObject()) != 0)
)
else
(
false
)
)
on closeDialogs do
(
(getSkinOps()).closeWeightTool (modPanel.GetcurrentObject())
)
on execute do
(
(getSkinOps()).WeightTool (modPanel.GetcurrentObject())
)
)
MacroScript SetWeight_00
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight To 0.0"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight To 0.0 (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.0
)
)
MacroScript SetWeight_01
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight To 0.10"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight To 0.10 (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.1
)
)
MacroScript SetWeight_25
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight To 0.25"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight To 0.25 (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.25
)
)
MacroScript SetWeight_50
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight To 0.50"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight To 0.5 (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.5
)
)
MacroScript SetWeight_75
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight To 0.75"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight To 0.75 (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.75
)
)
MacroScript SetWeight_90
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight To 0.90"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight To 0.90 (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.90
)
)
MacroScript SetWeight_100
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight To 1.0"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight To 1.0 (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 1.0
)
)
MacroScript SetWeight_Custom
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Set Weight Custom"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Set Weight Custom (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
tmod = modPanel.GetcurrentObject()
v = tmod.weightTool_weight
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) v
)
)
MacroScript AddWeight
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Add Weight"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Add Weight (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).AddWeight (modPanel.GetcurrentObject()) 0.05
)
)
MacroScript SubtractWeight
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Subtract Weight"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Subtract Weight (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).AddWeight (modPanel.GetcurrentObject()) -0.05
)
)
MacroScript ScaleWeight_Custom
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Scale Weight Custom"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Scale Weight Custom (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
tmod = modPanel.GetcurrentObject()
v = tmod.weightTool_scale
(getSkinOps()).ScaleWeight (modPanel.GetcurrentObject()) v
)
)
MacroScript ScaleWeight_Up
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Scale Weight Up"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Scale Weight Up (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ScaleWeight (modPanel.GetcurrentObject()) 1.05
)
)
MacroScript ScaleWeight_Down
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Scale Weight Down"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Scale Weight Down (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ScaleWeight (modPanel.GetcurrentObject()) 0.95
)
)
MacroScript CopyWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Copy Weights"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Copy Weights (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).CopyWeights (modPanel.GetcurrentObject())
)
)
MacroScript PasteWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Paste Weights"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Paste Weights (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).PasteWeights (modPanel.GetcurrentObject())
)
)
MacroScript PasteWeightsByPos
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Paste Weights By Pos"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Paste Weights By Pos(Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
tmod = modPanel.GetcurrentObject()
v = tmod.weightTool_tolerance
(getSkinOps()).pasteWeightsByPos (modPanel.GetcurrentObject()) v
)
)
MacroScript selectParent
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Parent Bone"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Parent Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectParent (modPanel.GetcurrentObject())
)
)
MacroScript selectChild
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Child Bone"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Child Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectChild (modPanel.GetcurrentObject())
)
)
MacroScript selectNextSibling
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Sibling Next"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Next Sibling Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectNextSibling (modPanel.GetcurrentObject())
)
)
MacroScript selectPreviousSibling
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Sibling Previous"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Previous Sibling Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectPreviousSibling (modPanel.GetcurrentObject())
)
)
MacroScript backFaceCullVertices
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Backface Cull Vertices"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Backface Cull Vertices (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).backfacecull
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).backfacecull then
(modPanel.GetcurrentObject()).backfacecull = false
else (modPanel.GetcurrentObject()).backfacecull = true
)
)
MacroScript AddBonesFromView
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Add Bones"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Add Bones (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
pushprompt "-- Click object to add as Bone"
(getSkinOps()).AddBoneFromViewStart (modPanel.GetcurrentObject())
)
)
MacroScript multiRemove
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Remove Bones"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Remove Multiple Bones (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).MultiRemove (modPanel.GetcurrentObject())
)
)
MacroScript selectPrevious
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Previous Bone"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Previous Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectPreviousBone (modPanel.GetcurrentObject())
)
)
MacroScript selectNext
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Next Bone"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Next Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectNextBone (modPanel.GetcurrentObject())
)
)
MacroScript zoomToBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Zoom To Bone"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Zoom To Selected Bone (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ZoomToBone (modPanel.GetcurrentObject()) FALSE
)
)
MacroScript zoomToGizmo
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Zoom To Gizmo"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Zoom To Selected Gizmo (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ZoomToGizmo (modPanel.GetcurrentObject()) FALSE
)
)
MacroScript selectEndPoint
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Select End Point"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select End Point (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).SelectEndPoint (modPanel.GetcurrentObject())
)
)
MacroScript selectStartPoint
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Select Start Point"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Start Point (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).SelectStartPoint (modPanel.GetcurrentObject())
)
)
MacroScript filterVertices
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Select Vertices"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Filter Vertices (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).filter_vertices
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).filter_vertices then
(modPanel.GetcurrentObject()).filter_vertices = FALSE
else (modPanel.GetcurrentObject()).filter_vertices = TRUE
)
)
MacroScript filterEnvelopes
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Select Cross Sections"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Filter Cross Sections (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).filter_cross_sections
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).filter_cross_sections then
(modPanel.GetcurrentObject()).filter_cross_sections = FALSE
else (modPanel.GetcurrentObject()).filter_cross_sections = TRUE
)
)
MacroScript filterCrossSections
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Select Envelopes"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Filter Envelopes (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).filter_envelopes
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).filter_envelopes then
(modPanel.GetcurrentObject()).filter_envelopes = false
else (modPanel.GetcurrentObject()).filter_envelopes = true
)
)
MacroScript excludeVerts
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Exclude Verts"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Exclude Verts (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).ButtonExclude (modPanel.GetcurrentObject())
)
)
MacroScript includeVerts
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Include Verts"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Include Verts (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).ButtonInclude (modPanel.GetcurrentObject())
)
)
MacroScript selectIncludeVerts
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Select Excluded Verts"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Select Excluded Verts (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ButtonSelectExcluded (modPanel.GetcurrentObject())
)
)
-- Added August 27 2000 Fred Ruff
MacroScript CopySelectedBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Copy Envelope"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Copy Envelope (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).copySelectedBone (modPanel.GetcurrentObject())
)
)
MacroScript PasteToSelectedBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Paste Envelope"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Paste Envelope (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).PasteToSelectedBone (modPanel.GetcurrentObject())
)
)
MacroScript PasteToAllBones
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Paste to All Envelope"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Paste To All Envelopes (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).PasteToAllBones (modPanel.GetcurrentObject())
)
)
MacroScript AddCrossSection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Add Cross Section"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Add Cross Section (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ButtonAddCrossSection (modPanel.GetcurrentObject())
)
)
MacroScript RemoveCrossSection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Remove Cross Section"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Remove Cross Section (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ButtonRemoveCrossSection (modPanel.GetcurrentObject())
)
)
MacroScript DrawEnvelopeOnTop
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Envelope On Top"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Draw Envelope On Top (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).envelopesAlwaysOnTop
)
else
(
false
)
)
on execute do
(
if Selection[1].modifiers[#Skin].envelopesAlwaysOnTop then
Selection[1].modifiers[#Skin].envelopesAlwaysOnTop = FALSE
else Selection[1].modifiers[#Skin].envelopesAlwaysOnTop = TRUE
)
)
MacroScript DrawCrossSectionsOnTop
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"CrossSections On Top"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Draw CrossSections On Top (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then
(
(modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop
)
else
(
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop then
(modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop = false
else (modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop = true
)
)
MacroScript GizmoResetRotationPlane
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:"Gizmo Reset Reset Rotation Plane"
Category:"Skin Modifier"
internalCategory:"Skin Modifier"
Tooltip:"Gizmo Reset Reset Rotation Plane (Skin)"
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).GizmoResetRotationPlane (modPanel.GetcurrentObject())
)
)
@@ -1,992 +0,0 @@
--
-- This is a modified copy of ui\usermacros\Macro_SkinTools.mcr from 3DS MAX 2012 package.
--
/*
Skin Operations Macro Script File
Created: Aug 6 2000
Author : Peter Watje
Version: 3ds max 6
12 dec 2003, Pierre-Felix Breton,
added product switcher: this macro file can be shared with all Discreet products
*/
--***********************************************************************************************
-- MODIFY THIS AT YOUR OWN RISK
--
fn getSkinOps = (
try (
if(crySkinOps.isCrySkin(modPanel.GetcurrentObject())) then
(crySkinOps)
else
(skinOps)
)
catch (
(skinOps)
)
)
MacroScript SkinLoopSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SKINLOOPSELECTION_BUTTONTEXT~
Category:~SKINLOOPSELECTION_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SKINLOOPSELECTION_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).loopSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinRingSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SKINRINGSELECTION_BUTTONTEXT~
Category:~SKINRINGSELECTION_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SKINRINGSELECTION_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ringSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinGrowSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SKINGROWSELECTION_BUTTONTEXT~
Category:~SKINGROWSELECTION_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SKINGROWSELECTION_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).growSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinShrinkSelection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SKINSHRINKSELECTION_BUTTONTEXT~
Category:~SKINSHRINKSELECTION_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SKINSHRINKSELECTION_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).shrinkSelection (modPanel.GetcurrentObject())
)
)
MacroScript SkinSelectVerticesByBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SKINSELECTVERTICESBYBONE_BUTTONTEXT~
Category:~SKINSELECTVERTICESBYBONE_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SKINSELECTVERTICESBYBONE_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).selectVerticesByBone (modPanel.GetcurrentObject())
)
)
MacroScript WeightTable_Dialog
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~WEIGHTTABLE_DIALOG_BUTTONTEXT~
Category:~WEIGHTTABLE_DIALOG_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~WEIGHTTABLE_DIALOG_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then
(
((getSkinOps()).isWeightTableOpen (modPanel.GetcurrentObject()) != 0)
)
else
(
false
)
)
on closeDialogs do
(
(getSkinOps()).closeWeightTable (modPanel.GetcurrentObject())
)
on execute do
(
(getSkinOps()).WeightTable (modPanel.GetcurrentObject())
)
)
MacroScript BlendWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~BLENDWEIGHTS_BUTTONTEXT~
Category:~BLENDWEIGHTS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~BLENDWEIGHTS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).blendSelected (modPanel.GetcurrentObject())
)
)
MacroScript RemoveZeroWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~REMOVEZEROWEIGHTS_BUTTONTEXT~
Category:~REMOVEZEROWEIGHTS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~REMOVEZEROWEIGHTS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).RemoveZeroWeights (modPanel.GetcurrentObject())
)
)
MacroScript WeightTool_Dialog
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~WEIGHTTOOL_DIALOG_BUTTONTEXT~
Category:~WEIGHTTOOL_DIALOG_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~WEIGHTTOOL_DIALOG_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then
(
((getSkinOps()).isWeightToolOpen (modPanel.GetcurrentObject()) != 0)
)
else
(
false
)
)
on closeDialogs do
(
(getSkinOps()).closeWeightTool (modPanel.GetcurrentObject())
)
on execute do
(
(getSkinOps()).WeightTool (modPanel.GetcurrentObject())
)
)
MacroScript SetWeight_00
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_00_BUTTONTEXT~
Category:~SETWEIGHT_00_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_00_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.0
)
)
MacroScript SetWeight_01
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_01_BUTTONTEXT~
Category:~SETWEIGHT_01_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_01_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.1
)
)
MacroScript SetWeight_25
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_25_BUTTONTEXT~
Category:~SETWEIGHT_25_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_25_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.25
)
)
MacroScript SetWeight_50
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_50_BUTTONTEXT~
Category:~SETWEIGHT_50_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_50_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.5
)
)
MacroScript SetWeight_75
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_75_BUTTONTEXT~
Category:~SETWEIGHT_75_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_75_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.75
)
)
MacroScript SetWeight_90
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_90_BUTTONTEXT~
Category:~SETWEIGHT_90_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_90_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 0.90
)
)
MacroScript SetWeight_100
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_100_BUTTONTEXT~
Category:~SETWEIGHT_100_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_100_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) 1.0
)
)
MacroScript SetWeight_Custom
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SETWEIGHT_CUSTOM_BUTTONTEXT~
Category:~SETWEIGHT_CUSTOM_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SETWEIGHT_CUSTOM_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
tmod = modPanel.GetcurrentObject()
v = tmod.weightTool_weight
(getSkinOps()).SetWeight (modPanel.GetcurrentObject()) v
)
)
MacroScript AddWeight
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~ADDWEIGHT_BUTTONTEXT~
Category:~ADDWEIGHT_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~ADDWEIGHT_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).AddWeight (modPanel.GetcurrentObject()) 0.05
)
)
MacroScript SubtractWeight
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SUBTRACTWEIGHT_BUTTONTEXT~
Category:~SUBTRACTWEIGHT_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SUBTRACTWEIGHT_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).AddWeight (modPanel.GetcurrentObject()) -0.05
)
)
MacroScript ScaleWeight_Custom
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SCALEWEIGHT_CUSTOM_BUTTONTEXT~
Category:~SCALEWEIGHT_CUSTOM_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SCALEWEIGHT_CUSTOM_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
tmod = modPanel.GetcurrentObject()
v = tmod.weightTool_scale
(getSkinOps()).ScaleWeight (modPanel.GetcurrentObject()) v
)
)
MacroScript ScaleWeight_Up
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SCALEWEIGHT_UP_BUTTONTEXT~
Category:~SCALEWEIGHT_UP_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SCALEWEIGHT_UP_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ScaleWeight (modPanel.GetcurrentObject()) 1.05
)
)
MacroScript ScaleWeight_Down
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SCALEWEIGHT_DOWN_BUTTONTEXT~
Category:~SCALEWEIGHT_DOWN_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SCALEWEIGHT_DOWN_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ScaleWeight (modPanel.GetcurrentObject()) 0.95
)
)
MacroScript CopyWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~COPYWEIGHTS_BUTTONTEXT~
Category:~COPYWEIGHTS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~COPYWEIGHTS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).CopyWeights (modPanel.GetcurrentObject())
)
)
MacroScript PasteWeights
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~PASTEWEIGHTS_BUTTONTEXT~
Category:~PASTEWEIGHTS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~PASTEWEIGHTS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).PasteWeights (modPanel.GetcurrentObject())
)
)
MacroScript PasteWeightsByPos
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~PASTEWEIGHTSBYPOS_BUTTONTEXT~
Category:~PASTEWEIGHTSBYPOS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~PASTEWEIGHTSBYPOS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
tmod = modPanel.GetcurrentObject()
v = tmod.weightTool_tolerance
(getSkinOps()).pasteWeightsByPos (modPanel.GetcurrentObject()) v
)
)
MacroScript selectParent
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTPARENT_BUTTONTEXT~
Category:~SELECTPARENT_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTPARENT_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectParent (modPanel.GetcurrentObject())
)
)
MacroScript selectChild
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTCHILD_BUTTONTEXT~
Category:~SELECTCHILD_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTCHILD_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectChild (modPanel.GetcurrentObject())
)
)
MacroScript selectNextSibling
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTNEXTSIBLING_BUTTONTEXT~
Category:~SELECTNEXTSIBLING_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTNEXTSIBLING_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectNextSibling (modPanel.GetcurrentObject())
)
)
MacroScript selectPreviousSibling
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTPREVIOUSSIBLING_BUTTONTEXT~
Category:~SELECTPREVIOUSSIBLING_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTPREVIOUSSIBLING_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectPreviousSibling (modPanel.GetcurrentObject())
)
)
MacroScript backFaceCullVertices
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~BACKFACECULLVERTICES_BUTTONTEXT~
Category:~BACKFACECULLVERTICES_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~BACKFACECULLVERTICES_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).backfacecull
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).backfacecull then
(modPanel.GetcurrentObject()).backfacecull = false
else (modPanel.GetcurrentObject()).backfacecull = true
)
)
MacroScript AddBonesFromView
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~ADDBONESFROMVIEW_BUTTONTEXT~
Category:~ADDBONESFROMVIEW_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~ADDBONESFROMVIEW_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
pushprompt ~ADDBONESFROMVIEW_PUSHPROMPT_CAPTION~
(getSkinOps()).AddBoneFromViewStart (modPanel.GetcurrentObject())
)
)
MacroScript multiRemove
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~MULTIREMOVE_BUTTONTEXT~
Category:~MULTIREMOVE_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~MULTIREMOVE_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).MultiRemove (modPanel.GetcurrentObject())
)
)
MacroScript selectPrevious
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTPREVIOUS_BUTTONTEXT~
Category:~SELECTPREVIOUS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTPREVIOUS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectPreviousBone (modPanel.GetcurrentObject())
)
)
MacroScript selectNext
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTNEXT_BUTTONTEXT~
Category:~SELECTNEXT_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTNEXT_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).SelectNextBone (modPanel.GetcurrentObject())
)
)
MacroScript zoomToBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~ZOOMTOBONE_BUTTONTEXT~
Category:~ZOOMTOBONE_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~ZOOMTOBONE_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ZoomToBone (modPanel.GetcurrentObject()) FALSE
)
)
MacroScript zoomToGizmo
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~ZOOMTOGIZMO_BUTTONTEXT~
Category:~ZOOMTOGIZMO_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~ZOOMTOGIZMO_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ZoomToGizmo (modPanel.GetcurrentObject()) FALSE
)
)
MacroScript selectEndPoint
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTENDPOINT_BUTTONTEXT~
Category:~SELECTENDPOINT_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTENDPOINT_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).SelectEndPoint (modPanel.GetcurrentObject())
)
)
MacroScript selectStartPoint
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTSTARTPOINT_BUTTONTEXT~
Category:~SELECTSTARTPOINT_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTSTARTPOINT_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).SelectStartPoint (modPanel.GetcurrentObject())
)
)
MacroScript filterVertices
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~FILTERVERTICES_BUTTONTEXT~
Category:~FILTERVERTICES_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~FILTERVERTICES_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).filter_vertices
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).filter_vertices then
(modPanel.GetcurrentObject()).filter_vertices = FALSE
else (modPanel.GetcurrentObject()).filter_vertices = TRUE
)
)
MacroScript filterEnvelopes
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~FILTERENVELOPES_BUTTONTEXT~
Category:~FILTERENVELOPES_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~FILTERENVELOPES_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).filter_cross_sections
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).filter_cross_sections then
(modPanel.GetcurrentObject()).filter_cross_sections = FALSE
else (modPanel.GetcurrentObject()).filter_cross_sections = TRUE
)
)
MacroScript filterCrossSections
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~FILTERCROSSSECTIONS_BUTTONTEXT~
Category:~FILTERCROSSSECTIONS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~FILTERCROSSSECTIONS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).filter_envelopes
)
else (
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).filter_envelopes then
(modPanel.GetcurrentObject()).filter_envelopes = false
else (modPanel.GetcurrentObject()).filter_envelopes = true
)
)
MacroScript excludeVerts
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~EXCLUDEVERTS_BUTTONTEXT~
Category:~EXCLUDEVERTS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~EXCLUDEVERTS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).ButtonExclude (modPanel.GetcurrentObject())
)
)
MacroScript includeVerts
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~INCLUDEVERTS_BUTTONTEXT~
Category:~INCLUDEVERTS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~INCLUDEVERTS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on Execute do
(
(getSkinOps()).ButtonInclude (modPanel.GetcurrentObject())
)
)
MacroScript selectIncludeVerts
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~SELECTINCLUDEVERTS_BUTTONTEXT~
Category:~SELECTINCLUDEVERTS_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~SELECTINCLUDEVERTS_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ButtonSelectExcluded (modPanel.GetcurrentObject())
)
)
-- Added August 27 2000 Fred Ruff
MacroScript CopySelectedBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~COPYSELECTEDBONE_BUTTONTEXT~
Category:~COPYSELECTEDBONE_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~COPYSELECTEDBONE_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).copySelectedBone (modPanel.GetcurrentObject())
)
)
MacroScript PasteToSelectedBone
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~PASTETOSELECTEDBONE_BUTTONTEXT~
Category:~PASTETOSELECTEDBONE_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~PASTETOSELECTEDBONE_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).PasteToSelectedBone (modPanel.GetcurrentObject())
)
)
MacroScript PasteToAllBones
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~PASTETOALLBONES_BUTTONTEXT~
Category:~PASTETOALLBONES_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~PASTETOALLBONES_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).PasteToAllBones (modPanel.GetcurrentObject())
)
)
MacroScript AddCrossSection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~ADDCROSSSECTION_BUTTONTEXT~
Category:~ADDCROSSSECTION_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~ADDCROSSSECTION_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ButtonAddCrossSection (modPanel.GetcurrentObject())
)
)
MacroScript RemoveCrossSection
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~REMOVECROSSSECTION_BUTTONTEXT~
Category:~REMOVECROSSSECTION_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~REMOVECROSSSECTION_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).ButtonRemoveCrossSection (modPanel.GetcurrentObject())
)
)
MacroScript DrawEnvelopeOnTop
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~DRAWENVELOPEONTOP_BUTTONTEXT~
Category:~DRAWENVELOPEONTOP_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~DRAWENVELOPEONTOP_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then (
(modPanel.GetcurrentObject()).envelopesAlwaysOnTop
)
else
(
false
)
)
on execute do
(
if Selection[1].modifiers[#Skin].envelopesAlwaysOnTop then
Selection[1].modifiers[#Skin].envelopesAlwaysOnTop = FALSE
else Selection[1].modifiers[#Skin].envelopesAlwaysOnTop = TRUE
)
)
MacroScript DrawCrossSectionsOnTop
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~DRAWCROSSSECTIONSONTOP_BUTTONTEXT~
Category:~DRAWCROSSSECTIONSONTOP_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~DRAWCROSSSECTIONSONTOP_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ((classof(modPanel.GetcurrentObject())) == Skin)
on isChecked return
(
if (classof(modPanel.GetcurrentObject())) == Skin then
(
(modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop
)
else
(
false
)
)
on execute do
(
if (modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop then
(modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop = false
else (modPanel.GetcurrentObject()).crossSectionsAlwaysOnTop = true
)
)
MacroScript GizmoResetRotationPlane
enabledIn:#("max") --pfb: 2003.12.12 added product switch
ButtonText:~GIZMORESETROTATIONPLANE_BUTTONTEXT~
Category:~GIZMORESETROTATIONPLANE_CATEGORY~
internalCategory:"Skin Modifier"
Tooltip:~GIZMORESETROTATIONPLANE_TOOLTIP~
-- Needs Icon
(
on isVisible return ( (classof(modPanel.GetcurrentObject())) == Skin)
on isEnabled return ( (classof(modPanel.GetcurrentObject())) == Skin)
on execute do
(
(getSkinOps()).GizmoResetRotationPlane (modPanel.GetcurrentObject())
)
)
-244
View File
@@ -1,244 +0,0 @@
-------------------------------------------------------------------------------
-- UpdateTools.ms
-- Version 2.0
-- Updates local CryTools files
-------------------------------------------------------------------------------
version_ = "CryToolsUpdate 2.2"
-------------------------------------------------------------------------------
-- Get The Build Dirs
-------------------------------------------------------------------------------
-- Write Latest Builds on S:\_Builds to Local File
print "Retrieving list of latest builds from \\\\Storage\\builds"
DOScommand ("DIR \\\\storage\\builds\\procedurally_generated_builds\\ /B /O-D > \"" + sysInfo.tempDir + "cry_temp\\latest_build_crytoolss.txt\"")
if doesfileexist "\\\\storage\\builds\\procedurally_generated_builds\\" == false then
(
messageBox "Cannot locate \\\\Storage\\builds\\procedurally_generated_builds\nYou may need to contact SYSTEM_SUPPORT." title: "S Drive not found!"
return undefined
)
-- Gets the latest build number and build name
if crytools.existFile (sysInfo.tempDir + "cry_temp\\latest_build_crytoolss.txt") != false then
(
if doesfileexist "\\\\storage\\builds\\procedurally_generated_builds" != true then
(
messagebox "Cannot find \\\\storage\\builds\\procedurally_generated_builds\\"
return undefined
)
latest_build_crytools_list = openFile (sysInfo.tempDir + "cry_temp\\latest_build_crytoolss.txt")
crytools.latest_build = (readline latest_build_crytools_list)
if crytools.latest_build == "TempBuildCopy" then
(
skipToNextLine latest_build_crytools_list
crytools.latest_build = (readline latest_build_crytools_list)
)
buildnumberArray = filterstring crytools.latest_build "()"
crytools.latestbuildnumber = buildnumberArray[2]
close latest_build_crytools_list
)
-- Get the local build number
print crytools.BuildPathFull
if crytools.existfile ((crytools.BuildPathFull + "Code_Changes.txt")) == false then
(
messageBox "Code_Changes.txt cannot be found in your build directory, have you removed it?" title: "Error!"
)
else
(
perf_path = (crytools.BuildPathFull + "Code_Changes.txt")
perf_changes = openFile perf_path
skipToString perf_changes "in Build "
local_build_line = (readLine perf_changes)
local_buildArray = (filterString local_build_line "-")
crytools.localBuildNumber = local_buildArray[1]
)
-- Get The Project Name
buildpatharray2 = filterstring crytools.BuildPathFull "\\"
crytools.project_name = buildpatharray2[2]
print (crytools.project_name + " is set as current project.")
-- Check For Rollback
rollback_check = openFile (sysInfo.tempDir + "cry_temp\\crytools.rollback_status.ini")
if crytools.rollback_status == undefined then
(
crytools.rollback_status = "false"
output_rollbackINI = createfile (sysInfo.tempDir + "\\cry_temp\\crytools.rollback_status.ini")
format crytools.rollback_status to: output_rollbackINI
close output_rollbackINI
)
if rollback_check != undefined then
(
crytools.rollback_status = (readline rollback_check)
)
-------------------------------------------------------------------------------
-- UpdateUI
-------------------------------------------------------------------------------
print (sysInfo.username + " is requesting an update.")
rollout checkForUpdate version_
(
label tools_version "" align:#center
button update_btn " Check/Install Updates From Your Latest Build"
button update_btnAB "Retrieve Latest Tools\Sync"
checkbox BuildOn "Current Build" offset:[0,-4]
checkBox PerfOn "PerForce" offset:[84,-20] checked:true
checkbox HTTPOn "CryHTTP" offset:[151,-20]
checkbutton rollback_exporter "Rollback Exporter" offset:[-55,0]
button uninstall_tools "Uninstall CryTools" offset:[55,-26]
label current_exportTXT "LOCAL BUILD: Cannot find Code_Changes.txt" align:#center
on checkForUpdate open do
(
current_exportTXT.text = ("LOCAL BUILD: " + crytools.localBuildNumber + " LATEST BUILD: " + crytools.latestbuildnumber)
tools_version.text = version_
if crytools.rollback_status == "true" do (rollback_exporter.checked = true)
if crytools.rollback_status == "false" do (rollback_exporter.checked = false)
)
on update_btn pressed do
(
filein (crytools.BuildPathFull + "Tools\\maxscript\\AddCryTools.ms")
current_exportTXT.text = ("LOCAL BUILD: " + crytools.localBuildNumber + " LATEST BUILD: " + crytools.latestbuildnumber)
print ("Build updated from " + crytools.BuildPathFull)
--destroyDialog checkForUpdate
)
-- Get Latest From AB and Latest Build
-------------------------------------------------------------------------------
on update_btnAB pressed do
(
try
(
if crytools.BuildPathFull == "J:\\Game04\\" then
(
messagebox "You are on Game04"
return undefined
)
-- AB Stuff
if HTTPOn.checked == true then
(
rollout httpSock "httpSock" width:0 height:0
(
activeXControl port "Microsoft.XMLHTTP" setupEvents:false releaseOnClose:false
);
createDialog httpSock pos:[-100,-100];
destroyDialog httpSock;
httpSock.port.open "GET" "http://www.crytek.com/index.htm" false;
httpSock.port.setrequestheader "If-Modified-Since" "Sat, 1 Jan 1900 00:00:00 GMT";
httpSock.port.send();
print (httpSock.port.responsetext);
)
-- P4 stuff
if perfOn.checked == true then
(
p4Update = ("p4 sync " + crytools.BuildPathFull + "Tools\...")
DOScommand p4Update
)
if BuildOn.checked == true then
(
-- Latest Build Stuff
rollback_check = openFile (sysInfo.tempDir + "cry_temp\\crytools.rollback_status.ini")
if rollback_check == undefined then (crytools.rollback_status = "false")
crytools.rollback_status = "false"
latestCryExport = (crytools.md5 ("\\\\Storage\\builds\\" + crytools.latest_build + "\\Tools\\CryExport8.dlu"))
if crytools.md5 (crytools.maxDirTxt + "plugins\\CryExport8.dlu") != latestCryExport then
(
if crytools.existfile ("\\\\storage\\builds\\" + crytools.latest_build + "\\Tools\\CryExport8.dlu") == false then
(
messageBox ("There is no exporter on the build server in the latest folder [" + crytools.latest_build + "]") title: "No Exporter Found!"
)
else
(
messageBox ("There is a new exporter available in build " + crytools.latestbuildnumber) title: "New Exporter Found!"
DOScommand (("copy /Y \\\\storage\\builds\\" + crytools.latest_build + "\\Tools\\CryExport8.dlu ") + (crytools.BuildPathFull + "Tools\\"))
)
)
)
)
catch
(
messageBox "Either cannot locate the build server [\\\\Storage\\], or you do not have crytools.alienBrain correctly installed." title: "Something is wrong!"
)
messageBox ("CryTools has checked Build [" + crytools.latestbuildnumber + "] for updates.\nPlease click the \"Check/Install Updates From Your Latest Build\" button to install any updates it found.") title: ("Checked Build \\Tools (" + localTime + ") - Checked Plugins From Build #" + crytools.latestbuildnumber)
)
-- Rollback Exporter
-------------------------------------------------------------------------------
on rollback_exporter changed state do
(
try
if (rollback_exporter.checked == true) then
(
crytools.rollback_status = "true"
DOScommand ("mkdir \"" + sysInfo.tempDir + "cry_temp\\bad\\\"")
DOScommand ("move /Y " + ("\"" + crytools.maxDirTxt + "plugins\\CryExport8.dlu\"") + " " + (sysInfo.tempDir + "cry_temp\\bad\\"))
DOScommand ("move /Y " + ("\"" +sysInfo.tempDir + "cry_temp\\CryExport8.dlu\"") + " " + (crytools.maxDirTxt + "plugins\\"))
print "CryExport8.dlu has been rolled back to the previous version."
output_rollbackINI = openfile (sysInfo.tempDir + "\\cry_temp\\crytools.rollback_status.ini") mode:"w"
format crytools.rollback_status to: output_rollbackINI
close output_rollbackINI
messageBox "CryExport8.dlu has been rolled back to the previous version.\nTo get a newer exporter later you must click \"Get Latest Tools From crytools.alienBrain/Current Build\", or update your build." title: "CryExport8.dlu Rolled Back!"
)
else
(
crytools.rollback_status = "false"
output_rollbackINI = openfile (sysInfo.tempDir+ "\\cry_temp\\crytools.rollback_status.ini") mode:"w"
format crytools.rollback_status to: output_rollbackINI
close output_rollbackINI
messageBox "You are no longer in rollback mode.\nTo get a newer exporter later you must click \"Get Latest Tools From crytools.alienBrain/Current Build\", or update your build." title: "CryExport8.dlu No Longer Rolled Back!"
)
catch
(
messageBox "Rollback error 1442." title:"Error!"
return undefined
)
)
-- Uninstall
-------------------------------------------------------------------------------
on uninstall_tools pressed do
(
rollout areYouSure "CryTools Uninstallation"
(
label doyouwant "Are you sure you want to completely remove CryTools?" align:#center
button uninstallNow "Yes" pos:[110,25]
button donotuninstall "No" pos:[150,25]
on donotuninstall pressed do
(
destroyDialog areYouSure
)
on uninstallNow pressed do
(
subMenu = menuMan.findMenu "CryTools"
menuMan.unRegisterMenu subMenu
deleteFile "$UI\\MacroScripts\\CryTools-UpdateTools.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryRigging.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryMorphManager.mcr"
deleteFile "$UI\\MacroScripts\\CryTools-CryAnimation.mcr"
crytools.maxDirTxt = (getdir #maxroot)
doscommand ("attrib -r \"" + crytools.maxDirTxt + "scripts\\startup\\LoadCryTools.ms\"")
doscommand ("del \"" + crytools.maxDirTxt + "scripts\\startup\\LoadCryTools.ms\"")
print (sysInfo.username + " has uninstalled CryTools.")
destroyDialog areYouSure
destroyDialog checkForUpdate
messageBox ("CryTools has been uninstalled. CryExport8.dlu is still installed, " + "sorry " + sysInfo.username) title: "Uninstallation complete!"
)
)
createDialog areYouSure 300 60 bgcolor:black fgcolor:white
)
)
createDialog checkForUpdate 250 137 bgcolor:black fgcolor:white
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3ea367bc6f5d4f9f3331c57229ecfaa15c4ff3edddcba1618889d39f7bc00f02
size 17361
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1963f8897dae90853082dbb6961cc916eef0bf3b3dee4759d964c8010496686
size 17124
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3679794cce0eefa383c495b8eac5573e3040f2e256770c3aab78d429cb77a801
size 17249
-3
View File
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9da74c3e57d522f866e3e3f77a22b1075a5e7d5f7e7616f8514ccab5f46b7926
size 17259
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1dab772dfacb5dcc9f342e4e6d38ff1816f0a337a882174162d6312a38f117fa
size 17330
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1fa2f8345128ad353ea1163ec6fd09217cfca657b27680f5e74cbec24e62be45
size 17407
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:955089a9c5f018ca1f9ab2077c1ca9e5b8f6d6cb470b06916375adb41fe2255a
size 17293
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e05dc8a8f2aeec820daa6d68f2cb2920104e30ad4a478a4f223c383aaabc469f
size 17330
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4e477bc06b3e189ca7033fa4a1b4ee53b13069b5b0e3237a1df3b360c8f375e0
size 17332
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cf9293599559578b0e0573b727abd7489c21558854e4eca2fee6937694d7f8ad
size 17476
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5479f540088fc5b71e4e63ed106cc88a9c91a32d4bc1bc47d9445cbe7ec2a51
size 17608
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b73a7b502c67cd8d387aded0949563aa08003da1a23b769bb86e0c2588d32498
size 17346
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c7115caa10fbbdd27ca72ba6058be36a5f8d71070477dff48360f092845ef80e
size 17291
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75e0afdc6255832ea2b53bcb3d492aeece9ee883bb3407de8694552ff14ef8d0
size 17310
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3920068a05e0575dd1e5dc19950d7a7ab9627b71504248e769dd69b73d11c5a4
size 17386
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a22e94851a802c1e19a731172805339b32e7338839adf9c9ecbab88020d6d9de
size 17212
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:0e57897bcaae23de73b33e7131863e1957c1d22460389bd97fae491251372ace
size 17333
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c9ca7dc9a0021ab407982b86561964577dd4516d6008d316e8b5c78c37a8bb1
size 17323
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:97caba63c6d217237df08621378e21afc986570b726ee2ac54fdd669297c03df
size 17315
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1dda267e18bb18c95672f9826e2319a193afa37c8d022f8460430b9287fc106b
size 17338
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d689d1e960b5287a4530e328f8b943ede29fbba2d9ad8bfac4cb5fdde6e20617
size 17350
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3d005e65fd844e38be4779cbc7cb2a447a171e08d836231bc8046abd9a30be43
size 17320
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d5e33c3fb3c790e7aaced3acf63d4b528cfd04436382de5424f714aaca1390c2
size 17045
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bdd976b74e6fb0db92f0b035425ff3ff14edd4a59bedaea2ecf40ad46a564c6f
size 17323
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7361dec9be5df77ffd730a9724466343c99e6dc6e435be2b7d38a8a739fd2938
size 17345
-225
View File
@@ -1,225 +0,0 @@
<html>
<title>CrysisRig</title>
<body bgcolor="#505050" topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0>
<img border="0" src="bip.gif" name="bipedImage" usemap="#biped">
<map name="biped">
<area shape="poly"
alt="Bip01 Head"
COORDS="67,29, 73,9, 86,6, 100,11, 106,30, 99,57, 77,57"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_head.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 Head'"
>
<area shape="poly"
alt="Bip01 L ForeArm"
COORDS="129,149, 155,141, 160,189, 146,192"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_forearm.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L ForeArm'"
>
<area shape="poly"
alt="Bip01 R Forearm"
COORDS="20,142, 46,147, 30,193, 14,190"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_forearm.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R Forearm'"
>
<area shape="poly"
alt="Bip01 R UpperArm"
COORDS="29,101, 46,91, 49,137, 46,147, 21,142"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_upperarm.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R UpperArm'"
>
<area shape="poly"
alt="Bip01 L Thigh"
COORDS="90,187, 127,185, 130,272, 100,274"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_thigh.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L Thigh'"
>
<area shape="poly"
alt="Bip01 R Thigh"
COORDS="47,184, 82,186, 71,275, 43,273"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_thigh.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R Thigh'"
>
<area shape="poly"
alt="Bip01 R Knee"
COORDS="43,273, 73,275, 73,287, 44,287"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_knee.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R Knee'"
>
<area shape="poly"
alt="Bip01 L Knee"
COORDS="100,274, 130,272, 129,286, 100,286"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_knee.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L Knee'"
>
<area shape="poly"
alt="Bip01"
COORDS="85,172, 95,179, 88,189, 78,182"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01'"
>
<area shape="poly"
alt="Bip01 Pelvis"
COORDS="53,163, 119,163, 123,199, 49,199"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_pelvis.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 Pelvis'"
>
<area shape="poly"
alt="Bip01 L UpperArm"
COORDS="127,100, 143,102, 152,141, 129,148, 123,127"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_upperarm.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L UpperArm'"
>
<area shape="poly"
alt="Bip01 Spine"
COORDS="55,138, 119,138, 120,162, 53,162"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_spine.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 Spine'"
>
<area shape="poly"
alt="Bip01 Spine3"
COORDS="87,68, 95,76, 87,85, 78,76"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_spine3.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 Spine3'"
>
<area shape="poly"
alt="Bip01 Spine2"
COORDS="87,91, 95,99, 87,108, 78,99"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_spine2.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 Spine2'"
>
<area shape="poly"
alt="Bip01 Spine1"
COORDS="49,137, 125,137, 128,65, 45,65"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_spine1.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 Spine1'"
>
<area shape="poly"
alt="Bip01 R Calf"
COORDS="44,287, 73,287, 73,306, 60,369, 46,369, 36,308"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_calf.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R Calf'"
>
<area shape="poly"
alt="Bip01 L Calf"
COORDS="129,286, 136,310, 127,367, 113,367, 100,303, 100,286"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_calf.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L Calf'"
>
<area shape="poly"
alt="weapon_bone"
COORDS="35,214, 43,222, 35,231, 26,222"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'weapon_bone.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='weapon_bone'"
>
<area shape="poly"
alt="alt_weapon_bone01"
COORDS="139,214, 147,222, 139,231, 130,222"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'alt_weapon_bone01.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='alt_weapon_bone01'"
>
<area shape="poly"
alt="Bip01 L Foot"
COORDS="104,369, 132,369, 150,379, 142,394, 104,394"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_foot.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L Foot'"
>
<area shape="poly"
alt="Bip01 R Foot"
COORDS="69,369, 36,369, 18,379, 26,394, 69,394"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_foot.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R Foot'"
>
<area shape="poly"
alt="Bip01 L Foot"
COORDS="104,369, 132,369, 150,379, 142,394, 104,394"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_foot.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L Foot'"
>
<area shape="poly"
alt="Bip01 L Hand"
COORDS="146,192, 160,189, 163,217, 153,216"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_hand.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L Hand'"
>
<area shape="poly"
alt="Bip01 R Hand"
COORDS="14,190, 30,193, 19,216, 9,216"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_hand.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R Hand'"
>
<area shape="rect"
alt="Bip01 R clavicular deltoid01"
COORDS="13,12,56,25"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_r_clavicular_deltoid.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 R clavicular deltoid01'"
>
<area shape="rect"
alt="Bip01 L clavicular deltoid01"
COORDS="115,12,158,25"
href="javascript: void(0);"
onmouseover="document.bipedImage.src = 'bip01_l_clavicular_deltoid.gif'"
onmouseout="document.bipedImage.src = 'bip.gif'"
onclick="document.title='Bip01 L clavicular deltoid01'"
>
</map>
</body>
<html>
@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b421353a3b25558a926f5b700561712d8332c55a0fe2b74f67c78043377ae09
size 17318
-161
View File
@@ -1,161 +0,0 @@
fn saveOutChr =
(
if $ == undefined then
(
messagebox "Select meshes.."
return undefined
)
nodes = selection as array
max modify mode
--check that all objs have skin
for obj in nodes do
(
if obj.modifiers[#Skin] == undefined then
(
messagebox (obj.name + " has no Skin modifier")
return undefined
)
)
modPanel.setCurrentObject nodes[1].modifiers[#Skin]
root = (crytools.findroot (skinOps.GetBoneName nodes[1].modifiers[#Skin] 1 0))
--check that they all use the same skeleton
for obj in nodes do
(
if (crytools.findroot (skinOps.GetBoneName obj.modifiers[#Skin] 1 0)) != root then
(
messagebox "hierarchy mismatch!"
)
)
savePath = getSavePath initialDir:crytools.buildPathFull caption:"Please select a folder to dump character data:"
if savePath == undefined then
(
return undefined
)
savePath += "\\"
print ("Saving to " + savePath)
global savePathCHR_crytools = savePath
--save out envelopes
for obj in nodes do
(
modPanel.setCurrentObject obj.modifiers[#Skin]
skinOps.SaveEnvelope obj.modifiers[#Skin] (savePath + obj.name + ".env")
)
--save out bone list
for obj in nodes do
(
boneList = #()
for i=1 to (skinOps.getNumberBones obj.skin) do
(
append boneList (skinOps.GetBoneName obj.modifiers[#Skin] i 1)
)
crytools.writeOUT boneList (savePath + obj.name + ".bones")
)
--save out node list
nodeNames = #()
for obj in nodes do (append nodeNames obj.name)
crytools.writeOUT nodenames (savePath + "nodes.txt")
--save out OBJ files
for obj in nodes do
(
select obj
exportFile (savePath + obj.name + ".obj") #noPrompt selectedOnly:true using:Wavefront_ObjectExporterPlugin
)
)
--saveOutChr()
fn readInChr =
(
nodes = #()
if savePathCHR_crytools != undefined then
(
savePath = getSavePath initialDir:savePathCHR_crytools caption:"Please select a folder to load character data:"
)
else
(
savePath = getSavePath initialDir:savePathCHR_crytools caption:"Please select a folder to load character data:"
)
if savePath == undefined then
(
return undefined
)
savePath += "\\"
print ("Loading from " + savePath)
nodenames = crytools.readIN (savePath + "nodes.txt")
for name in nodenames do
(
file = importFile (savePath + name + ".obj") #noPrompt
$.name = name
)
for name in nodenames do (append nodes (getnodebyname name))
for obj in nodes do
(
addModifier obj (Skin ())
)
)
--readInChr()
fn addBones savePath =
(
nodes = #()
nodenames = crytools.readIN (savePath + "nodes.txt")
for name in nodenames do (append nodes (getnodebyname name))
print nodes
if crytools.maxversionnum >= 9 then
(
DialogMonitorOPS.RegisterNotification ANoon_EnvelopeCallbackFunction ID:#ANoon_Envelopes
DialogMonitorOPS.Enabled = true
)
for obj in nodes do
(
boneNames = crytools.readIN (savePath + obj.name + ".bones")
bones = #()
for name in boneNames do (append bones (getnodebyname name))
max modify mode
modPanel.setCurrentObject obj.modifiers[#Skin]
for bone in bones do
(
skinOps.addbone obj.modifiers[#Skin] bone 1
)
skinOps.LoadEnvelope obj.modifiers[#Skin] (savePath + obj.name + ".env")
skinOps.LoadEnvelope obj.modifiers[#Skin] (savePath + obj.name + ".env")
)
if crytools.maxversionnum >= 9 then
(
DialogMonitorOPS.Enabled = false
DialogMonitorOPS.UnRegisterNotification ID:#ANoon_Envelopes
)
)
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -1,81 +0,0 @@
try
(
if cryTools.cryAnim.UI.batchProcess._v.exportFiles[cryTools.cryAnim.UI.batchProcess._v.selectedFile].subRanges.count == 0 then
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[2].btnImportANM.pressed()
local listEntries = cryTools.cryAnim.UI.batchProcess._v.exportFiles[cryTools.cryAnim.UI.batchProcess._v.selectedFile]
local tempStatus = ""
local tempCheckBeforeExport = cryTools.checkbeforeexport
local tempSuppressWarnings = cryTools.suppresswarnings
cryTools.checkbeforeexport = false
cryTools.suppresswarnings = true
UtilityPanel.OpenUtility CryEngine2_Exporter
local tempRange = animationRange
if listEntries.subRanges.count == 0 then
tempStatus = "Error: No Sub-Ranges found"
else
(
for i = 1 to listEntries.subRanges.count do
(
if listEntries.subRanges[i].range.start.frame == listEntries.subRanges[i].range.end.frame then
(
tempStatus = listEntries.subRanges[i].export + " has wrong animation range"
continue
)
else
(
if listEntries.subRanges[i].range.start.frame > listEntries.subRanges[i].range.end.frame then
(
local tempTime = listEntries.subRanges[i].range.start
listEntries.subRanges[i].range.start = listEntries.subRanges[i].range.end
listEntries.subRanges[i].range.end = tempTime
cryTools.cryAnim.UI.batchProcess._f.subRangeUpdateList()
tempStatus += "Switched Start and Stop of " + listEntries.subRanges[i].export
)
)
animationRange = listEntries.subRanges[i].range
saveMaxFile (maxFilePath + listEntries.subRangePrefix + "_" + listEntries.subRanges[i].export + ".max") quiet:true
local newObjects = #()
for f = 1 to listEntries.subRanges[i].objects.count do
(
if (local tempNode = getNodeByName listEntries.subRanges[i].objects[f]) != undefined then
newObjects[f] = tempNode
else
tempStatus += "; Can't find " + listEntries.subRanges[i].objects[f]
)
if newObjects.count > 0 then
(
csexport.set_node_list newObjects
csexport.export_nodes()
)
else
tempStatus += "; No Node Found"
deleteFile (maxFilePath + maxFileName)
)
)
animationRange = tempRange
cryTools.checkbeforeexport = tempCheckBeforeExport
cryTools.suppresswarnings = tempSuppressWarnings
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = tempStatus
)
catch()
@@ -1,271 +0,0 @@
struct autoLocStruct
(
setCon,
getChildExtent,
getMaxValue,
setBodyMass,
calcLoc,
setLoc
)
autoLoc = autoLocStruct()
autoLoc.setCon = function setCon node time =
(
try
(
for i = 1 to node.controller.keys.count do
(
try
(
tempKey = biped.getKey node.controller i
if tempKey.time == time then
(
tempKey.continuity = 0
)
)
catch()
)
)
catch()
)
setCon = undefined
autoLoc.calcLoc = function calcLoc =
(
cycleLoc = true
rotateLoc = #none
posChange = false
startLoc = #none
locoCycle = false
at time animationRange.start
(
startRot = $Bip01.transform.rotation as eulerangles
startPos = $Bip01.transform.pos
startLFootPos = $'Bip01 L Toe0'.transform.pos
startRFootPos = $'Bip01 R Toe0'.transform.pos
)
at time animationRange.end
(
endRot = $Bip01.transform.rotation as eulerangles
endPos = $Bip01.transform.pos
)
at time ((animationRange.start + animationRange.end) / 2)
midRot = $Bip01.transform.rotation as eulerangles
at time 2f
(
startMidPos = $Bip01.transform.pos
startMidLFootPos = $'Bip01 L Toe0'.transform.pos
startMidRFootPos = $'Bip01 R Toe0'.transform.pos
)
at time (animationRange.end - 2)
endMidPos = $Bip01.transform.pos
diffRot = #(endRot.x, endRot.y, endRot.z)
diffRot[1] -= startRot.x
diffRot[2] -= startRot.y
diffRot[3] -= startRot.z
diffMidRot = #(midRot.x, midRot.y, midRot.z)
diffMidRot[1] -= startRot.x
diffMidRot[2] -= startRot.y
diffMidRot[3] -= startRot.z
diffPos = endPos - startPos
diffStartPos = startMidPos - startPos
diffEndPos = endPos - endMidPos
diffLFootPos = startLFootPos - startMidLFootPos
diffRFootPos = startRFootPos - startMidRFootPos
diffRotPositiv = copy diffRot #noMap
for i = 1 to 3 do
(
if diffPos[i] < 0 then diffPos[i] *= -1
if diffPos[i] > 10 then posChange = true
if diffRotPositiv[i] < 0 then diffRotPositiv[i] *= -1
if diffRotPositiv[i] > 2 then cycleLoc = false
--if diffMidRot[i] < 0 then diffMidRot[i] *= -1
if diffLFootPos[i] < 0 then diffLFootPos[i] *= -1
if diffLFootPos[i] > 10 then locoCycle = true
if diffRFootPos[i] < 0 then diffRFootPos[i] *= -1
if diffRFootPos[i] > 10 then locoCycle = true
)
if cycleLoc == false then locoCycle = false
diffStartPos = distance startPos startMidPos
diffEndPos = distance endMidPos endPos
if diffStartPos < 5 and diffStartPos > 0.4 then
(
if locoCycle == false then
startLoc = #start
)
if diffStartPos > 4 and diffEndPos < 2 then
if locoCycle == false then
if cycleLoc == false then
startLoc = #stop
if diffRot[3] < 140 and diffRot[3] > 80 then
rotateLoc = #left
if diffRot[3] < -40 and diffRot[3] > -100 then
rotateLoc = #right
if diffMidRot[3] > -220 and diffMidRot[3] < -140 then
(
if diffRot[3] < -140 and diffRot[3] > -180 then
rotateLoc = #revL
)
if diffMidRot[3] > -140 and diffMidRot[3] < -60 then
(
if diffRot[3] < -130 and diffRot[3] > -170 then
rotateLoc = #revR
)
-- print ("diffMidRot = " + diffMidRot as String)
-- print ("diffRot = " + diffRot as String)
-- print ("diffEndPos = " + diffEndPos as String)
-- print ("diffStartPos = " + diffStartPos as String)
-- print ("diffLFootPos = " + diffLFootPos as String)
-- print ("diffRFootPos = " + diffRFootPos as String)
-- print ("startLoc = " + startLoc as String)
-- print ("rotateLoc = " + rotateLoc as String)
-- print ("cycleLoc = " + cycleLoc as String)
-- print ("posChange = " + posChange as String)
-- print ("locoCycle = " + locoCycle as String)
struct locStruct ( start, rotate, cycle, position )
local tempValue = locStruct start:startLoc rotate:rotateLoc cycle:cycleLoc position:posChange
-- print tempValue
return tempValue
)
calcLoc = undefined
autoLoc.setLoc = function setLoc =
(
analyseLoc = autoLoc.calcLoc()
cryTools.cryAnim._f.resetLocator()
cryTools.cryAnim._f.moveToBodyMass()
if analyseLoc.rotate != #none then
(
at time 10f
(
biped.setTransform $Locator_Locomotion #pos $Locator_Locomotion.transform.pos true
autoLoc.setCon $Locator_Locomotion 10f
)
at time animationRange.end
cryTools.cryAnim._f.moveToBodyMass()
with animate on
(
at time 16f
(
case analyseLoc.rotate of
(
#left: rotate $Locator_Locomotion (eulerangles 0 0 89)
#right: rotate $Locator_Locomotion (eulerangles 0 0 -89)
#revL: rotate $Locator_Locomotion (eulerangles 0 0 179)
#revR: rotate $Locator_Locomotion (eulerangles 0 0 -179)
)
autoLoc.setCon $Locator_Locomotion 16f
)
at time animationRange.end
(
case analyseLoc.rotate of
(
#left: rotate $Locator_Locomotion (eulerangles 0 0 89)
#right: rotate $Locator_Locomotion (eulerangles 0 0 -89)
#revL: rotate $Locator_Locomotion (eulerangles 0 0 179)
#revR: rotate $Locator_Locomotion (eulerangles 0 0 -179)
)
)
)
)
else
(
if analyseLoc.position == true then
(
if analyseLoc.start == #start then
(
at time 10f
(
biped.setTransform $Locator_Locomotion #pos $Locator_Locomotion.transform.pos true
autoLoc.setCon $Locator_Locomotion 10f
)
at time animationRange.end
cryTools.cryAnim._f.moveToBodyMass()
)
else
(
at time animationRange.end
cryTools.cryAnim._f.moveToBodyMass()
)
)
else
(
if analyseLoc.start == #start then
at time animationRange.end
cryTools.cryAnim._f.moveToBodyMass()
)
)
sliderTime = animationRange.start + 1
sliderTime = animationRange.start
)
setLoc = undefined
try
autoLoc.setLoc()
catch
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Auto-Loc"
@@ -1,10 +0,0 @@
try
(
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state = 2
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Export").pressed()
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = tempVar
tempVar = undefined
)
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Export" )
@@ -1,10 +0,0 @@
try
(
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radSavePrompt").state
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSavePrompt").state = 2
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Save").pressed()
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSavePrompt").state = tempVar
tempVar = undefined
)
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Save" )
@@ -1,10 +0,0 @@
try
(
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = 2
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Save / Export").pressed()
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = tempVar
tempVar = undefined
)
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Save/Export" )
@@ -1,16 +0,0 @@
try
(
if selection.count > 0 then
local selArray = selection as Array
else
local selArray = Objects as Array
for obj in selArray do
(
obj.controller.position.controller = TCB_Position()
obj.controller.rotation.controller = TCB_Rotation()
obj.controller.scale.controller = TCB_Scale()
)
)
catch
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Setting TCB"
@@ -1,10 +0,0 @@
try
(
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state = 2
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Export").pressed()
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = tempVar
tempVar = undefined
)
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Export" )
@@ -1,7 +0,0 @@
with undo off
(
try
cryTools.cryAnim._f.rotateAnim 180 range:true
catch
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Rotating 180"
)
-951
View File
@@ -1,951 +0,0 @@
-------------------------------------------------------------------------------
-- batch8.ms #for 3DSMax v.8
-- Version 2.4 Internal
-- Batch Exporter for .bip and .fbx with upper body detection for upper body animations used in cryEngine
-- By: Mathias Lindner
-- eMail: devsupport@crytek.com
-------------------------------------------------------------------------------
--###############################################################################
--// creates the dialog to customize the scripts
--###############################################################################
cryTools.cryAnim.UI.batchProcess._f.createScriptDialog = function createScriptDialog dialogTitle =
(
try
(
--// rollout with edit option for the script which will be execute before exporting or at the end of check
rollout batchProcessScriptCustomize dialogTitle
(
--// script container
--edittext edScript "" pos:[2,4] height:360 width:392
edittext edScript "" pos:[2,4] height:360 fieldWidth:392
--// applies the script to the current scene
button btnPreview "Preview" pos:[6,372] width:50 height:20 toolTip:"Executes the script on the current scene"
--// applies the script to the current scene
button btnClear "Clear" pos:[77,372] width:50 height:20 toolTip:"Clears the script in the edit box"
--// imports other scripts
button btnImport "Import" pos:[150,372] width:50 height:20 toolTip:"Opens a dialog to import .ms script files"
--// saves the script and destroys dialog
button btnCache "Cache" pos:[260,372] width:50 height:20 toolTip:"Stores the custom script in the memory"
--// saves the script and destroys dialog
button btnSaveAs "Save As" pos:[205,372] width:50 height:20 toolTip:"Saves the custom script in the edit box into a specific file"
--// destroys dialog without saving
button btnCancel "Cancel" pos:[345,372] width:50 height:20 toolTip:"Aborts the custom script generation"
on batchProcessScriptCustomize open do
(
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
(
"First Script Customization": local tempVarScript = cryTools.cryAnim.UI.batchProcess._v.firstScript
"Second Script Customization": local tempVarScript = cryTools.cryAnim.UI.batchProcess._v.secondScript
)
--// if there is a defined script already
if tempVarScript != "" then
--// set text of the script container to the already defined script
edScript.text = tempVarScript
)
on btnPreview pressed do
(
try
(
--// tries executing the script
tempString = execute( edScript.text )
--print tempString
)
catch
(
--// if an error occured, print the error message
format "*** % ***\n" (getCurrentException())
)
)
on btnClear pressed do
(
edScript.text = ""
)
on btnImport pressed do
(
ret = "\r\n"
local tempVar = getOpenFileName caption:"First Script Import" filename:(getDir #scripts + "\\*.ms") types:"Script Files (*.ms)|*.ms"
if tempVar != undefined then
(
cryTools.cryAnim.UI.batchProcess.customizeScript.edScript.text += ret + ret + ret +" -- Imported from " + tempVar + ret + ret
local tempStream = openFile tempVar mode:"r"
while (eof tempStream) != true do
cryTools.cryAnim.UI.batchProcess.customizeScript.edScript.text += readLine tempStream + ret
close tempStream
)
)
on btnCache pressed do
(
local tempVar = ""
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
(
"First Script Customization": ( cryTools.cryAnim.UI.batchProcess._v.firstScript = edScript.text ; tempVar = "First" )
"Second Script Customization": ( cryTools.cryAnim.UI.batchProcess._v.secondScript = edScript.text ; tempVar = "Second" )
)
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists scriptUpdate:tempVar
--// destroys the dialog
destroyDialog cryTools.cryAnim.UI.batchProcess.customizeScript
)
on btnSaveAs pressed do
(
local tempString = ""
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
(
"First Script Customization": tempString = "First"
"Second Script Customization": tempString = "Second"
)
local tempVar = getSaveFileName caption:"First Script Import" filename:(cryTools.buildPathFull + "Tools\\maxscript\\cryAnim\\ui\\batch\\" + tempString + "Script\\*.ms") types:"Script Files (*.ms)|*.ms"
if tempVar != undefined then
(
local tempStream = openFile tempVar mode:"w"
format edScript.text to:tempStream
close tempStream
local tempFilter = filterString tempVar "\\"
local tempString = (filterString tempFilter[tempFilter.count] ".")[1]
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
(
"First Script Customization": tempVar = "First|" + tempString
"Second Script Customization": tempVar = "Second|" + tempString
)
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists scriptUpdate:tempVar
destroyDialog cryTools.cryAnim.UI.batchProcess.customizeScript
)
)
on btnCancel pressed do
(
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists scriptUpdate:"None"
--// destroys the dialog
destroyDialog cryTools.cryAnim.UI.batchProcess.customizeScript
)
)
--// creates the dialog
cryTools.cryAnim.UI.batchProcess.customizeScript = batchProcessScriptCustomize
batchProcessScriptCustomize = undefined
createDialog cryTools.cryAnim.UI.batchProcess.customizeScript 400 400
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess._f.createScriptDialog" )
)
createScriptDialog = undefined
logOutput "> Created cryTools.cryAnim.UI.batchProcess._f.createScriptDialog function"
--###############################################################################
--// creates the batchProcess dialog
--###############################################################################
cryTools.cryAnim.UI.batchProcess._f.callDialog = function callDialog =
(
try
(
--// if batchProcess is already opened, close the rollout floater
try ( closeRolloutFloater cryTools.cryAnim.UI.batchProcess.dialog ) catch()
--// create new batchProcess rollout floater
cryTools.cryAnim.UI.batchProcess.dialog = newRolloutFloater "CryAnim Batch Process v2.7" 600 422
--// rollout with file and folder list
rollout fileStatusRO "File Status" height:200
(
--// files list
activeXControl lbFiles "MSComctlLib.ListViewCtrl" pos:[140,8] height:185 width:440
--// sub folders list
activeXControl lbSubFolders "MSComctlLib.TreeCtrl" pos:[8,8] height:185 width:120
on fileStatusRO open do
(
try
(
--// initialise
lbFiles.GridLines = true
lbFiles.MousePointer = #ccArrow
lbFiles.AllowColumnReorder = true
lbFiles.view = #lvwReport
lbFiles.LabelEdit = #lvwManual
lbFiles.LabelWrap = true
lbFiles.MultiSelect = true
lbFiles.FullRowSelect = true
lbSubFolders.LineStyle = #tvwTreeLines
lbSubFolders.Style = #tvwTreelinesPlusMinusText
lbSubFolders.sorted = true
lbSubFolders.checkboxes = true
lbSubFolders.Indentation = 50
--// adds columns
lbFiles.columnHeaders.Add text:"Filename"
lbFiles.columnHeaders.Add text:"Bone"
lbFiles.columnHeaders.Add text:"Export"
lbFiles.columnHeaders.Add text:"Ext"
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.open" )
)
on lbFiles Click do
(
try
(
--// gets the cursor position of the active rollout part
screenPos = getCursorPos lbFiles
--// applies a hit test of the current mouse position
tempItem = lbFiles.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
--// if nothing is selected
if tempItem == undefined then
(
--// go through the files list and deselect every entry
for i = 1 to lbFiles.ListItems.count do
lbFiles.ListItems[i].selected = false
)
--// if an item is selected
else
(
--// if a folder is selected, deselect it
if tempItem.ListSubItems[3].text == "folder" then
tempItem.selected = false
)
--// update the files counter
cryTools.cryAnim.UI.batchProcess._f.updateCounter()
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.lbFiles.click" )
)
on lbSubFolders NodeCheck checkedNode do
(
try
(
if cryTools.cryAnim._v.various[120] != true then
(
--// if a state changes in the sub folders list, update the whole dialog
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
cryTools.cryAnim.UI.batchProcess._f.updateSubFolderSelection #set
)
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.lbSubFolders.nodeCheck" )
)
on lbFiles DblClick do
(
try
(
--// gets the cursor position of the active rollout part
screenPos = getCursorPos lbFiles
--// applies a hit test of the current mouse position
tempItem = lbFiles.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
--// if an item is selected
if tempItem != undefined then
(
--// if a folder is selected
if tempItem.ListSubItems[3].text == "folder" then
(
--// deselect the folder
tempItem.selected = false
--// go through the files list and select every on-coming entry (without folders) until another folder is reached
for i = (tempItem.index + 1) to lbFiles.ListItems.count do
(
if lbFiles.ListItems[i].ListSubItems[3].text != "folder" then
lbFiles.ListItems[i].selected = true
else
exit
)
)
--// if no folder is selected
else
(
--// go through the list and select every entry without folders
for i = 1 to lbFiles.ListItems.count do
if lbFiles.ListItems[i].ListSubItems[3].text != "folder" then
lbFiles.ListItems[i].selected = true
)
)
--// update the files counter
cryTools.cryAnim.UI.batchProcess._f.updateCounter()
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.lbFiles.dblClick" )
)
)
logOutput "> Created fileStatusRO rollout"
--// rollout with paths, file mask and pre export script
rollout inputOutputRO "Input / Output" height:50
(
--// source folder
button btnSourceFolder "Source" pos:[8,5] width:60 height:20 toolTip:"Opens a dialog to choose the source folder"
label labSourceFolder "No Folder selected" pos:[80,7] width:300
--// output folder
button btnExportFolder "Export" pos:[8,27] width:60 height:20 toolTip:"Opens a dialog to choose the export folder"
label labExportFolder "No Folder selected" pos:[80,29] width:300
--// file mask
label labFileMask "File Mask" pos:[16,52]
edittext etFileMask "" text:"" pos:[75,50] fieldWidth:300
groupbox gbScripts " Process Templates " pos:[400,5] width:180 height:62
label labFirstOp "1." pos:[408,24]
dropdownlist ddFirstOp "" pos:[425,21] width:150
label labSecondOp "2." pos:[408,46]
dropdownlist ddSecondOp "" pos:[425,42] width:150
on inputOutputRO open do
(
try
(
--// if a source path is already set
if cryTools.cryAnim.UI.batchProcess._v.sourcePath != undefined then
--// set text to the old source path
labSourceFolder.text = cryTools.cryAnim.UI.batchProcess._v.sourcePath
--// if the ini setting for the file extension is found
if (local tempText = cryTools.cryAnim.base.iniFile #get #batchProcessExt) != "" then
--// set file mask to the ini setting
etFileMask.text = tempText
--// if the ini setting for the source path is found
if (tempText = cryTools.cryAnim.base.iniFile #get #batchProcessSourcePath) != "" then
(
--// set source string to the ini setting
labSourceFolder.text = tempText
cryTools.cryAnim.UI.batchProcess._v.sourcePath = tempText
)
else
--// otherwise to the default string
labSourceFolder.text = "No Source Folder selected"
--// if the ini setting for the export path is found
if (tempText = cryTools.cryAnim.base.iniFile #get #batchProcessExportPath) != "" then
(
--// set export string to the ini setting
labexportFolder.text = tempText
cryTools.cryAnim.UI.batchProcess._v.exportPath = tempText
)
else
--// otherwise to the default string
labexportFolder.text = "No Export Folder selected"
--// updates the first and second scripts from the folders
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists()
--// fills the sub folders list
cryTools.cryAnim.UI.batchProcess._f.updateSubFolders()
cryTools.cryAnim.UI.batchProcess._f.updateSubFolderSelection #get
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.open" )
)
on btnSourceFolder pressed do
(
try
(
local tempPath = ""
--// if a source path is defined
if cryTools.cryAnim.UI.batchProcess._v.sourcePath != undefined then
--// set temporary path to the source path
tempPath = cryTools.cryAnim.UI.batchProcess._v.sourcePath
else
--// otherwise get new directory from an input dialog
tempPath = (cryTools.cryAnim.base.perforce cryTools.cryAnim.UI.main._v.bipSavePath #getDirectory)
--// temporary string gets open directory input for source path
tempString = (getSavePath caption:"Select Source Folder" initialDir:tempPath)
--// if a folder is selected by the open directory
if tempString != undefined then
(
--// source path is the new folder with "\"
cryTools.cryAnim.UI.batchProcess._v.sourcePath = tempString + (if (filterString tempString "\\").count > 1 then "\\" else "")
--// updates the export path with the converted path to the project directory
cryTools.cryAnim.UI.batchProcess._v.exportPath = (cryTools.cryAnim.base.perforce (cryTools.cryAnim.UI.main._f.checkExport #ProductionToGame cryTools.cryAnim.UI.batchProcess._v.sourcePath) #getDirectory)
--// update export folder text
labExportFolder.text = cryTools.cryAnim.UI.batchProcess._v.exportPath
--// update source folder text
labSourceFolder.text = cryTools.cryAnim.UI.batchProcess._v.sourcePath
--// set ini setting for the source path
cryTools.cryAnim.base.iniFile #set #batchProcessSourcePath value:labSourceFolder.text
cryTools.cryAnim.base.iniFile #set #batchProcessExportPath value:labExportFolder.text
if (findString labSourceFolder.text "\\") != undefined then
(
--// clears and fills sub folders
cryTools.cryAnim.UI.batchProcess._f.updateSubFolders()
(cryTools.cryAnim.UI.batchProcess.dialog.rollouts[1].lbSubFolders.Nodes.item 0).checked = true
--// clears and fills the file list
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
)
)
--// if no folder is selected
else
(
--// if no export path is set before
if cryTools.cryAnim.UI.batchProcess._v.sourcepath == undefined then
(
--// enable statistic button as it can be used without exporting
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].btnProcess.enabled = true
)
)
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.btnSourceFolder.pressed" )
)
on btnExportFolder pressed do
(
try
(
--// temporary string gets open directory input for export path
tempString = (getSavePath caption:"Select Export Folder" initialDir:cryTools.cryAnim.UI.batchProcess._v.exportPath)
--// if a folder is selected by the open directory
if tempString != undefined then
(
--// set export path to the new folder path
cryTools.cryAnim.UI.batchProcess._v.exportPath = tempString + "\\"
--// update exportFolder text
labExportFolder.text = tempString + "\\"
--// set ini setting for the export path
cryTools.cryAnim.base.iniFile #set #batchProcessExportPath value:labExportFolder.text
)
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.btnExportFolder.pressed" )
)
on ddFirstOp selected value do
(
try
(
if ddFirstOp.selection == ddFirstOp.items.count then
cryTools.cryAnim.UI.batchProcess._f.createScriptDialog "First Script Customization"
else
cryTools.cryAnim._v.various[33] = ddFirstOp.items[ddFirstOp.selection]
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.ddFirstOp.selected" )
)
on ddSecondOp selected value do
(
try
(
if ddSecondOp.selection == ddSecondOp.items.count then
cryTools.cryAnim.UI.batchProcess._f.createScriptDialog "Second Script Customization"
else
cryTools.cryAnim._v.various[34] = ddSecondOp.items[ddSecondOp.selection]
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.ddSecondOp.selected" )
)
on etFileMask entered value do
(
try
(
--// set ini setting with changed file mask
cryTools.cryAnim.base.iniFile #set #batchProcessExt value:etFileMask.text
--// update whole dialog with new changes
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.etFileMask.entered" )
)
)
logOutput "> Created inputOutputRO rollout"
--// rollout with all config options and check or export button
rollout checkExportRO "Check / Export" height:60
(
--// files / folders groub
label labFilesFolders "Files / Folders :" pos:[10,11]
groupBox gbFilesFolders "" pos:[100,-1] height:32 width:230
--// keep the sub folder structure when exporting
label labKeepSubFolders "Keep Sub Folders" pos:[210,11]
checkBox chkKeepSubFolders "" pos:[300,11] checked:true
--// counter for selected and maximumm files
label labCount "Count :" pos:[130,11]
--// bone detection for exporting specific body parts for specific file string parts
label labBoneDetection "Bone Detection :" pos:[10,42]
groupBox gbBoneDetection "" pos:[100,30] height:32 width:230
--// config bone detection, manage sets of bone detections
button btnConfig "Config" pos:[110,41] height:17 width:70 toolTip:"Opens a dialog to configure filename/bone detection"
--// activate automatic file detection
label labDetect "Detect" pos:[195,43]
checkBox chkDetect "" pos:[235,42] checked:true
--// only files which are detected will be shown
label labOnlyBoneDetection " + " pos:[255,43]
checkBox chkOnlyBoneDetection "" pos:[270,42]
--// only files which are not detected will be shown
label labNoBoneDetection " - " pos:[290,43]
checkBox chkNoBoneDetection "" pos:[300,42]
--// executes the whole export process with pre export script, but without real exporting
button btnProcess "P R O C E S S" pos:[345,8] height:50 width:230 enabled:false toolTip:"Processes the files/selection in the list (executes scripts)"
on checkExportRO open do
(
try
(
--// clears the file list
cryTools.cryAnim.UI.batchProcess._v.exportFiles = #()
try
(
local tempSubFilter = cryTools.cryAnim.base.iniFile #get #batchProcessSubFolderSelection
tempSubFilter = filterString tempSubFilter "#"
if tempSubFilter.count == 0 then
(cryTools.cryAnim.UI.batchProcess.dialog.rollouts[1].lbSubFolders.Nodes.item 0).checked = true
) catch()
try cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkKeepSubFolders.checked = cryTools.cryAnim.base.iniFile #get #batchProcessSubFolders catch()
--// if a source path is internal defined
if cryTools.cryAnim.UI.batchProcess._v.sourcePath != undefined then
(
--// enable check and export button
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].btnProcess.enabled = true
)
--// get bone detection set up
local tempBoneArray = cryTools.cryAnim.base.iniFile #get #bones
--// if a bone setup is found
if tempBoneArray != undefined then
(
tempListArray = #()
--// goes through the bone list
for i = 1 to tempBoneArray.count do
--// if an entry is found
if tempBoneArray[i].name != "" then
--// add the entry to the list
append tempListArray tempBoneArray[i]
--// set new bone list
cryTools.cryAnim.UI.batchProcess._v.boneList = tempBoneArray
)
--// update whole dialog
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.open" )
)
on chkKeepSubFolders changed value do
(
try
cryTools.cryAnim.base.iniFile #set #batchProcessSubFolders value:value
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.chkKeepSubFolder.changed" )
)
on btnProcess pressed do
(
try
--// process all used files without export
cryTools.cryAnim.UI.batchProcess._f.processFiles #statistic
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.btnProcess.pressed" )
)
on chkOnlyBoneDetection changed value do
(
try
(
--// if only bone detection is activated
if cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkOnlyBoneDetection.checked == true then
--// no bone detection is deactivated
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkNoBoneDetection.checked = false
--// updates whole dialog
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
cryTools.cryAnim.UI.batchProcess._v.flags[1] = false
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.chkOnlyBoneDetection.changed" )
)
on chkNoBoneDetection changed value do
(
try
(
--// if no bone detection is activated
if cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkNoBoneDetection.checked == true then
--// only bone detections is deactivated
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkOnlyBoneDetection.checked = false
--// updates whole dialog
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
cryTools.cryAnim.UI.batchProcess._v.flags[1] = false
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.chkNoBoneDetection.changed" )
)
on btnConfig pressed do
(
try
(
--// rollout to edit the bone list entry
rollout entryDetailsRO "Entry Details"
(
label labName "Name :" pos:[8,10]
label labExternal "External :" pos:[8,30]
label labBones "Bones :" pos:[8,50]
--// sets the name, file detection and bones column
edittext edName "" text:(cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem.SubItems.item 0).text pos:[70,10] fieldWidth:300
edittext edExternal "" text:(cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem.SubItems.item 1).text pos:[70,30] fieldWidth:300
edittext edBones "" text:(cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem.SubItems.item 2).text pos:[70,50] fieldWidth:245
--// button to pick specific bones in the scene
button btnPickBones "Pick" pos:[323,50] height:17 width:50 toolTip:"Opens dialog to select the bone associated to the filename detection"
--// save the entry or cancel
button btnSave "Save" pos:[100,80] height:20 width:80 toolTip:"Saves filename/bone detection"
button btnCancel "Cancel" pos:[200,80] height:20 width:80 toolTip:"Aborts filename/bone detection"
on btnSave pressed do
(
--// get currently selected item
local tempItem = cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem
--// set new name
(tempItem.SubItems.item 0).text = edName.text
--// set new file detection
(tempItem.SubItems.item 1).text = edExternal.text
--// set new bone list
(tempItem.SubItems.item 2).text = edBones.text
local tempListArray = #()
cryTools.cryAnim.UI.batchProcess._f.updateExtent()
--// kills bone edit dialog
destroyDialog cryTools.cryAnim.UI.batchProcess.entryDetails
)
on btnCancel pressed do
(
--// kills bone edit dialog
destroyDialog cryTools.cryAnim.UI.batchProcess.entryDetails
)
on btnPickBones pressed do
(
local tempString = ""
--// pick node from the scene
objArray = selectByName title:("Select Nodes") showHidden:true
--// if a node is selected
if objArray != undefined then
(
--// goes through the nodes
for i = 1 to objArray.count do
--// adds the name of the node with a ";" as seperator
tempString += objArray[i].name + (if i != objArray.count then ";" else "")
--// set the new bone list
edBones.text = tempString
)
)
)
cryTools.cryAnim.UI.batchProcess.entryDetails = entryDetailsRO
entryDetailsRO = undefined
--// rollout to edit the bone detection list
rollout editBoneListRO "Edit Bone List"
(
--// list of all bone setups
activeXControl lbList "MSComctlLib.ListViewCtrl" pos:[1,1] height:185 width:440
--// save current setup
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Saves selected filename/bone detection entry"
button btnDelete "Delete" pos:[150,195] height:20 width:60 toolTip:"Deletes selected entry"
button btnDeleteAll "Delete All" pos:[220,195] height:20 width:60 toolTip:"Clears whole list"
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Abort filename/bone detection"
on editBoneListRO open do
(
lbList.GridLines = true
lbList.MousePointer = #ccArrow
lbList.AllowColumnReorder = true
lbList.view = #lvwReport
lbList.LabelEdit = #lvwManual
lbList.Sorted = true
lbList.FullRowSelect = true
lbList.Checkboxes = true
--// adds columns
lbList.columnHeaders.Add text:"Name"
lbList.columnHeaders.Add text:"External"
lbList.columnHeaders.Add text:"Bones"
--// goes through the bone list
for i = 1 to cryTools.cryAnim.UI.batchProcess._v.boneList.count do
(
--// adds a new entry
local lbListEntry = lbList.listItems.Add text:cryTools.cryAnim.UI.batchProcess._v.boneList[i].name
--// if entry is active
if cryTools.cryAnim.UI.batchProcess._v.boneList[i].active == "true" then
--// set list entry active
lbListEntry.checked = true
--// if entry is not active
if cryTools.cryAnim.UI.batchProcess._v.boneList[i].active == "false" then
--// set list entry not active
lbListEntry.checked = false
--// add external entry
lbListEntry.listSubItems.Add text:cryTools.cryAnim.UI.batchProcess._v.boneList[i].external
--// add bone entry
lbListEntry.listSubItems.Add text:cryTools.cryAnim.UI.batchProcess._v.boneList[i].bones
)
)
on lbList DblClick do
(
--// gets the bone list position
screenPos = getCursorPos lbList
--// hit test the cursor position
tempItem = lbList.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
--// if an item is selected
if tempItem != undefined then
(
--// creates bone entry edit
createDialog cryTools.cryAnim.UI.batchProcess.entryDetails 385 110
)
--// if no item is selected
else
(
--// empty boneStruct
tempStringArray = (boneStruct name:"" external:"" bones:"")
tempArray = #()
--// get nodes to be added
objArray = selectByName title:("Select Nodes to be added") showHidden:true
--// if a node is selected
if objArray != undefined then
(
--// goes through node list
for obj in objArray do
--// add the nodes via boneStruct to a seperate list
append tempArray (boneStruct name:obj.name external:obj.name bones:obj.name)
--// goes through the node list
for i = 1 to tempArray.count do
(
--// adds name(s) of the node(s)
tempStringArray.name += tempArray[i].name + (if i != tempArray.count then ";" else "")
--// adds file detection(s)
tempStringArray.external += tempArray[i].external + (if i != tempArray.count then ";" else "")
--// adds bone(s) list
tempStringArray.bones += tempArray[i].bones + (if i != tempArray.count then ";" else "")
)
--// adds entry to the bone list
local lbListEntry = lbList.ListItems.Add text:tempStringArray.name
lbListEntry.checked = true
lbListEntry.ListSubItems.Add text:tempStringArray.external
lbListEntry.ListSubItems.Add text:tempStringArray.bones
)
)
)
on btnSave pressed do
(
local tempArray = #()
local tempList = #()
--// goes through the bone list
for i = 1 to lbList.ListItems.count do
(
local tempItemArray = #()
local tempItem = lbList.ListItems[i]
--// save checked state
tempItemArray[1] = tempItem.checked as String
--// if nothing is typed in, the entry will have " " to filter correctly
if tempItem.text != "" then tempItemArray[2] = tempItem.text else tempItemArray[2] = " "
if tempItem.ListSubItems[1].text != "" then tempItemArray[3] = tempItem.ListSubItems[1].text else tempItemArray[3] = " "
if tempItem.ListSubItems[2].text != "" then tempItemArray[4] = tempItem.ListSubItems[2].text else tempItemArray[4] = " "
--// adds the entries to a seperate list
append tempArray (boneStruct active:tempItemArray[1] name:tempItemArray[2] external:tempItemArray[3] bones:tempItemArray[4])
)
--// sets ini setting
cryTools.cryAnim.base.iniFile #set #bones value:tempArray
--// sets new bone list
cryTools.cryAnim.UI.batchProcess._v.boneList = tempArray
--// updates whole dialog
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
--// kills bone list edit dialog
destroyDialog cryTools.cryAnim.UI.batchProcess.editBoneList
)
on btnDelete pressed do
(
--// goes through the bone list
for i = 1 to lbList.ListItems.count do
(
--// tries to delete the selected entry
try
(
if lbList.ListItems[i].selected == true then
lbList.ListItems.Remove i
)
catch()
)
)
on btnDeleteAll pressed do
(
--// clears whole list
lbList.ListItems.clear()
)
on btnCancel pressed do
(
--// kills bone list edit dialog
destroyDialog cryTools.cryAnim.UI.batchProcess.editBoneList
)
)
cryTools.cryAnim.UI.batchProcess.editBoneList = editBoneListRO
editBoneListRO = undefined
--// creates bone list edit dialog
createDialog cryTools.cryAnim.UI.batchProcess.editBoneList 443 220
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.btnConfig.pressed" )
)
)
logOutput "> Created checkExportRO rollout"
--// adds all rollouts to the UI
addRollout fileStatusRO cryTools.cryAnim.UI.batchProcess.dialog
addRollout inputOutputRO cryTools.cryAnim.UI.batchProcess.dialog
addRollout checkExportRO cryTools.cryAnim.UI.batchProcess.dialog
fileStatusRO = undefined
inputOutputRO = undefined
checkExportRO = undefined
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess._f.callDialog" )
)
callDialog = undefined
logOutput "> Created cryTools.cryAnim.UI.batchProcess._f.callDialog function"
logOutput ">> batch8.ms loaded"
File diff suppressed because it is too large Load Diff
-230
View File
@@ -1,230 +0,0 @@
--###############################################################################
--// rollout with elements to control the locator
--###############################################################################
rollout locatorRO "Locator"
(
button btnCreate "Create" pos:[8,8] width:70 height:20 toolTip:"Creates Locator_Locomotion biped prop"
button btnDelete "Delete" pos:[80,8] width:70 height:20 toolTip:"Deletes Locator_Locomotion"
button btnAutoLoc "Auto-Locator" pos:[8,35] width:142 height:20 toolTip:"Animates the Locator_Locomotion contextual of the animation"
button btnResetLocator "Reset Locator" pos:[8,55] width:142 height:20 toolTip:"Resets Locator_Locomotion to the origin facing in the direction the character faces"
button btnSetToBodyMass "Move to Body Mass" pos:[8,75] width:142 height:20 toolTip:"Moves the Locator_Locomotion to the calculated body mass of Bip01"
on locatorRO open do
(
try
(
if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then
(cryTools.cryAnim.UI.main._f.getUI "Locator" "").open = cryTools.cryAnim.base.iniFile #get #locatorRO
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.open" )
)
on locatorRO rolledUp value do
(
try
(
if (cryTools.cryAnim.base.iniFile #get #locatorRO) != value then
cryTools.cryAnim.base.iniFile #set #locatorRO
local lolStream = createFile "C:\\Yeah.txt"
cryTools.cryAnim.UI.main._f.updateDialog()
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.rolledUp" )
)
on btnCreate pressed do
(
try
(
if $Bip01 != undefined then
(
if queryBox "Create Locator_Locomotion?" title:"Locator_Locomotion" == true then
(
undo "create Locator_Locomotion" on
(
try
(
local locVertArray = #([-2.60474,5.627,0], [-2.60474,5.627,5.306], [-2.60501,-5.627,5.306], [-2.60501,-5.627,2.40557e-006], [2.60475,5.627,0], [2.60475,5.627,5.306], [2.60499,-5.627,5.306], [2.605,-5.627,1.88326e-007], [-5.71044,-5.62699,5.306], [-5.71044,-5.62699,3.72612e-006], [5.71043,-5.62701,-1.24204e-006], [5.71043,-5.62701,5.306], [-9.4768e-006,-11.63,-1.24204e-006], [-9.48043e-006,-11.63,5.306])
$Bip01.controller.figureMode = true
$Bip01.controller.prop1Exists = false
tempSaveRot = $Bip01.transform.rotation
tempBipRot = $Bip01.transform.rotation as eulerangles
if tempBipRot.z > 0 and tempBipRot.z < 180 then
tempBipRot.z = -90
biped.setTransform $Bip01 #rotation tempBipRot false
$Bip01.controller.prop1Exists = true
tempSel = biped.getNode $Bip01 20
tempSel.name = "Locator_Locomotion"
select tempSel
cryTools.cryAnim._f.resetLocator forceDir:true
tempPanel = getCommandPanelTaskMode()
setCommandPanelTaskMode #modify
addModifier tempSel (Edit_Poly())
tempBit = #{1..(polyOp.getNumVerts tempSel)}
tempSel.modifiers[1].setSelection 1 tempBit
tempSel.modifiers[1].setOperation #DeleteVertex
tempSel.modifiers[1].commit()
for i = 1 to locVertArray.count do
(
tempSel.modifiers[1].CreateVertex [0,0,0]
)
tempSel.modifiers[1].commit()
tempSel.modifiers[1].SetEPolySelLevel #Vertex
for i = 1 to locVertArray.count do
(
tempSel.modifiers[1].SetSelection #Vertex #{}
tempSel.modifiers[1].Select #Vertex #{i}
tempSel.modifiers[1].Commit()
tempSel.modifiers[1].moveSelection locVertArray[i]
tempSel.modifiers[1].Commit()
)
tempSel.modifiers[1].CreateFace #(6,5,1)
tempSel.modifiers[1].CreateFace #(6,1,2)
tempSel.modifiers[1].CreateFace #(7,6,2)
tempSel.modifiers[1].CreateFace #(2,3,7)
tempSel.modifiers[1].CreateFace #(8,5,6)
tempSel.modifiers[1].CreateFace #(6,7,8)
tempSel.modifiers[1].CreateFace #(1,4,3)
tempSel.modifiers[1].CreateFace #(3,2,1)
tempSel.modifiers[1].CreateFace #(1, 4,5)
tempSel.modifiers[1].CreateFace #(4,5, 8)
tempSel.modifiers[1].CreateFace #(11,8,7)
tempSel.modifiers[1].CreateFace #(7,12,11)
tempSel.modifiers[1].CreateFace #(3,4, 10)
tempSel.modifiers[1].CreateFace #(3, 9,10)
tempSel.modifiers[1].CreateFace #(9,14,12)
tempSel.modifiers[1].CreateFace #(11,12,14)
tempSel.modifiers[1].CreateFace #(14,13,11)
tempSel.modifiers[1].CreateFace #(10,13,14)
tempSel.modifiers[1].CreateFace #(10,14,9)
tempSel.modifiers[1].CreateFace #(10,13,11)
tempSel.modifiers[1].SetSelection #Vertex #{}
tempSel.modifiers[1].SetEPolySelLevel #Object
tempSel.wireColor = (color 255 0 0)
tempSel.modifiers[1].Commit()
biped.setTransform $Bip01 #rotation tempSaveRot true
$Bip01.controller.figureMode = false
setCommandPanelTaskMode tempPanel
cryTools.cryAnim._f.resetLocator()
redrawviews()
)catch (print "Error Creating Locator_Locomotion")
)
)
)
else
messageBox "No Biped in Scene." title:"Error Creating Locator_Locomotion"
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnCreate.pressed" )
)
on btnDelete pressed do
(
try
(
if $Bip01 != undefined then
(
if queryBox "Delete Locator_Locomotion?" title:"Locator_Locomotion" == true then
(
undo "delete Locator_Locomotion" on
(
try
(
$Bip01.controller.figureMode = true
$Bip01.controller.prop1Exists = false
$Bip01.controller.figureMode = false
) catch ( print "Error Deleting Locatot_Locomtion" )
)
)
)
else
messageBox "No Biped in Scene." title:"Error Deleting Locator_Locomotion"
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnDelete.pressed" )
)
on btnResetLocator pressed do
(
try
(
if $Locator_Locomotion != undefined then
undo "Reset Locator" on
cryTools.cryAnim._f.resetLocator()
else print "No Locator in Scene."
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnResetLocator.pressed" )
)
on btnAutoLoc pressed do
(
try
(
if $Locator_Locomotion != undefined then
undo "Auto Locator" on
try ( fileIn (cryTools.buildPathFull + "Tools\\maxscript\\cryAnim\\ui\\batch\\Scripts\\AutoLoc.ms") ) catch()
else print "No Locator in Scene."
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnAutoLoc.pressed" )
)
on btnSetToBodyMass pressed do
(
try
(
if $Locator_Locomotion != undefined then
undo "Move to BodyMass" on
try ( cryTools.cryAnim._f.moveToBodyMass() ) catch( print "Can't execute: Move to Body Mass")
else print "No Locator in Scene."
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnSetToBodyMass.pressed" )
)
)
logOutput "> Created locatorRO rollout"
try
(
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
addSubRollout cryTools.cryAnim.UI.main.dialog.row2 locatorRO
else
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 locatorRO
)
catch ( logOutput "!!> Error adding locatorRO to main dialog" )
locatorRO = undefined
logOutput ">> locator.ms loaded"
@@ -1,651 +0,0 @@
--###############################################################################
--// rollout with elements to control models and items
--###############################################################################
rollout modelsRO "Models"
(
button btnLoadModel "Load Model" pos:[8,8] width:142 height:20 toolTip:"Loads often used models and shows dialog to edit them"
groupBox gbItems " Items " pos:[2,35] width:153 height:50
dropDownList ddItemSelect "" pos:[8,55] width:142 height:21
on modelsRO open do
(
try
(
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Models" "").open = cryTools.cryAnim.base.iniFile #get #modelsRO) catch()
cryTools.cryAnim.UI.main.models._v.itemList = cryTools.cryAnim.UI.main.models._f.selectItem "" #getList
local tempListArray = cryTools.cryAnim.UI.main.models._v.itemList
local tempListArray2 = #()
for i = 1 to tempListArray.count do
tempListArray2[i] = tempListArray[i].name
join tempListArray2 #("-------------------------------------------", "Edit Entries")
ddItemSelect.items = tempListArray2
if (local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex) != 0 then
ddItemSelect.selection = tempVar
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.open" )
)
on modelsRO rolledUp value do
(
try
(
if (cryTools.cryAnim.base.iniFile #get #modelsRO) != value then
cryTools.cryAnim.base.iniFile #set #modelsRO
cryTools.cryAnim.UI.main._f.updateDialog()
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.rolledUp" )
)
on ddItemSelect selected value do
(
try
(
if value < (ddItemSelect.items.count - 1) then
(
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem value #set
if tempVar == false then
ddItemSelect.selection = 1
)
else
ddItemSelect.selection = ddItemSelect.items.count
if ddItemSelect.selection == ddItemSelect.items.count then
(
try ( destroyDialog cryTools.cryAnim.UI.main.models.editItemList ) catch()
rollout editItemListRO "Edit Item List"
(
activeXControl lbItems "MSComctlLib.ListViewCtrl" pos:[1,1] height:185 width:440
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save item list"
button btnAdd "Add" pos:[120,195] height:20 width:60 toolTip:"Adds new entry"
button btnDelete "Delete" pos:[190,195] height:20 width:60 toolTip:"Deletes selected entry"
button btnDeleteAll "Delete All" pos:[260,195] height:20 width:60 toolTip:"Clears whole list"
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit item list"
on editItemListRO open do
(
lbItems.GridLines = true
lbItems.MousePointer = #ccArrow
lbItems.AllowColumnReorder = true
lbItems.view = #lvwReport
lbItems.LabelEdit = #lvwManual
lbItems.Sorted = true
lbItems.FullRowSelect = true
lbItems.columnHeaders.Add text:"ID"
lbItems.columnHeaders.Add text:"Name"
lbItems.columnHeaders.Add text:"External"
lbItems.columnHeaders.Add text:"Model"
lbItems.columnHeaders.Add text:"Reference"
lbItems.columnHeaders.Add text:"Parent"
lbItems.columnHeaders.Add text:"Rotation"
lbItems.columnHeaders.Add text:"Position"
lbItems.columnHeaders[1].width = 600
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
(
local lbItemsEntry = lbItems.listItems.Add text:(i as String)
lbItemsEntry.listSubItems.Add text:cryTools.cryAnim.UI.main.models._v.itemList[i].name
lbItemsEntry.listSubItems.Add text:cryTools.cryAnim.UI.main.models._v.itemList[i].external
local maxCount = cryTools.cryAnim.UI.main.models._v.itemList[i].model.count
tempStringArray = #("","","","","")
for f = 1 to maxCount do
(
tempStringArray[1] += cryTools.cryAnim.UI.main.models._v.itemList[i].model[f] + (if f < maxCount then ";" else "")
tempStringArray[2] += cryTools.cryAnim.UI.main.models._v.itemList[i].reference[f] + (if f < maxCount then ";" else "")
tempStringArray[3] += cryTools.cryAnim.UI.main.models._v.itemList[i].parent[f] + (if f < maxCount then ";" else "")
tempStringArray[4] += cryTools.cryAnim.UI.main.models._v.itemList[i].rotation[f] as String + (if f < maxCount then ";" else "")
tempStringArray[5] += cryTools.cryAnim.UI.main.models._v.itemList[i].position[f] as String + (if f < maxCount then ";" else "")
)
lbItemsEntry.listSubItems.Add text:tempStringArray[1]
lbItemsEntry.listSubItems.Add text:tempStringArray[2]
lbItemsEntry.listSubItems.Add text:tempStringArray[3]
lbItemsEntry.listSubItems.Add text:tempStringArray[4]
lbItemsEntry.listSubItems.Add text:tempStringArray[5]
)
cryTools.cryAnim.UI.main.models._f.sortList()
)
on lbItems DblClick do
(
screenPos = getCursorPos lbItems
tempItem = lbItems.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
if tempItem != undefined then
(
try ( destroyDialog cryTools.cryAnim.UI.main.models.editDetails ) catch()
rollout entryDetailsRO "Entry Details"
(
label labID "ID :" pos:[8,10]
label labName "Name :" pos:[8,30]
label labExternal "External :" pos:[8,50]
label labModel "Model :" pos:[8,70]
label labReference "Reference :" pos:[8,90]
label labParent "Parent :" pos:[8,110]
label labRotation "Rotation :" pos:[8,130]
label labPosition "Position :" pos:[8,150]
edittext edID "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.index as String) pos:[70,10] fieldWidth:300
edittext edName "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[1].text pos:[70,30] fieldWidth:300
edittext edExternal "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[2].text pos:[70,50] fieldWidth:300
edittext edModel "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[3].text pos:[70,70] fieldWidth:300
edittext edReference "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[4].text pos:[70,90] fieldWidth:300
edittext edParent "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[5].text pos:[70,110] fieldWidth:300
edittext edRotation "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[6].text pos:[70,130] fieldWidth:300
edittext edPosition "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[7].text pos:[70,150] fieldWidth:300
button btnSave "Save" pos:[40,180] height:20 width:80 toolTip:"Save item to item list"
button btnSetOffset "Set Offset" pos:[150,180] height:20 width:80 toolTip:"Generates new offset of the selected item"
button btnCancel "Cancel" pos:[260,180] height:20 width:80 toolTip:"Aborts edit dialog for the selected item"
on btnSave pressed do
(
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem
tempItem.text = edID.text
tempItem.ListSubItems[1].text = edName.text
tempItem.ListSubItems[2].text = edExternal.text
tempItem.ListSubItems[3].text = edModel.text
tempItem.ListSubItems[4].text = edReference.text
tempItem.ListSubItems[5].text = edParent.text
tempItem.ListSubItems[6].text = edRotation.text
tempItem.ListSubItems[7].text = edPosition.text
cryTools.cryAnim.UI.main.models._f.sortList()
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
)
on btnSetOffset pressed do
(
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem
if tempItem != undefined then
(
local refArray = filterString tempItem.ListSubItems[4].text ";"
local parentArray = filterString tempItem.ListSubItems[5].text ";"
local rotString = ""
local posString = ""
for i = 1 to refArray.count do
(
local tempObj = (cryTools.cryAnim._f.createSnapshot object:(getNodeByName refArray[i]))[1]
local tempParent = getNodeByName parentArray[i]
if (tempObj != undefined) and (tempParent != undefined) then
(
if tempParent.classID[1] != 37157 then
(
rotString += (in coordsys tempObj tempParent.rotation) as String + (if i < refArray.count then ";" else "")
posString += (in coordsys tempObj tempParent.pos) as String + (if i < refArray.count then ";" else "")
)
)
try (delete tempObj)catch()
)
edRotation.text = rotString
edPosition.text = posString
)
else
(
messageBox "No Item selected." title:"Reset Offset"
)
index = undefined
)
on btnCancel pressed do
(
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
)
)
cryTools.cryAnim.UI.main.models.entryDetails = entryDetailsRO
entryDetailsRO = undefined
createDialog cryTools.cryAnim.UI.main.models.entryDetails 385 210
)
)
on btnAdd pressed do
(
local tempStringArray = (itemStruct name:"" external:"" model:"" reference:"" parent:"" rotation:"" position:"")
local tempArray = #()
local objArray = selectByName title:("Select Nodes to be added") showHidden:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterNode
if objArray != undefined then
(
local objLink = #()
for obj in objArray do
(
global tempObj = obj
objLink = selectByName title:("Select " + obj.name + " Reference") showHidden:true single:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterParent
if objLink != undefined then
(
objRotation = (in coordsys objLink obj.rotation) as String
objPosition = (in coordsys objLink obj.position) as String
objLink = objLink.name
)
else
(
objLink = ""
objRotation = ""
objPosition = ""
)
if obj.parent != undefined then
objParent = obj.parent.name
else
objParent = ""
append tempArray (itemStruct name:obj.name model:obj.name external:obj.name parent:objParent reference:objLink rotation:objRotation position:objPosition )
)
tempObj = undefined
)
if tempArray.count > 0 then
(
tempStringArray.name = tempArray[1].name
tempStringArray.external = tempArray[1].external
for i = 1 to tempArray.count do
(
tempStringArray.model += tempArray[i].model + (if i != tempArray.count then ";" else "")
tempStringArray.reference += tempArray[i].reference as String + (if i != tempArray.count then ";" else "")
tempStringArray.parent += tempArray[i].parent as String + (if i != tempArray.count then ";" else "")
tempStringArray.rotation += tempArray[i].rotation as String + (if i != tempArray.count then ";" else "")
tempStringArray.position += tempArray[i].position as String + (if i != tempArray.count then ";" else "")
)
local lbItemsEntry = lbItems.ListItems.Add text:((lbItems.ListItems.count + 1) as String)
lbItemsEntry.ListSubItems.Add text:tempStringArray.name
lbItemsEntry.ListSubItems.Add text:tempStringArray.external
lbItemsEntry.ListSubItems.Add text:tempStringArray.model
lbItemsEntry.ListSubItems.Add text:tempStringArray.reference
lbItemsEntry.ListSubItems.Add text:tempStringArray.parent
lbItemsEntry.ListSubItems.Add text:tempStringArray.rotation
lbItemsEntry.ListSubItems.Add text:tempStringArray.position
cryTools.cryAnim.UI.main.models._f.sortList()
)
)
on btnSave pressed do
(
local tempArray = #()
local tempList = #()
for i = 1 to lbItems.ListItems.count do
(
local tempItemArray = #()
local tempItem = lbItems.ListItems[i]
for d = 1 to tempItem.ListSubItems.count do
(
if tempItem.ListSubItems[d].text != "" then tempItemArray[d] = tempItem.ListSubItems[d].text else tempItemArray[d] = " "
)
append tempArray (itemStruct name:tempItemArray[1] external:tempItemArray[2] model:(filterString tempItemArray[3] ";") reference:(filterString tempItemArray[4] ";") parent:(filterString tempItemArray[5] ";") rotation:(filterString tempItemArray[6] ";") position:(filterString tempItemArray[7] ";"))
for f = 1 to tempArray[tempArray.count].model.count do
(
tempArray[tempArray.count].rotation[f] = execute (tempArray[tempArray.count].rotation[f])
tempArray[tempArray.count].position[f] = execute (tempArray[tempArray.count].position[f])
)
)
cryTools.cryAnim.base.iniFile #set #items value:tempArray
cryTools.cryAnim.UI.main.models._v.itemList = tempArray
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
append tempList cryTools.cryAnim.UI.main.models._v.itemList[i].name
join tempList #("-------------------------------------------", "Edit Entries")
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").items = tempList
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
)
on btnDelete pressed do
(
deleteIndex = 0
for i = 1 to lbItems.ListItems.count do
(
try
(
if lbItems.ListItems[i].selected == true then
lbItems.ListItems.Remove i
)
catch()
)
cryTools.cryAnim.UI.main.models._f.sortList()
)
on btnDeleteAll pressed do
(
lbItems.ListItems.clear()
)
on btnCancel pressed do
(
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
)
on editItemListRO close do
(
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex
if tempVar != 0 then
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").selection = tempVar
)
)
cryTools.cryAnim.UI.main.models.editItemList = editItemListRO
editItemListRO = undefined
createDialog cryTools.cryAnim.UI.main.models.editItemList 443 220
)
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.ddItemSelect.selected" )
)
on btnLoadModel pressed do
(
try
(
rcmenu loadModelRC
(
menUItem mi1 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 1))
menUItem mi2 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 2))
menUItem mi3 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 3))
menUItem mi4 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 4))
menUItem mi5 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 5))
menUItem mi6 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 6))
menUItem mi7 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 7))
menUItem mi8 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 8))
menUItem mi9 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 9))
menUItem mi10 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 10))
menUItem mi11 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 11))
menUItem mi12 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 12))
menUItem mi13 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 13))
menUItem mi14 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 14))
menUItem mi15 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 15))
menUItem mi16 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 16))
menUItem mi17 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 17))
menUItem mi18 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 18))
menUItem mi19 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 19))
menUItem mi20 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 20))
seperator miSep checked:false
menUItem miEdit "Edit Entries" checked:false
on loadModelRC open do
(
local tempPathArray = #()
local tempArray = cryTools.cryAnim.base.iniFile #get #models
if tempArray != "" and tempArray != undefined then
(
mi1.text = cryTools.cryAnim.UI.main.models._f.getEntries 1 tempArray
mi2.text = cryTools.cryAnim.UI.main.models._f.getEntries 2 tempArray
mi3.text = cryTools.cryAnim.UI.main.models._f.getEntries 3 tempArray
mi4.text = cryTools.cryAnim.UI.main.models._f.getEntries 4 tempArray
mi5.text = cryTools.cryAnim.UI.main.models._f.getEntries 5 tempArray
mi6.text = cryTools.cryAnim.UI.main.models._f.getEntries 6 tempArray
mi7.text = cryTools.cryAnim.UI.main.models._f.getEntries 7 tempArray
mi8.text = cryTools.cryAnim.UI.main.models._f.getEntries 8 tempArray
mi9.text = cryTools.cryAnim.UI.main.models._f.getEntries 9 tempArray
mi10.text = cryTools.cryAnim.UI.main.models._f.getEntries 10 tempArray
mi11.text = cryTools.cryAnim.UI.main.models._f.getEntries 11 tempArray
mi12.text = cryTools.cryAnim.UI.main.models._f.getEntries 12 tempArray
mi13.text = cryTools.cryAnim.UI.main.models._f.getEntries 13 tempArray
mi14.text = cryTools.cryAnim.UI.main.models._f.getEntries 14 tempArray
mi15.text = cryTools.cryAnim.UI.main.models._f.getEntries 15 tempArray
mi16.text = cryTools.cryAnim.UI.main.models._f.getEntries 16 tempArray
mi17.text = cryTools.cryAnim.UI.main.models._f.getEntries 17 tempArray
mi18.text = cryTools.cryAnim.UI.main.models._f.getEntries 18 tempArray
mi19.text = cryTools.cryAnim.UI.main.models._f.getEntries 19 tempArray
mi20.text = cryTools.cryAnim.UI.main.models._f.getEntries 20 tempArray
)
cryTools.cryAnim._v.various[17] = tempArray
)
on mi1 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][1])
on mi2 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][2])
on mi3 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][3])
on mi4 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][4])
on mi5 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][5])
on mi6 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][6])
on mi7 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][7])
on mi8 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][8])
on mi9 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][9])
on mi10 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][10])
on mi11 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][11])
on mi12 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][12])
on mi13 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][13])
on mi14 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][14])
on mi15 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][15])
on mi16 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][16])
on mi17 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][17])
on mi18 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][18])
on mi19 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][19])
on mi20 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][20])
on miEdit picked do
(
rollout editModelListRO "Edit Model List"
(
activeXControl lbModels "MSComctlLib.ListViewCtrl" pos:[1,1] height:185 width:440
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save model list"
button btnDelete "Delete" pos:[150,195] height:20 width:60 toolTip:"Deletes selected entry"
button btnDeleteAll "Delete All" pos:[220,195] height:20 width:60 toolTip:"Clears whole list"
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit model list"
on editModelListRO open do
(
lbModels.GridLines = true
lbModels.MousePointer = #ccArrow
lbModels.AllowColumnReorder = true
lbModels.view = #lvwReport
lbModels.LabelEdit = #lvwAutomatic
lbModels.Sorted = true
lbModels.FullRowSelect = true
tempArray = cryTools.cryAnim.base.iniFile #get #models
if tempArray != "" and tempArray != undefined then
(
for i = 1 to tempArray.count do
(
local lbModelsEntry = lbModels.listItems.Add text:tempArray[i].name
lbModelsEntry.listSubItems.Add text:tempArray[i].path
)
)
lbModels.columnHeaders.Add text:"Name"
lbModels.columnHeaders.Add text:"Path"
)
on lbModels DblClick do
(
screenPos = getCursorPos lbModels
tempItem = lbModels.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
if tempItem != undefined then
(
for i = 1 to lbModels.ListItems.count do
(
if lbModels.listItems[i].selected == true then
(
tempValue = getOpenFileName caption:"Select Model to open" filename:lbModels.ListItems[i].listSubItems[1].text types:"3ds max (*.max)|*.max"
if (tempValue != false) and (tempValue != undefined) then
(
lbModels.ListItems[i].listSubItems[1].text = tempValue
lbModels.ListItems[i].text = cryTools.cryAnim.base.perforce tempValue #getFilename
)
)
)
)
else
(
lastIndex = lbModels.ListItems.count
if lbModels.ListItems.count > 0 then
tempPath = lbModels.ListItems[lastIndex].listSubItems[1].text
else
tempPath = maxFilePath + maxFileName
tempValue = getOpenFileName caption:"Select Model to open" filename:tempPath types:"3ds max (*.max)|*.max"
if (tempValue != false) and (tempValue != undefined) then
(
local tempEntry = lbModels.ListItems.Add text:(cryTools.cryAnim.base.perforce tempValue #getFilename)
tempEntry.ListSubItems.Add text:tempValue
)
)
)
on btnSave pressed do
(
local tempArray = #()
for i = 1 to lbModels.ListItems.count do
append tempArray (modelPathStruct name:lbModels.ListItems[i].text path:lbModels.ListItems[i].ListSubItems[1].text)
cryTools.cryAnim.base.iniFile #set #models value:tempArray
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
)
on btnDelete pressed do
(
deleteIndex = 0
for i = 1 to lbModels.ListItems.count do
(
try
(
if lbModels.ListItems[i].selected == true then
lbModels.ListItems.Remove i
)
catch()
)
)
on btnDeleteAll pressed do
(
lbModels.ListItems.clear()
)
on btnCancel pressed do
(
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
)
on lbModels BeforeLabelEdit cancel do
(
enableAccelerators = false
)
on lbModels AfterLabelEdit cancel newString do
(
enableAccelerators = true
)
)
cryTools.cryAnim.UI.main.models.editModelList = editModelListRO
editModelListRO = undefined
createDialog cryTools.cryAnim.UI.main.models.editModelList 443 220
)
)
cryTools.cryAnim.UI.main.models.loadModelRC = loadModelRC
loadModelRC = undefined
registerRightClickMenu cryTools.cryAnim.UI.main.models.loadModelRC
popUpMenu cryTools.cryAnim.UI.main.models.loadModelRC pos:[(mouse.screenpos[1] - 10), (mouse.screenpos[2] - 10)]
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.btnLoadModel.pressed" )
)
)
logOutput "> Created modelsRO rollout"
try
(
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
else
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
)
catch ( logOutput "!!> Error adding modelsRO to main dialog" )
modelsRO = undefined
logOutput ">> models8.ms loaded"
@@ -1,641 +0,0 @@
--###############################################################################
--// rollout with elements to control models and items
--###############################################################################
rollout modelsRO "Models"
(
button btnLoadModel "Load Model" pos:[8,8] width:142 height:20 toolTip:"Loads often used models and shows dialog to edit them"
groupBox gbItems " Items " pos:[2,35] width:153 height:50
dropDownList ddItemSelect "" pos:[8,55] width:142 height:21
on modelsRO open do
(
try
(
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Models" "").open = cryTools.cryAnim.base.iniFile #get #modelsRO) catch()
cryTools.cryAnim.UI.main.models._v.itemList = cryTools.cryAnim.UI.main.models._f.selectItem "" #getList
local tempListArray = cryTools.cryAnim.UI.main.models._v.itemList
local tempListArray2 = #()
for i = 1 to tempListArray.count do
tempListArray2[i] = tempListArray[i].name
join tempListArray2 #("-------------------------------------------", "Edit Entries")
ddItemSelect.items = tempListArray2
if (local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex) != 0 then
ddItemSelect.selection = tempVar
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.open" )
)
on modelsRO rolledUp value do
(
try
(
if (cryTools.cryAnim.base.iniFile #get #modelsRO) != value then
cryTools.cryAnim.base.iniFile #set #modelsRO
cryTools.cryAnim.UI.main._f.updateDialog()
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.rolledUp" )
)
on ddItemSelect selected value do
(
try
(
if value < (ddItemSelect.items.count - 1) then
(
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem value #set
if tempVar == false then
ddItemSelect.selection = 1
)
else
ddItemSelect.selection = ddItemSelect.items.count
if ddItemSelect.selection == ddItemSelect.items.count then
(
try ( destroyDialog cryTools.cryAnim.UI.main.models.editItemList ) catch()
rollout editItemListRO "Edit Item List"
(
dotNetControl lbItems "System.Windows.Forms.ListView" pos:[1,1] height:185 width:440
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save item list"
button btnAdd "Add" pos:[120,195] height:20 width:60 toolTip:"Adds new entry"
button btnDelete "Delete" pos:[190,195] height:20 width:60 toolTip:"Deletes selected entry"
button btnDeleteAll "Delete All" pos:[260,195] height:20 width:60 toolTip:"Clears whole list"
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit item list"
on editItemListRO open do
(
lbItems.GridLines = true
lbItems.AllowColumnReorder = true
lbItems.View = lbItems.View.Details
lbItems.LabelEdit = false
lbItems.LabelWrap = true
lbItems.FullRowSelect = true
lbItems.HideSelection = false
lbItems.Sorting = lbItems.Sorting.Ascending
lbItems.Columns.Add "ID"
lbItems.Columns.Add "Name"
lbItems.Columns.Add "External"
lbItems.Columns.Add "Model"
lbItems.Columns.Add "Reference"
lbItems.Columns.Add "Parent"
lbItems.Columns.Add "Rotation"
lbItems.Columns.Add "Position"
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
(
local lbItemsEntry = lbItems.Items.Add (i as String)
lbItemsEntry.SubItems.Add cryTools.cryAnim.UI.main.models._v.itemList[i].name
lbItemsEntry.SubItems.Add cryTools.cryAnim.UI.main.models._v.itemList[i].external
local maxCount = cryTools.cryAnim.UI.main.models._v.itemList[i].model.count
tempStringArray = #("","","","","")
for f = 1 to maxCount do
(
tempStringArray[1] += cryTools.cryAnim.UI.main.models._v.itemList[i].model[f] + (if f < maxCount then ";" else "")
tempStringArray[2] += cryTools.cryAnim.UI.main.models._v.itemList[i].reference[f] + (if f < maxCount then ";" else "")
tempStringArray[3] += cryTools.cryAnim.UI.main.models._v.itemList[i].parent[f] + (if f < maxCount then ";" else "")
tempStringArray[4] += cryTools.cryAnim.UI.main.models._v.itemList[i].rotation[f] as String + (if f < maxCount then ";" else "")
tempStringArray[5] += cryTools.cryAnim.UI.main.models._v.itemList[i].position[f] as String + (if f < maxCount then ";" else "")
)
lbItemsEntry.SubItems.Add tempStringArray[1]
lbItemsEntry.SubItems.Add tempStringArray[2]
lbItemsEntry.SubItems.Add tempStringArray[3]
lbItemsEntry.SubItems.Add tempStringArray[4]
lbItemsEntry.SubItems.Add tempStringArray[5]
)
cryTools.cryAnim.UI.main.models._f.updateExtent()
cryTools.cryAnim.UI.main.models._f.sortList()
)
on lbItems DoubleClick do
(
tempItem = lbItems.FocusedItem
tempItem.checked = not tempItem.checked
if tempItem != undefined then
(
try ( destroyDialog cryTools.cryAnim.UI.main.models.editDetails ) catch()
rollout entryDetailsRO "Entry Details"
(
label labID "ID :" pos:[8,10]
label labName "Name :" pos:[8,30]
label labExternal "External :" pos:[8,50]
label labModel "Model :" pos:[8,70]
label labReference "Reference :" pos:[8,90]
label labParent "Parent :" pos:[8,110]
label labRotation "Rotation :" pos:[8,130]
label labPosition "Position :" pos:[8,150]
edittext edID "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.text pos:[70,10] fieldWidth:300
edittext edName "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 1).text pos:[70,30] fieldWidth:300
edittext edExternal "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 2).text pos:[70,50] fieldWidth:300
edittext edModel "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 3).text pos:[70,70] fieldWidth:300
edittext edReference "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 4).text pos:[70,90] fieldWidth:300
edittext edParent "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 5).text pos:[70,110] fieldWidth:300
edittext edRotation "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 6).text pos:[70,130] fieldWidth:300
edittext edPosition "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 7).text pos:[70,150] fieldWidth:300
button btnSave "Save" pos:[40,180] height:20 width:80 toolTip:"Save item to item list"
button btnSetOffset "Set Offset" pos:[150,180] height:20 width:80 toolTip:"Generates new offset of the selected item"
button btnCancel "Cancel" pos:[260,180] height:20 width:80 toolTip:"Aborts edit dialog for the selected item"
on btnSave pressed do
(
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem
tempItem.text = edID.text
(tempItem.SubItems.item 1).text = edName.text
(tempItem.SubItems.item 2).text = edExternal.text
(tempItem.SubItems.item 3).text = edModel.text
(tempItem.SubItems.item 4).text = edReference.text
(tempItem.SubItems.item 5).text = edParent.text
(tempItem.SubItems.item 6).text = edRotation.text
(tempItem.SubItems.item 7).text = edPosition.text
cryTools.cryAnim.UI.main.models._f.updateExtent()
cryTools.cryAnim.UI.main.models._f.sortList()
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
)
on btnSetOffset pressed do
(
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem
if tempItem != undefined then
(
local refArray = filterString (tempItem.SubItems.item 4).text ";"
local parentArray = filterString (tempItem.SubItems.item 5).text ";"
local rotString = ""
local posString = ""
for i = 1 to refArray.count do
(
local tempObj = (cryTools.cryAnim._f.createSnapshot object:(getNodeByName refArray[i]))[1]
local tempParent = getNodeByName parentArray[i]
if (tempObj != undefined) and (tempParent != undefined) then
(
if tempParent.classID[1] != 37157 then
(
rotString += (in coordsys tempObj tempParent.rotation) as String + (if i < refArray.count then ";" else "")
posString += (in coordsys tempObj tempParent.pos) as String + (if i < refArray.count then ";" else "")
)
)
try (delete tempObj)catch()
)
edRotation.text = rotString
edPosition.text = posString
)
else
(
messageBox "No Item selected." title:"Reset Offset"
)
index = undefined
)
on btnCancel pressed do
(
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
)
)
cryTools.cryAnim.UI.main.models.entryDetails = entryDetailsRO
entryDetailsRO = undefined
createDialog cryTools.cryAnim.UI.main.models.entryDetails 385 210
)
tempItem = undefined
)
on btnAdd pressed do
(
local tempStringArray = (itemStruct name:"" external:"" model:"" reference:"" parent:"" rotation:"" position:"")
local tempArray = #()
local objArray = selectByName title:("Select Nodes to be added") showHidden:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterNode
if objArray != undefined then
(
local objLink = #()
for obj in objArray do
(
global tempObj = obj
objLink = selectByName title:("Select " + obj.name + " Reference") showHidden:true single:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterParent
if objLink != undefined then
(
objRotation = (in coordsys objLink obj.rotation) as String
objPosition = (in coordsys objLink obj.position) as String
objLink = objLink.name
)
else
(
objLink = ""
objRotation = ""
objPosition = ""
)
if obj.parent != undefined then
objParent = obj.parent.name
else
objParent = ""
append tempArray (itemStruct name:obj.name model:obj.name external:obj.name parent:objParent reference:objLink rotation:objRotation position:objPosition )
)
tempObj = undefined
)
if tempArray.count > 0 then
(
tempStringArray.name = tempArray[1].name
tempStringArray.external = tempArray[1].external
for i = 1 to tempArray.count do
(
tempStringArray.model += tempArray[i].model + (if i != tempArray.count then ";" else "")
tempStringArray.reference += tempArray[i].reference as String + (if i != tempArray.count then ";" else "")
tempStringArray.parent += tempArray[i].parent as String + (if i != tempArray.count then ";" else "")
tempStringArray.rotation += tempArray[i].rotation as String + (if i != tempArray.count then ";" else "")
tempStringArray.position += tempArray[i].position as String + (if i != tempArray.count then ";" else "")
)
local lbItemsEntry = lbItems.Items.Add ((lbItems.Items.count + 1) as String)
lbItemsEntry.SubItems.Add tempStringArray.name
lbItemsEntry.SubItems.Add tempStringArray.external
lbItemsEntry.SubItems.Add tempStringArray.model
lbItemsEntry.SubItems.Add tempStringArray.reference
lbItemsEntry.SubItems.Add tempStringArray.parent
lbItemsEntry.SubItems.Add tempStringArray.rotation
lbItemsEntry.SubItems.Add tempStringArray.position
cryTools.cryAnim.UI.main.models._f.updateExtent()
cryTools.cryAnim.UI.main.models._f.sortList()
)
)
on btnSave pressed do
(
local tempArray = #()
local tempList = #()
for i = 0 to (lbItems.Items.count - 1) do
(
local tempItemArray = #()
local tempItem = lbItems.Items.item i
for d = 1 to (tempItem.SubItems.count - 1) do
(
if (tempItem.SubItems.item d).text != "" then tempItemArray[d] = (tempItem.SubItems.item d).text else tempItemArray[d] = " "
)
append tempArray (itemStruct name:tempItemArray[1] external:tempItemArray[2] model:(filterString tempItemArray[3] ";") reference:(filterString tempItemArray[4] ";") parent:(filterString tempItemArray[5] ";") rotation:(filterString tempItemArray[6] ";") position:(filterString tempItemArray[7] ";"))
for f = 1 to tempArray[tempArray.count].model.count do
(
tempArray[tempArray.count].rotation[f] = execute (tempArray[tempArray.count].rotation[f])
tempArray[tempArray.count].position[f] = execute (tempArray[tempArray.count].position[f])
)
)
cryTools.cryAnim.base.iniFile #set #items value:tempArray
cryTools.cryAnim.UI.main.models._v.itemList = tempArray
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
append tempList cryTools.cryAnim.UI.main.models._v.itemList[i].name
join tempList #("-------------------------------------------", "Edit Entries")
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").items = tempList
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
)
on btnDelete pressed do
(
if lbItems.FocusedItem != undefined then
lbItems.FocusedItem.remove()
cryTools.cryAnim.UI.main.models._f.updateExtent()
cryTools.cryAnim.UI.main.models._f.sortList()
)
on btnDeleteAll pressed do
(
lbItems.Items.clear()
)
on btnCancel pressed do
(
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").selection = (cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").items.count - 1
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
)
on editItemListRO close do
(
try
(
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex
if tempVar != 0 then
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").selection = tempVar
)catch()
)
)
cryTools.cryAnim.UI.main.models.editItemList = editItemListRO
editItemListRO = undefined
createDialog cryTools.cryAnim.UI.main.models.editItemList 443 220
)
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.ddItemSelect.selected" )
)
on btnLoadModel pressed do
(
try
(
rcmenu loadModelRC
(
menUItem mi1 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 1))
menUItem mi2 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 2))
menUItem mi3 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 3))
menUItem mi4 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 4))
menUItem mi5 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 5))
menUItem mi6 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 6))
menUItem mi7 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 7))
menUItem mi8 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 8))
menUItem mi9 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 9))
menUItem mi10 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 10))
menUItem mi11 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 11))
menUItem mi12 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 12))
menUItem mi13 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 13))
menUItem mi14 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 14))
menUItem mi15 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 15))
menUItem mi16 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 16))
menUItem mi17 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 17))
menUItem mi18 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 18))
menUItem mi19 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 19))
menUItem mi20 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 20))
seperator miSep checked:false
menUItem miEdit "Edit Entries" checked:false
on loadModelRC open do
(
tempPathArray = #()
tempArray = cryTools.cryAnim.base.iniFile #get #models
if tempArray != "" and tempArray != undefined then
(
mi1.text = cryTools.cryAnim.UI.main.models._f.getEntries 1 tempArray
mi2.text = cryTools.cryAnim.UI.main.models._f.getEntries 2 tempArray
mi3.text = cryTools.cryAnim.UI.main.models._f.getEntries 3 tempArray
mi4.text = cryTools.cryAnim.UI.main.models._f.getEntries 4 tempArray
mi5.text = cryTools.cryAnim.UI.main.models._f.getEntries 5 tempArray
mi6.text = cryTools.cryAnim.UI.main.models._f.getEntries 6 tempArray
mi7.text = cryTools.cryAnim.UI.main.models._f.getEntries 7 tempArray
mi8.text = cryTools.cryAnim.UI.main.models._f.getEntries 8 tempArray
mi9.text = cryTools.cryAnim.UI.main.models._f.getEntries 9 tempArray
mi10.text = cryTools.cryAnim.UI.main.models._f.getEntries 10 tempArray
mi11.text = cryTools.cryAnim.UI.main.models._f.getEntries 11 tempArray
mi12.text = cryTools.cryAnim.UI.main.models._f.getEntries 12 tempArray
mi13.text = cryTools.cryAnim.UI.main.models._f.getEntries 13 tempArray
mi14.text = cryTools.cryAnim.UI.main.models._f.getEntries 14 tempArray
mi15.text = cryTools.cryAnim.UI.main.models._f.getEntries 15 tempArray
mi16.text = cryTools.cryAnim.UI.main.models._f.getEntries 16 tempArray
mi17.text = cryTools.cryAnim.UI.main.models._f.getEntries 17 tempArray
mi18.text = cryTools.cryAnim.UI.main.models._f.getEntries 18 tempArray
mi19.text = cryTools.cryAnim.UI.main.models._f.getEntries 19 tempArray
mi20.text = cryTools.cryAnim.UI.main.models._f.getEntries 20 tempArray
)
cryTools.cryAnim._v.various[17] = tempArray
)
on mi1 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][1])
on mi2 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][2])
on mi3 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][3])
on mi4 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][4])
on mi5 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][5])
on mi6 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][6])
on mi7 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][7])
on mi8 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][8])
on mi9 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][9])
on mi10 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][10])
on mi11 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][11])
on mi12 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][12])
on mi13 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][13])
on mi14 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][14])
on mi15 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][15])
on mi16 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][16])
on mi17 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][17])
on mi18 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][18])
on mi19 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][19])
on mi20 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][20])
on miEdit picked do
(
rollout editModelListRO "Edit Model List"
(
dotNetControl lbModels "System.Windows.Forms.ListView" pos:[1,1] height:185 width:440
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save model list"
button btnAdd "Add" pos:[120,195] height:20 width:60 toolTip:"Add new entry"
button btnDelete "Delete" pos:[190,195] height:20 width:60 toolTip:"Deletes selected entry"
button btnDeleteAll "Delete All" pos:[260,195] height:20 width:60 toolTip:"Clears whole list"
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit model list"
on editModelListRO open do
(
lbModels.GridLines = true
lbModels.AllowColumnReorder = true
lbModels.View = lbModels.View.Details
lbModels.LabelEdit = true
lbModels.LabelWrap = true
lbModels.FullRowSelect = true
lbModels.HideSelection = false
lbModels.Sorting = lbModels.Sorting.Ascending
tempArray = cryTools.cryAnim.base.iniFile #get #models
if tempArray != "" and tempArray != undefined then
(
for i = 1 to tempArray.count do
(
local lbModelsEntry = lbModels.Items.Add tempArray[i].name
lbModelsEntry.SubItems.Add tempArray[i].path
)
)
lbModels.Columns.Add "Name"
lbModels.Columns.Add "Path"
cryTools.cryAnim.UI.main.models._f.updateExtentModel()
)
on lbModels DoubleClick do
(
tempItem = lbModels.FocusedItem
if tempItem != undefined then
(
tempValue = getOpenFileName caption:"Select Model to open" filename:(lbModels.FocusedItem.SubItems.item 1).text types:"3ds max (*.max)|*.max"
if (tempValue != false) and (tempValue != undefined) then
(
(lbModels.FocusedItem.SubItems.item 1).text = tempValue
lbModels.FocusedItem.text = cryTools.cryAnim.base.perforce tempValue #getFilename
)
)
else
(
lastIndex = lbModels.ListItems.count
if lbModels.ListItems.count > 0 then
tempPath = lbModels.ListItems[lastIndex].listSubItems[1].text
else
tempPath = maxFilePath + maxFileName
tempValue = getOpenFileName caption:"Select Model to open" filename:tempPath types:"3ds max (*.max)|*.max"
if (tempValue != false) and (tempValue != undefined) then
(
local tempEntry = lbModels.ListItems.Add text:(cryTools.cryAnim.base.perforce tempValue #getFilename)
tempEntry.ListSubItems.Add text:tempValue
)
)
cryTools.cryAnim.UI.main.models._f.updateExtentModel()
)
on btnAdd pressed do
(
lastIndex = (lbModels.Items.count - 1)
if lbModels.Items.count > 0 then
tempPath = ((lbModels.Items.item lastIndex).SubItems.item 1).text
else
tempPath = maxFilePath + maxFileName
tempValue = getOpenFileName caption:"Select Model to open" filename:tempPath types:"3ds max (*.max)|*.max"
if (tempValue != false) and (tempValue != undefined) then
(
local tempEntry = lbModels.Items.Add (cryTools.cryAnim.base.perforce tempValue #getFilename)
tempEntry.SubItems.Add tempValue
)
cryTools.cryAnim.UI.main.models._f.updateExtentModel()
)
on btnSave pressed do
(
local tempArray = #()
for i = 0 to (lbModels.Items.count - 1) do
append tempArray (modelPathStruct name:(lbModels.Items.item i).text path:((lbModels.Items.item i).SubItems.item 1).text)
cryTools.cryAnim.base.iniFile #set #models value:tempArray
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
)
on btnDelete pressed do
(
if lbModels.FocusedItem != undefined then
lbModels.FocusedItem.remove()
)
on btnDeleteAll pressed do
(
lbModels.Items.clear()
)
on btnCancel pressed do
(
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
)
)
cryTools.cryAnim.UI.main.models.editModelList = editModelListRO
editModelListRO = undefined
createDialog cryTools.cryAnim.UI.main.models.editModelList 443 220
)
)
cryTools.cryAnim.UI.main.models.loadModelRC = loadModelRC
loadModelRC = undefined
registerRightClickMenu cryTools.cryAnim.UI.main.models.loadModelRC
popUpMenu cryTools.cryAnim.UI.main.models.loadModelRC pos:[(mouse.screenpos[1] - 10), (mouse.screenpos[2] - 10)]
)
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.btnLoadModel.pressed" )
)
)
logOutput "> Created modelsRO rollout"
--try
(
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
else
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
)
--catch ( logOutput "!!> Error adding modelsRO to main dialog" )
modelsRO = undefined
logOutput ">> models9.ms loaded"
-263
View File
@@ -1,263 +0,0 @@
--###############################################################################
--// rollout with elements to control models, weapons and other things like nanoMuscles
--###############################################################################
rollout musclesRO "Muscles"
(
groupBox gbMuscles " Muscles " pos:[2,2] width:153 height:62
checkBox chkAutomateMuscles "Auto-Muscles" pos:[8,18] width:90 height:20 checked:true fieldWidth:0
checkBox chkUseMusclesKeys "Use Keys" pos:[8,38] width:90 height:20 enabled:false fieldWidth:0
button btnCreateMuscles "Create" pos:[100,16] width:50 height:20 toolTip:"Creates the nano muscles rig on Bip01"
button btnBakeMuscles "Bake" pos:[100,36] width:50 height:20 toolTip:"Bakes down all keys of the muscle bones"
on musclesRO open do
(
try
(
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Muscles" "").open = cryTools.cryAnim.base.iniFile #get #musclesRO) catch()
global automateAnimateMuscles = undefined
global useMuscleKeys = undefined
nanoConPosArray = #("_Bip01 L rear deltoid01_Con", "_Bip01 L rear deltoid02_Con", "_Bip01 L clavicular deltoid01_Con", "_Bip01 R rear deltoid01_Con", "_Bip01 R rear deltoid02_Con", "_Bip01 R clavicular deltoid01_Con")
nanoConRotArray = #("_Bip01 L knee_Con", "_Bip01 R knee_Con")
errorOutput = undefined
for i = 1 to nanoConPosArray.count do
if (getNodeByName nanoConPosArray[i]) == undefined then
errorOutput = true
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.open" )
)
on musclesRO rolledUp value do
(
try
(
if (cryTools.cryAnim.base.iniFile #get #muscles) != value then
cryTools.cryAnim.base.iniFile #set #muscles
cryTools.cryAnim.UI.main._f.updateDialog()
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.rolledUp" )
)
on chkAutomateMuscles changed value do
(
try
(
if chkAutomateMuscles.checked == true then
global automateAnimateMuscles = undefined
else
global automateAnimateMuscles = false
chkUseMusclesKeys.enabled = not chkAutomateMuscles.checked
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.chkAutomateMuscles.changed" )
)
on chkUseMusclesKeys changed value do
(
try
(
if chkUseMusclesKeys.checked == true then
global useMuscleKeys = true
else
global useMuscleKeys = undefined
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.chkUseMusclesKeys.changed" )
)
on btnBakeMuscles pressed do
(
try
(
if $'_Bip01 L clavicular deltoid01_LA' != undefined then
(
if (queryBox "Bake all Muscle Bones?" title:"Muscle Rig") == true then
cryTools.cryAnim.UI.main.loadSave._f.bakeMuscleBones()
)
else
messageBox "No Muscle Rig on Bip01" title:"Muscle Rig"
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.btnBakeMuscles.pressed" )
)
on btnCreateMuscles pressed do
(
try
(
if $Bip01 != undefined then
(
if (queryBox "Create MuscleRig for Bip01?" title:"Muscle Rig") == true then
(
undo "createMuscleRig" on
(
$Bip01.controller.figureMode = true
completeRedraw()
saveSelection = getCurrentSelection()
saveSliderTime = sliderTime
clearSelection()
with redraw off
(
Bip01_R_rear_deltoid02_LA = dummy name:"_Bip01 R rear deltoid02_LA" boxsize:[2,2,2]
Bip01_R_clavicular_deltoid01_LA = dummy name:"_Bip01 R clavicular deltoid01_LA" boxsize:[2,2,2]
Bip01_R_rear_deltoid01_LA = dummy name:"_Bip01 R rear deltoid01_LA" boxsize:[2,2,2]
Bip01_L_rear_deltoid02_LA = dummy name:"_Bip01 L rear deltoid02_LA" boxsize:[2,2,2]
Bip01_L_clavicular_deltoid01_LA = dummy name:"_Bip01 L clavicular deltoid01_LA" boxsize:[2,2,2]
Bip01_L_rear_deltoid01_LA = dummy name:"_Bip01 L rear deltoid01_LA" boxsize:[2,2,2]
Bip01_R_Clavicle_Con = dummy name:"_Bip01 R Clavicle_Con" pos:$'Bip01 R UpperArm'.transform.pos boxsize:[6,6,6]
Bip01_L_Clavicle_Con = dummy name:"_Bip01 L Clavicle_Con" pos:$'Bip01 L UpperArm'.transform.pos boxsize:[6,6,6]
Bip01_R_Clavicle_Con.parent = $'Bip01 R Clavicle'
Bip01_L_Clavicle_Con.parent = $'Bip01 L Clavicle'
Bip01_R_knee_rotDif = dummy name:"_Bip01 R knee_rotDif" rotation:(inverse($'Bip01 R Calf'.transform.rotation)) pos:$'Bip01 R Calf'.transform.pos boxsize:[3,3,3]
Bip01_L_knee_rotDif = dummy name:"_Bip01 L knee_rotDif" rotation:$'Bip01 L Calf'.transform.rotation pos:$'Bip01 L Calf'.transform.pos boxsize:[3,3,3]
Bip01_R_knee_rotDif.parent = $'Bip01 R Calf'
Bip01_L_knee_rotDif.parent = $'Bip01 L Calf'
Bip01_R_knee_Con = dummy name:"_Bip01 R knee_Con" pos:$'Bip01 R Thigh'.transform.pos boxsize:[3,3,3]
Bip01_L_knee_Con = dummy name:"_Bip01 L knee_Con" pos:$'Bip01 L Thigh'.transform.pos boxsize:[3,3,3]
Bip01_R_knee_Con.parent = $'Bip01 R Thigh'
Bip01_L_knee_Con.parent = $'Bip01 L Thigh'
Bip01_R_rear_deltoid01_Con = dummy name:"_Bip01 R rear deltoid01_Con" boxsize:[3,3,3]
Bip01_R_rear_deltoid02_Con = dummy name:"_Bip01 R rear deltoid02_Con" boxsize:[3,3,3]
Bip01_R_clavicular_deltoid01_Con = dummy name:"_Bip01 R clavicular deltoid01_Con" boxsize:[3,3,3]
Bip01_L_rear_deltoid01_Con = dummy name:"_Bip01 L rear deltoid01_Con" boxsize:[3,3,3]
Bip01_L_rear_deltoid02_Con = dummy name:"_Bip01 L rear deltoid02_Con" boxsize:[3,3,3]
Bip01_L_clavicular_deltoid01_Con = dummy name:"_Bip01 L clavicular deltoid01_Con" boxsize:[3,3,3]
Bip01_R_rear_deltoid01_Con.position.controller = position_script() ; Bip01_R_rear_deltoid01_Con.position.controller.script = "RRear01 = (getVert $NanoSUIt 4068) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 R rear deltoid01_LA'.pos = RRear01 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 R rear deltoid01_LA'.pos = RRear01 ) else RRear01 )"
Bip01_R_rear_deltoid02_Con.position.controller = position_script() ; Bip01_R_rear_deltoid02_Con.position.controller.script = "RRear02 = (getVert $NanoSUIt 4221) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 R rear deltoid02_LA'.pos = RRear02 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 R rear deltoid02_LA'.pos = RRear02 ) else RRear02 )"
Bip01_R_clavicular_deltoid01_Con.position.controller = position_script() ; Bip01_R_clavicular_deltoid01_Con.position.controller.script = "RFront = (getVert $NanoSUIt 4064) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 R clavicular deltoid01_LA'.pos = RFront ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 R clavicular deltoid01_LA'.pos = RFront ) else RFront )"
Bip01_L_rear_deltoid01_Con.position.controller = position_script() ; Bip01_L_rear_deltoid01_Con.position.controller.script = "LRear01 = (getVert $NanoSUIt 3809) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 L rear deltoid01_LA'.pos = LRear01 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 L rear deltoid01_LA'.pos = LRear01 ) else LRear01 )"
Bip01_L_rear_deltoid02_Con.position.controller = position_script() ; Bip01_L_rear_deltoid02_Con.position.controller.script = "LRear02 = (getVert $NanoSUIt 3962) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 L rear deltoid02_LA'.pos = LRear02 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 L rear deltoid02_LA'.pos = LRear02 ) else LRear02 )"
Bip01_L_clavicular_deltoid01_Con.position.controller = position_script() ; Bip01_L_clavicular_deltoid01_Con.position.controller.script = "LFront = (getVert $NanoSUIt 3805) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 L clavicular deltoid01_LA'.pos = LFront ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 L clavicular deltoid01_LA'.pos = LFront ) else LFront )"
Bip01_L_knee_Con.rotation.controller = rotation_script() ; Bip01_L_knee_Con.rotation.controller.script = "fn LKneeMuscles = ( LKneeOriginRot = (quat -0.461687 0.548192 -0.440465 -0.540667) ; LKneeOriginPos = [43.0243,-0.746225,0.291201] ; LrotDiff = (in coordsys $'Bip01 L Thigh' $'_Bip01 L knee_rotDif'.rotation) as eulerangles ; in coordsys $'Bip01 L Thigh' ( $'Bip01 L knee'.rotation = LKneeOriginRot ; $'Bip01 L knee'.pos = LKneeOriginPos ) in coordsys $'Bip01 L knee' (rotate $'Bip01 L knee' (eulerangles (LrotDiff.z / -2) 0 0)) ) if automateAnimateMuscles == undefined then ( with animate off LKneeMuscles() ) else ( if useMusclesKeys == undefined then ( with animate on LKneeMuscles() ) ) ; $'Bip01 L Thigh'.transform.rotation"
Bip01_R_knee_Con.rotation.controller = rotation_script() ; Bip01_R_knee_Con.rotation.controller.script = "fn RKneeMuscles = ( RKneeOriginRot = (quat -0.530717 -0.393879 0.549399 -0.511233) ; RKneeOriginPos = [43.0243,-0.746225,0.291201] ; RrotDiff = (in coordsys $'Bip01 R Thigh' $'_Bip01 R knee_rotDif'.rotation) as eulerangles ; in coordsys $'Bip01 R Thigh' ( $'Bip01 R knee'.rotation = RKneeOriginRot ; $'Bip01 R knee'.pos = RKneeOriginPos ) in coordsys $'Bip01 R knee' (rotate $'Bip01 R knee' (eulerangles (RrotDiff.z / -2) 0 0)) ) if automateAnimateMuscles == undefined then ( with animate off RKneeMuscles() ) else ( if useMusclesKeys == undefined then ( with animate on RKneeMuscles() ) ) ; $'Bip01 R Thigh'.transform.rotation"
Bip01_R_Clavicle_Con.isHidden = true
Bip01_L_Clavicle_Con.isHidden = true
Bip01_R_knee_Con.isHidden = true
Bip01_L_knee_Con.isHidden = true
Bip01_R_knee_rotDif.isHidden = true
Bip01_L_knee_rotDif.isHidden = true
Bip01_R_rear_deltoid01_Con.isHidden = true
Bip01_R_rear_deltoid02_Con.isHidden = true
Bip01_R_clavicular_deltoid01_Con.isHidden = true
Bip01_L_rear_deltoid01_Con.isHidden = true
Bip01_L_rear_deltoid02_Con.isHidden = true
Bip01_L_clavicular_deltoid01_Con.isHidden = true
-- LOOKAT-SETUP --
$'Bip01 R rear deltoid01'.transform = (matrix3 [0.800769,0.401167,0.444785] [-0.104045,-0.638128,0.762868] [0.589868,-0.657158,-0.469253] [-15.3582,10.8964,154.478])
$'Bip01 R rear deltoid02'.transform = (matrix3 [0.864961,0.479963,0.14655] [0.0248794,-0.33268,0.942711] [0.501221,-0.811763,-0.299696] [-13.2617,14.8806,147.713])
$'Bip01 R clavicular deltoid01'.transform = (matrix3 [0.879667,-0.134998,0.456029] [0.448849,-0.0813437,-0.889898] [0.157229, 0.987502,-0.0109619] [-11.1466,-5.93142,154.513])
$'Bip01 L rear deltoid01'.transform = (matrix3 [0.800769,-0.401167,-0.444785] [-0.104045,0.638128,-0.762868] [0.589868,0.657159,0.469254] [15.3582,10.8963,154.478])
$'Bip01 L rear deltoid02'.transform = (matrix3 [0.864962,-0.479963,-0.14655] [0.0248793,0.33268,-0.942712] [0.501221,0.811763,0.299697] [13.2617,14.8806,147.713])
$'Bip01 L clavicular deltoid01'.transform = (matrix3 [0.879666,0.134998,-0.456029] [0.448849,0.0813439,0.889898] [0.157229,-0.987501,0.0109618] [11.1466,-5.93141,154.513])
$'Bip01 R rear deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
$'Bip01 R rear deltoid02'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
$'Bip01 R clavicular deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
$'Bip01 L rear deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
$'Bip01 L rear deltoid02'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
$'Bip01 L clavicular deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
$'Bip01 R rear deltoid01'.rotation.controller.appendTarget $'_Bip01 R rear deltoid01_LA' 100
$'Bip01 R rear deltoid02'.rotation.controller.appendTarget $'_Bip01 R rear deltoid02_LA' 100
$'Bip01 R clavicular deltoid01'.rotation.controller.appendTarget $'_Bip01 R clavicular deltoid01_LA' 100
$'Bip01 L rear deltoid01'.rotation.controller.appendTarget $'_Bip01 L rear deltoid01_LA' 100
$'Bip01 L rear deltoid02'.rotation.controller.appendTarget $'_Bip01 L rear deltoid02_LA' 100
$'Bip01 L clavicular deltoid01'.rotation.controller.appendTarget $'_Bip01 L clavicular deltoid01_LA' 100
)
completeRedraw()
$Bip01.controller.figureMode = false
if sliderTime != animationRange.end then
sliderTime += 1
else
sliderTime -= 1
sliderTime = saveSliderTime
for obj in saveSelection do
selectMore obj
)
)
)
else
(
messageBox "No Bip01 in Scene" title:"Error Generating MuscleRig"
)
)
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.btnCreateMuscles.pressed" )
)
)
logOutput "> Created muscleRO rollout"
try
(
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
addSubRollout cryTools.cryAnim.UI.main.dialog.row2 musclesRO
else
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 musclesRO rolledUp:true
)
catch ( logOutput "!!> Error adding musclesRO to main dialog" )
musclesRO = undefined
logOutput ">> muscle.ms loaded"

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