Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3e306b0
Quick PLY mesh file reader test fix.
Oct 28, 2025
a3f553b
CMake changes
Oct 28, 2025
5ee8167
Updated types
Oct 28, 2025
dba0eb6
Python slot fix
Oct 28, 2025
2c47f57
Added correct prefix to _appleseedstudio PyImport.
Oct 29, 2025
22f6d1a
Linking appleseed.python3 to appleseed.studio.
Oct 29, 2025
d2c37c1
wchar_t conversion changes
Oct 29, 2025
5059842
Ensured build-ability with Python 2.7
Oct 30, 2025
b854b28
Quick PLY mesh file reader test fix.
Oct 30, 2025
13d053e
update utils.py script to python 3
geckguy Apr 22, 2023
1b27ca2
change subprocess function
geckguy Apr 22, 2023
91fbdef
update runtestsuite to py3
geckguy Jun 1, 2023
ce4e7a3
replace several next() and map functions
geckguy Jun 1, 2023
761319d
fix tag err
geckguy Jun 1, 2023
040378d
update cleanmany and convert many files
geckguy Jun 2, 2023
84b4716
rename winreg module and few other python3 updates
geckguy Jun 3, 2023
bf6d5ed
update to python3
geckguy Jun 3, 2023
56aaf80
update to python3
geckguy Jun 6, 2023
4e13796
finish updating scripts folder to py3
geckguy Jun 8, 2023
579f396
update to py3
geckguy Jun 8, 2023
d709c99
update to py3
geckguy Jun 9, 2023
1e4247a
Update to py3
geckguy Jun 10, 2023
4980982
Update to py3
geckguy Jun 12, 2023
ad03c52
Update to py3
geckguy Jun 12, 2023
7ce8a9b
Update __init__.py
geckguy Aug 27, 2023
76bedd9
Update convertmany.py
geckguy Aug 27, 2023
d2af333
Update oslextractmeta.py
geckguy Aug 27, 2023
1ad18be
Update rendermanager.py
geckguy Aug 27, 2023
88eba53
Update rendernode.py
geckguy Aug 27, 2023
8114301
Update aspaths2json.py
geckguy Aug 27, 2023
5393c27
Update sortincludes.py
geckguy Aug 27, 2023
1d149d6
Added .vs to .gitignore.
Oct 30, 2025
4ec345c
Update runtestsuit.py and png.py.
Oct 30, 2025
9f7c644
Small setup script fix (Ubuntu 24).
4134N4 Nov 19, 2025
f1118e2
Merge pull request #3 from 4134N4/feat/python3-update-geckguy
4134N4 Nov 19, 2025
feed047
Removed debugging pragma messages.
4134N4 Nov 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dependencies/
sandbox/shaders/
*.pyc
__pycache__
.vs/
.vscode/
dependencies/
collected-deps/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
Expand Down Expand Up @@ -55,3 +54,4 @@ def list_objects_in_assembly(ass):
child_assemblies = ass.assemblies()
for sub_ass_key in child_assemblies:
list_objects_in_assembly(child_assemblies[sub_ass_key])

3 changes: 2 additions & 1 deletion sandbox/share/aspaths2json.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# -------------------------------------------------------------------------------------------------

def fatal(message):
print("Fatal: {0}. Aborting.".format(message))
print(f"Fatal: {message}. Aborting.")
sys.exit(1)


Expand Down Expand Up @@ -213,3 +213,4 @@ def main():

if __name__ == '__main__':
main()

5 changes: 3 additions & 2 deletions sandbox/share/mitsuba2appleseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
# THE SOFTWARE.
#

from __future__ import division
from __future__ import print_function


from xml.etree.ElementTree import ElementTree
import appleseed as asr
import argparse
Expand Down Expand Up @@ -955,3 +955,4 @@ def main():

if __name__ == '__main__':
main()

