mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Fix Android example app build.
Add VS solution gen batch file with Python.
This commit is contained in:
@@ -28,6 +28,7 @@ android {
|
|||||||
//version "3.18.1"
|
//version "3.18.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
namespace 'com.example.hellotinyusdz'
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
package="com.example.hellotinyusdz">
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ option(TINYUSDZ_USE_USDOBJ "Build with built-in .obj support" On)
|
|||||||
|
|
||||||
set(TINYUSDZ_SOURCES
|
set(TINYUSDZ_SOURCES
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/tinyusdz.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/tinyusdz.cc
|
||||||
|
${PROJECT_SOURCE_DIR}/../../../../../src/asset-resolution.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/prim-types.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/prim-types.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/ascii-parser.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/ascii-parser.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/ascii-parser-basetype.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/ascii-parser-basetype.cc
|
||||||
@@ -28,9 +29,15 @@ set(TINYUSDZ_SOURCES
|
|||||||
${PROJECT_SOURCE_DIR}/../../../../../src/usdGeom.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/usdGeom.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/xform.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/xform.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/stage.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/stage.cc
|
||||||
|
${PROJECT_SOURCE_DIR}/../../../../../src/str-util.cc
|
||||||
|
${PROJECT_SOURCE_DIR}/../../../../../src/path-util.cc
|
||||||
|
${PROJECT_SOURCE_DIR}/../../../../../src/image-util.cc
|
||||||
|
${PROJECT_SOURCE_DIR}/../../../../../src/image-writer.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/linear-algebra.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/linear-algebra.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/tydra/scene-access.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/tydra/scene-access.cc
|
||||||
${PROJECT_SOURCE_DIR}/../../../../../src/tydra/render-data.cc
|
${PROJECT_SOURCE_DIR}/../../../../../src/tydra/render-data.cc
|
||||||
|
${PROJECT_SOURCE_DIR}/../../../../../src/tydra/prim-apply.cc
|
||||||
|
${PROJECT_SOURCE_DIR}/../../../../../src/tydra/shader-network.cc
|
||||||
)
|
)
|
||||||
|
|
||||||
if (TINYUSDZ_USE_USDOBJ)
|
if (TINYUSDZ_USE_USDOBJ)
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.3.40'
|
ext.kotlin_version = '1.6.21'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:7.0.0'
|
classpath 'com.android.tools.build:gradle:8.0.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
|
|||||||
@@ -16,4 +16,7 @@ org.gradle.jvmargs=-Xmx1536m
|
|||||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
# org.gradle.parallel=true
|
# org.gradle.parallel=true
|
||||||
|
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
|
android.defaults.buildfeatures.buildconfig=true
|
||||||
|
android.nonTransitiveRClass=false
|
||||||
|
android.nonFinalResIds=false
|
||||||
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
|
||||||
|
|||||||
@@ -1127,7 +1127,7 @@ static par_shapes__rule* par_shapes__pick_rule(const char* name,
|
|||||||
total += rule->weight;
|
total += rule->weight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
float r = (float) rand() / RAND_MAX;
|
float r = (float) rand() / float(RAND_MAX);
|
||||||
float t = 0;
|
float t = 0;
|
||||||
for (int i = 0; i < nrules; i++) {
|
for (int i = 0; i < nrules; i++) {
|
||||||
rule = rules + i;
|
rule = rules + i;
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ bool FileExists(const std::string &filepath, void *userdata) {
|
|||||||
bool ret{false};
|
bool ret{false};
|
||||||
#ifdef TINYUSDZ_ANDROID_LOAD_FROM_ASSETS
|
#ifdef TINYUSDZ_ANDROID_LOAD_FROM_ASSETS
|
||||||
if (asset_manager) {
|
if (asset_manager) {
|
||||||
AAsset *asset = AAssetManager_open(asset_manager, abs_filename.c_str(),
|
AAsset *asset = AAssetManager_open(asset_manager, filepath.c_str(),
|
||||||
AASSET_MODE_STREAMING);
|
AASSET_MODE_STREAMING);
|
||||||
if (!asset) {
|
if (!asset) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1,15 +1,17 @@
|
|||||||
rem assume
|
rem assume
|
||||||
|
|
||||||
rmdir /s /q build
|
rmdir /s /q build_with_py
|
||||||
mkdir build
|
mkdir build_with_py
|
||||||
|
|
||||||
rem Specify absolute python.exe path if required.
|
rem Specify absolute python.exe path if required.
|
||||||
rem Use `whre python` to find abosolute path to python.exe in cmd
|
rem Use `whre python` to find abosolute path to python.exe in cmd
|
||||||
|
rem Conda/Miniconda installed Python recommended.
|
||||||
|
rem
|
||||||
|
rem -DPython3_EXECUTABLE=C:\Users\%%HOME%%\miniconda3\envs\pytinyusdz\python.exe ^
|
||||||
|
|
||||||
cmake -G "Visual Studio 17 2022" -A x64 ^
|
cmake -G "Visual Studio 17 2022" -A x64 ^
|
||||||
-DTINYUSDZ_WITH_OPENSUBDIV=On ^
|
-DTINYUSDZ_WITH_OPENSUBDIV=On ^
|
||||||
-DTINYUSDZ_WITH_PYTHON=1 ^
|
-DTINYUSDZ_WITH_PYTHON=1 ^
|
||||||
-DTINYUSDZ_PREFER_LOCAL_PYTHON_INSTALLATION=1 ^
|
-DTINYUSDZ_PREFER_LOCAL_PYTHON_INSTALLATION=1 ^
|
||||||
-DPython3_EXECUTABLE=C:\Users\%%HOME%%\miniconda3\envs\pytinyusdz\python.exe
|
-Bbuild_with_py -S.
|
||||||
-Bbuild -S.
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user