Skip to content

Commit

Permalink
Add SwiftUSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
furby-tm committed Oct 16, 2023
1 parent f810a50 commit 373459e
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 108 deletions.
26 changes: 23 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# This configuration was taken directly from the Blender project.
# You can learn more about Blender here: www.blender.org

# CREDITS: Blender, the free and open source 3D creation suite.
# Copyright (C) 2023 Blender Foundation.

# The warnings below are disabled because they are too pedantic and not worth fixing.
# Some of them will be enabled as part of the Clang-Tidy task, see T78535.

# NOTE: No comments in the list below is allowed. Clang-tidy will ignore items after comments in the lists flag list.
# This is because the comment is not a valid list item and it will stop parsing flags if a list item is a comment.
Checks: >
-*,
readability-*,
Expand All @@ -12,28 +20,40 @@ Checks: >
-readability-avoid-const-params-in-decls,
-readability-simplify-boolean-expr,
-readability-make-member-function-const,
-readability-suspicious-call-argument,
-readability-redundant-member-init,
-readability-misleading-indentation,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-function-cognitive-complexity,
bugprone-*,
-bugprone-narrowing-conversions,
-bugprone-unhandled-self-assignment,
-bugprone-branch-clone,
-bugprone-macro-parentheses,
-bugprone-reserved-identifier,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-sizeof-expression,
-bugprone-integer-division,
-bugprone-redundant-branch-condition,
-bugprone-suspicious-include,
modernize-*,
-modernize-use-auto,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
-modernize-use-nodiscard,
-modernize-loop-convert,
-modernize-pass-by-value,
# Cannot be enabled yet, because using raw string literals in tests breaks
# the windows compiler currently.
-modernize-raw-string-literal
-modernize-raw-string-literal,
-modernize-return-braced-init-list
CheckOptions:
- key: modernize-use-default-member-init.UseAssignment
value: 1
14 changes: 14 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"pins" : [
{
"identity" : "swiftusd",
"kind" : "remoteSourceControl",
"location" : "https://github.com/wabiverse/SwiftUSD.git",
"state" : {
"branch" : "main",
"revision" : "786f2d9ca8975410ce8a76cf2d95bf0cec000967"
}
}
],
"version" : 2
}
123 changes: 19 additions & 104 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,120 +1,35 @@
// swift-tools-version: 5.9
import PackageDescription

#if DEBUG
let pixarHeadersPath = "../build_darwin_debug/bin/include"
#else
let pixarHeadersPath = "../build_darwin_release/bin/include"
#endif