11 changes: 6 additions & 5 deletions sandbox/share/rfmdisneypresets2appleseed.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def main():
for root, dirname, files in os.walk(args.directory):
for filename in files:
if filename.endswith(".mel"):
print "Processing file: " + os.path.join(root, filename)
print("Processing file: " + os.path.join(root, filename))

material_name = filename.replace(".mel", "")

Expand All @@ -75,7 +75,7 @@ def main():

# Check if the material is a Disney BRDF
if not DISNEY_BRDF_KEYS.issubset(set(params.keys())):
print "Error: material preset %s is not a Disney BRDF." % material_name
print(f"Error: material preset {material_name} is not a Disney BRDF.")

if args.stop_error:
sys.exit(1)
Expand All @@ -84,21 +84,21 @@ def main():

# Check the material for possible incompatibilities
if params["emitColorR"] != "0.0" or params["emitColorG"] != "0.0" or params["emitColorB"] != "0.0":
print "Error: material %s preset uses emision." % material_name
print(f"Error: material {material_name} preset uses emision.")

if args.stop_error:
sys.exit(1)

# Subsurface color is missing in appleseed's Disney BRDF implementation.
if params["subsurface"] != "0.0":
if params["subsurfaceColorR"] != params["baseColorR"] or params["subsurfaceColorG"] != params["baseColorG"] or params["subsurfaceColorB"] != params["baseColorB"]:
print "Error: material preset %s uses subsurface color." % material_name
print(f"Error: material preset {material_name} uses subsurface color.")

if args.stop_error:
sys.exit(-1)

out_filename = os.path.join(args.output_directory, material_name + ".dmt")
print "Generating file: " + out_filename
print("Generating file: " + out_filename)

out_file = open(out_filename, "w")

Expand Down Expand Up @@ -133,3 +133,4 @@ def main():