// ----------------------------------------------------------
// :: : 💫 The Animation Foundation : ::
// ----------------------------------------------------------
// -------------------------------------------------------------------------
// :: : 💫 The Open Source Metaverse : ::
// -------------------------------------------------------------------------
let package = Package(
name: "AnimationFoundation",
name: "Metaverse",

// --- 📦 Package Products. ---
products: [
.library(name: "PixarUSD",
targets: ["PixarUSD"]),
.executable(
name: "Kraken",
targets: ["Kraken"]
),
],

.executable(name: "Kraken",
targets: ["Kraken"]),
// --- 🦄 Package Dependencies. ---
dependencies: [
.package(url: "https://github.com/wabiverse/SwiftUSD.git", branch: "main"),
],

// --- 🎯 Package Targets. ---
targets: [
// -----------------------------------------------------------
// :: : 🦄 Pixar - Universal Scene Description(USD) : ::
// -----------------------------------------------------------
.target(name: "PixarUSD",
path: ".",
exclude: [
"./.build",
"./.github",
"./.vscode",
"./build_files",
"./doc",
"./extern",
"./intern",
"./release",
"./source",
"./test",
"./Tests",
"./wabi/base/js/rapidjson/msinttypes",
"./wabi/base/gf/range.template.cpp",
"./wabi/base/gf/matrix.template.cpp",
"./wabi/base/gf/matrix2.template.cpp",
"./wabi/base/gf/matrix3.template.cpp",
"./wabi/base/gf/matrix4.template.cpp",
"./wabi/base/gf/wrapMatrix.template.cpp",
"./wabi/base/gf/wrapMatrix2.template.cpp",
"./wabi/base/gf/wrapMatrix3.template.cpp",
"./wabi/base/gf/wrapMatrix4.template.cpp",
"./wabi/base/gf/vec.template.cpp",
],
publicHeadersPath: "wabi",
cxxSettings: [
.unsafeFlags([
"-I\(pixarHeadersPath)",
"-I../lib/apple_darwin_arm64/python/include/python3.10",
"-I/opt/homebrew/include"
]),
.define("WITH_PYTHON", to: "1"),
.define("WITH_METAL", to: "1"),
.define("WITH_USD", to: "1"),
.define("WITH_TBB", to: "1"),
.define("WITH_BOOST", to: "1"),
.define("WITH_PIXAR_USDVIEW", to: "1")
],
swiftSettings: [
.interoperabilityMode(.Cxx),
.unsafeFlags([
"-I\(pixarHeadersPath)",
"-I../lib/apple_darwin_arm64/python/include/python3.10",
"-I/opt/homebrew/include"
]),
.define("WITH_PYTHON"),
.define("WITH_METAL"),
.define("WITH_USD"),
.define("WITH_TBB"),
.define("WITH_BOOST"),
.define("WITH_PIXAR_USDVIEW")
]),

// ---------------------------------------------------------
// :: : 🐙 Kraken - The Animation Platform Suite. : ::
// ---------------------------------------------------------
.executableTarget(name: "Kraken",
path: "source/creator",
cxxSettings: [
.unsafeFlags([
"-I\(pixarHeadersPath)",
"-I../lib/apple_darwin_arm64/python/include/python3.10",
"-I/opt/homebrew/include",
]),
.define("WITH_PYTHON", to: "1"),
.define("WITH_METAL", to: "1"),
.define("WITH_USD", to: "1"),
.define("WITH_TBB", to: "1"),
.define("WITH_BOOST", to: "1"),
.define("WITH_PIXAR_USDVIEW", to: "1"),
],
swiftSettings: [
.interoperabilityMode(.Cxx),
.unsafeFlags([
"-I\(pixarHeadersPath)",
"-I../lib/apple_darwin_arm64/python/include/python3.10",
"-I/opt/homebrew/include",
]),
.define("WITH_PYTHON"),
.define("WITH_METAL"),
.define("WITH_USD"),
.define("WITH_TBB"),
.define("WITH_BOOST"),
.define("WITH_PIXAR_USDVIEW"),
]),
],
cLanguageStandard: .c90,
cxxLanguageStandard: .cxx20
.executableTarget(
name: "Kraken",
dependencies: [
.product(name: "USD", package: "SwiftUSD"),
]
),
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* -------------------------------------------------------------- */

import Foundation
import PixarUSD
import USD

/* -------------------------------------------------------------------- */
/*
Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions build_files/build_environment/KrakenDeveloperProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,31 @@ function CreateKrakenAppIcons
Pop-Location
}

function CreateAppICNSFromSVG
{
$build_icns_svg = $Args[0]

if ($IsMacOS) {
$build_icns_dir = $build_icns_svg.split('.svg')[0] + '.iconset'

New-Item -ItemType Directory -Path $build_icns_dir -Force

&inkscape -z --export-filename="$build_icns_dir/icon_16x16.png" -w 16 -h 16 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_16x16@2x.png" -w 32 -h 32 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_32x32.png" -w 32 -h 32 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_32x32@2x.png" -w 64 -h 64 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_128x128.png" -w 128 -h 128 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_128x128@2x.png" -w 256 -h 256 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_256x256.png" -w 256 -h 256 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_256x256@2x.png" -w 512 -h 512 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_512x512.png" -w 512 -h 512 "$build_icns_svg"
&inkscape -z --export-filename="$build_icns_dir/icon_512x512@2x.png" -w 1024 -h 1024 "$build_icns_svg"
iconutil -c icns "$build_icns_dir"

Write-Color -Text "Icons Generated: The iconset is located at: $build_icns_dir" -Color Green
}
}

function ReloadDeveloperProfile {
. $PROFILE
}
Expand Down Expand Up @@ -709,6 +734,7 @@ Set-Alias dbgkrkn RunAndDebugKraken

# Generate Kraken App Icons.
Set-Alias genicons CreateKrakenAppIcons
Set-Alias iconmake CreateAppICNSFromSVG

# Run Kraken
Set-Alias kraken RunDevelopmentReleaseKraken
Expand Down

0 comments on commit 373459e

Please sign in to comment.