if __name__ == "__main__":
main()

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
Expand Down Expand Up @@ -151,7 +150,7 @@ def build_project():
color_name = "color_" + key
# Add colors to the project.
assembly.colors().insert(asr.ColorEntity(color_name, {"color_space": "linear_rgb", "multiplier": 1.0}, light_colors[key]))
idx = light_colors.keys().index(key)
idx = list(light_colors.keys()).index(key)
light_name = "light_" + key
# Create the light.
light = asr.Light("max_omni_light", light_name, {
Expand Down Expand Up @@ -240,3 +239,4 @@ def main():

if __name__ == "__main__":
main()

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
Expand Down Expand Up @@ -26,7 +25,7 @@
# THE SOFTWARE.
#

from __future__ import print_function


import colorsys
import math
Expand Down Expand Up @@ -290,3 +289,4 @@ def main():

if __name__ == "__main__":
main()

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
Expand Down Expand Up @@ -26,7 +25,7 @@
# THE SOFTWARE.
#

from __future__ import print_function


import colorsys
import math
Expand Down Expand Up @@ -170,7 +169,7 @@ def build_project():
assembly.lights().insert(light)

elif color == "mix":
for i in xrange(0, grid_lights_count * grid_lights_count):
for i in range(0, grid_lights_count * grid_lights_count):
s = random.uniform(0, 1)
if s < 0.65:
ran = random.gauss(1, 0.01)
Expand Down Expand Up @@ -282,4 +281,4 @@ def main():
asr.ProjectFileWriter().write(project, output_scene_name + ".appleseed")

if __name__ == "__main__":
main()
main()
8 changes: 5 additions & 3 deletions scripts/Ubuntu_22.04_setup/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ set -e
#
# All variables beginning with `_` are internal variables and should NOT manually be changed, unless you know what you are doing!
#
# Note: This script has only been tested on Ubuntu 22.04!
# Note: This script has only been tested on Ubuntu 22.04 and 24.04!

# ================================================================
# Set Constants
Expand Down Expand Up @@ -50,8 +50,8 @@ WITH_BENCH=ON
WITH_CLIENT=ON
WITH_STUDIO=ON
WITH_TOOLS=ON
WITH_PYTHON2_BINDINGS=ON
WITH_PYTHON3_BINDINGS=OFF
WITH_PYTHON2_BINDINGS=OFF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does appleseed even support the Python2 bindings now? If not, the option should be completely removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appleseed should still build and work with Python 2 Bindings as before.

With the preprocessor I check

#if PY_MAJOR_VERSION == 2
    // Python 2 Compatible Code
#endif
#if PY_MAJOR_VERSION == 3
    // Python 3 Compatible Code
#endif

And in cmake I check for either WITH_PYTHON2_BINDINGS and WITH_PYTHON3_BINDINGS respectively.

I've tested this on Ubuntu 22 (where Python 2 is still supported).


So the bindings can still support Python 2. The Python scripts however only support Python 3.

WITH_PYTHON3_BINDINGS=ON
WITH_EMBREE=ON

# Download Links
Expand Down Expand Up @@ -1216,6 +1216,7 @@ if [[ $_sOCIOInstallDir = "" ]]; then
-DCMAKE_CXX_STANDARD=$_CXX_STD \
-DCMAKE_INSTALL_PREFIX=$_sInstallDir \
-DImath_ROOT=$_sImathInstallDir \
-DOpenEXR_ROOT=$_sOpenEXRInstallDir \
-DOCIO_BUILD_PYTHON=OFF
$DEBUG make install -j$(nproc)
fi
Expand Down Expand Up @@ -1253,6 +1254,7 @@ if [[ $_sOIIOInstallDir = "" ]]; then
pybind11-dev \
zlib1g \
zlib1g-dev \
libpng-dev \
libtiff5-dev

if [[ $WITH_PYTHON2_BINDINGS = ON ]]; then
Expand Down
5 changes: 2 additions & 3 deletions scripts/appleseed.benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,14 @@
# THE SOFTWARE.
#

from __future__ import print_function
import argparse
import datetime
import os
import re
import subprocess
import sys

from utils import print_runtime_details # local module
from .utils import print_runtime_details #local module


# -------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -98,7 +97,7 @@ def benchmark_project(project_path, appleseed_path, appleseed_args, logger):
command_line += ["--benchmark-mode"]
command_line += ["-o", os.path.join("renders", project_name + ".png")]

output = subprocess.check_output(command_line, stderr=subprocess.STDOUT)
output = subprocess.run(command_line, capture_output=True, text=True).stdout

if was_successful(output):
process_output(output, logger)
Expand Down
26 changes: 14 additions & 12 deletions scripts/appleseed.package.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# THE SOFTWARE.
#

from __future__ import print_function

from distutils import archive_util, dir_util
from xml.etree.ElementTree import ElementTree
import argparse
Expand All @@ -45,6 +45,7 @@
import time
import traceback
import zipfile
import shutil

from utils import print_runtime_details # local module

Expand All @@ -62,29 +63,29 @@
# Utility functions.
# -------------------------------------------------------------------------------------------------

GREEN_CHECKMARK = u"{0}\u2713{1}".format(colorama.Style.BRIGHT + colorama.Fore.GREEN, colorama.Style.RESET_ALL)
RED_CROSSMARK = u"{0}\u2717{1}".format(colorama.Style.BRIGHT + colorama.Fore.RED, colorama.Style.RESET_ALL)
GREEN_CHECKMARK = "{0}\u2713{1}".format(colorama.Style.BRIGHT + colorama.Fore.GREEN, colorama.Style.RESET_ALL)
RED_CROSSMARK = "{0}\u2717{1}".format(colorama.Style.BRIGHT + colorama.Fore.RED, colorama.Style.RESET_ALL)


def trace(message):
if VERBOSE:
print(u" {0}{1}{2}".format(colorama.Style.DIM + colorama.Fore.WHITE, message, colorama.Style.RESET_ALL))
print(" {0}{1}{2}".format(colorama.Style.DIM + colorama.Fore.WHITE, message, colorama.Style.RESET_ALL))


def info(message):
print(u" {0}".format(message))
print(" {0}".format(message))


def progress(message):
print(u" {0}...".format(message))
print(" {0}...".format(message))


def warning(message):
print(u" {0}Warning: {1}.{2}".format(colorama.Style.BRIGHT + colorama.Fore.MAGENTA, message, colorama.Style.RESET_ALL))
print(" {0}Warning: {1}.{2}".format(colorama.Style.BRIGHT + colorama.Fore.MAGENTA, message, colorama.Style.RESET_ALL))


def fatal(message):
print(u"{0}Fatal: {1}. Aborting.{2}".format(colorama.Style.BRIGHT + colorama.Fore.RED, message, colorama.Style.RESET_ALL))
print("{0}Fatal: {1}. Aborting.{2}".format(colorama.Style.BRIGHT + colorama.Fore.RED, message, colorama.Style.RESET_ALL))
if sys.exc_info()[0]:
print(traceback.format_exc())
sys.exit(1)
Expand Down Expand Up @@ -176,7 +177,7 @@ def merge_tree(src, dst, symlinks=False, ignore=None):
shutil.copy2(srcname, dstname)
# Catch the Error from the recursive copytree so that we can
# continue with other files.
except Error as ex:
except shutil.Error as ex:
errors.extend(ex.args[0])
except EnvironmentError as ex:
errors.append((srcname, dstname, str(ex)))
Expand All @@ -189,7 +190,7 @@ def merge_tree(src, dst, symlinks=False, ignore=None):
else:
errors.append((src, dst, str(ex)))
if errors:
raise Error(errors)
raise shutil.Error(errors)


# -------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -802,9 +803,9 @@ def get_dependencies_for_file(self, filepath, fix_paths=True, verbose=True):
trace(" Dependencies for file {0}:".format(filepath))
for lib in libs:
if os.path.isfile(lib):
trace(u" {0} {1}".format(GREEN_CHECKMARK, lib))
trace(" {0} {1}".format(GREEN_CHECKMARK, lib))
else:
trace(u" {0} {1}".format(RED_CROSSMARK, lib))
trace(" {0} {1}".format(RED_CROSSMARK, lib))

# Don't warn about missing dependencies if we didn't attempt to fix them.
if fix_paths:
Expand Down Expand Up @@ -1032,3 +1033,4 @@ def main():

if __name__ == "__main__":
main()

8 changes: 4 additions & 4 deletions scripts/cleanmany.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def walk(directory, recursive):
for filename in filenames:
yield os.path.join(dirpath, filename)
else:
dirpath, dirnames, filenames = os.walk(directory).next()
dirpath, dirnames, filenames = next(os.walk(directory))
for filename in filenames:
yield os.path.join(dirpath, filename)

Expand All @@ -64,7 +64,7 @@ def walk(directory, recursive):
# -------------------------------------------------------------------------------------------------

def clean_project_file(filepath, tool_path):
print("cleaning {0}...".format(filepath))
print(f"cleaning {filepath}...")
subprocess.call([tool_path, "clean", filepath])


Expand Down Expand Up @@ -104,13 +104,13 @@ def main():
if args.tool_path is None:
script_directory = os.path.dirname(os.path.realpath(__file__))
args.tool_path = os.path.join(script_directory, DEFAULT_TOOL_FILENAME)
print("setting tool path to {0}.".format(args.tool_path))
print(f"setting tool path to {args.tool_path}.")

start_time = datetime.datetime.now()
cleaned_file_count = clean_project_files(args.tool_path, args.directory, args.recursive)
end_time = datetime.datetime.now()

print("cleaned {0} project file(s) in {1}.".format(cleaned_file_count, end_time - start_time))
print(f"cleaned {cleaned_file_count} project file(s) in {end_time - start_time}.")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion scripts/convertmany.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def walk(directory, recursive):
for filename in filenames:
yield os.path.join(dirpath, filename)
else:
dirpath, dirnames, filenames = os.walk(directory).next()
dirpath, dirnames, filenames = next(os.walk(directory))
for filename in filenames:
yield os.path.join(dirpath, filename)

Expand Down
Loading
Loading