viromedia / virocore

ViroCore cross-platform AR/VR renderer
MIT License
364 stars 108 forks source link

ViroRenderer API for ViroCore? #317

Open marcspraragen opened 4 years ago

marcspraragen commented 4 years ago

Environment

Windows, ViroCore 1_16, Android Studio 3.4.1, Galaxy S8+ running Android 9.

Description

Request for information: Will ViroCore have an API to lower-level ViroRenderer methods?

Our wish list is: --Multiple-object, fine-tuned, synchronized animations, e.g. for linked skeletons or skeleton nodes from separate Object3Ds --Code-based / animation-state-linked interactivity as per Unity Animator, without having to manually jerry-rig it based on component position changes at various points during the animation duration.

Reproducible Demo

N/A

dthian commented 4 years ago

Hey @marcspraragen, currently ViroCore (and thus the renderer) is open source! :D

As such feel free to Fork, examine, and modify the code to expose lower-level renderer methods through the JNI layers into Java. To rebuild the renderer, there should be instructions on the github's main ReadMe page.

The above topics sounds pretty complex, a good place to start could be at VROSkeletalAnimationFrame or layered animations.

Feel free to reach out if you have any additional questions!

marcspraragen commented 4 years ago

Thanks!! I'll keep you posted.

marcspraragen commented 4 years ago

Hi @dthian, I have generated libviro-renderer.so library, and ndk app-glue files from the virocore/ViroRenderer git directory.

However, there was no readme referencing how to run it. Particularly, initializing VRORenderer requires VRORendererConfiguration and VROInputControllerBase arguments, neither of which classes I have seen before 5 minutes ago. Is there any guidance at all on how to use the native methods?

Thanks for your attention!

dthian commented 4 years ago

Hey @marcspraragen, to run the C++ examples in ViroCore, i think you'll need to just build the renderTest or nativeTest (i forgot which) target in Android studio. This should effectively build the whole thing and run it on your device successfully. (Don't forget to choose the build variants to target AR or VR or SceneView)

To enable the C++ examples, you would need to flip the kRunRenderTest flag: https://github.com/viromedia/virocore/blob/master/android/app/src/main/cpp/jni/VRORenderer_JNI.cpp#L62

After which, the testHarness in VROSample would be one place you can test out your new scene / code. Different types of c++ native test can be seen via VRORendererTestType.

marcspraragen commented 4 years ago

Awesome! I was going crazy trying to manually link everything with cmake!

marcspraragen commented 4 years ago

So close... There are some missing link errors going on during initial project build (see below). Any advice? This continued to happen after I cleaned project and invalidated caches / restarted Android Studio/

**Update: This set of errors may have something to do with compression library (libz / zlib.h) being linked out of order in CmakeLists.txt and/or Android.mk. I can't seem to find the fix if this is the case, though, and have reverted the makefiles to their original states.


org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':virocore:externalNativeBuildDebug'. at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:95) at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:91) at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:57) at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:119) at org.gradle.api.internal.tasks.execution.ResolvePreviousStateExecuter.execute(ResolvePreviousStateExecuter.java:43) at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:93) at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:45) at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:94) at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:56) at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:55) at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:67) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:315) at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:305) at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175) at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:101) at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36) at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:49) at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:43) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:355) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:343) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:336) at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:322) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:134) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker$1.execute(DefaultPlanExecutor.java:129) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:202) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:193) at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:129) at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63) at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55) at java.lang.Thread.run(Thread.java:748) Caused by: org.gradle.internal.UncheckedException: Build command failed. Error while executing process C:\Users\Marc\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build C:\Users\Marc\Documents\BlipdProjects\Repositories\virocore-cpp\android\virocore.externalNativeBuild\cmake\debug\arm64-v8a --target viro_renderer} [1/1] Linking CXX shared library C:\Users\Marc\Documents\BlipdProjects\Repositories\virocore-cpp\android\virocore\build\intermediates\cmake\debug\obj\arm64-v8a\libviro_renderer.so FAILED: cmd.exe /C "cd . && C:\Users\Marc\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --gcc-toolchain=C:/Users/Marc/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/Marc/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -std=c++14 -frtti -fexceptions -ftemplate-depth=1024 -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libviro_renderer.so -o C:\Users\Marc\Documents\BlipdProjects\Repositories\virocore-cpp\android\virocore\build\intermediates\cmake\debug\obj\arm64-v8a\libviro_renderer.so @CMakeFiles/viro_renderer.rsp && cd ." C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence_c.cpp.o): In function `cvOpenFileStorage':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence_c.cpp:149: undefined reference to `gzopen'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvPuts(CvFileStorage, char const)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:38: undefined reference to `gzputs'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvGets(CvFileStorage, char, int)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:79: undefined reference to `gzgets'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvEof(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:99: undefined reference to `gzeof'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvCloseFile(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:110: undefined reference to `gzclose'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvRewind(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:125: undefined reference to `gzrewind'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvCloseFile(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:110: undefined reference to `gzclose'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfPxr24Compressor.cpp.o): In function `Imf::Pxr24Compressor::compress(char const, int, Imath::Box<Imath::Vec2 >, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:399: undefined reference to `compress'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfPxr24Compressor.cpp.o): In function `Imf::Pxr24Compressor::uncompress(char const, int, Imath::Box<Imath::Vec2 >, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:426: undefined reference to `uncompress'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfZipCompressor.cpp.o): In function `Imf::ZipCompressor::compress(char const, int, int, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfZipCompressor.cpp:156: undefined reference to `compress'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfZipCompressor.cpp.o): In function `Imf::ZipCompressor::uncompress(char const, int, int, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfZipCompressor.cpp:189: undefined reference to `uncompress'

clang++: error: linker command failed with exit code 1 (use -v to see invocation)

ninja: build stopped: subcommand failed.

at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:67)
at org.gradle.internal.UncheckedException.throwAsUncheckedException(UncheckedException.java:41)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:76)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:48)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:41)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:28)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:704)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:671)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$2.run(ExecuteActionsTaskExecuter.java:284)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:301)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:293)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:175)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:273)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:258)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$200(ExecuteActionsTaskExecuter.java:67)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:145)
at org.gradle.internal.execution.impl.steps.ExecuteStep.execute(ExecuteStep.java:49)
at org.gradle.internal.execution.impl.steps.CancelExecutionStep.execute(CancelExecutionStep.java:34)
at org.gradle.internal.execution.impl.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:69)
at org.gradle.internal.execution.impl.steps.TimeoutStep.execute(TimeoutStep.java:49)
at org.gradle.internal.execution.impl.steps.CatchExceptionStep.execute(CatchExceptionStep.java:33)
at org.gradle.internal.execution.impl.steps.CreateOutputsStep.execute(CreateOutputsStep.java:50)
at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:43)
at org.gradle.internal.execution.impl.steps.SnapshotOutputStep.execute(SnapshotOutputStep.java:29)
at org.gradle.internal.execution.impl.steps.CacheStep.executeWithoutCache(CacheStep.java:134)
at org.gradle.internal.execution.impl.steps.CacheStep.lambda$execute$3(CacheStep.java:83)
at java.util.Optional.orElseGet(Optional.java:267)
at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:82)
at org.gradle.internal.execution.impl.steps.CacheStep.execute(CacheStep.java:36)
at org.gradle.internal.execution.impl.steps.PrepareCachingStep.execute(PrepareCachingStep.java:33)
at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:38)
at org.gradle.internal.execution.impl.steps.StoreSnapshotsStep.execute(StoreSnapshotsStep.java:23)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:96)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:89)
at java.util.Optional.map(Optional.java:215)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:52)
at org.gradle.internal.execution.impl.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:36)
at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:34)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:91)
... 35 more

Caused by: Build command failed. Error while executing process C:\Users\Marc\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build C:\Users\Marc\Documents\BlipdProjects\Repositories\virocore-cpp\android\virocore.externalNativeBuild\cmake\debug\arm64-v8a --target viro_renderer} [1/1] Linking CXX shared library C:\Users\Marc\Documents\BlipdProjects\Repositories\virocore-cpp\android\virocore\build\intermediates\cmake\debug\obj\arm64-v8a\libviro_renderer.so FAILED: cmd.exe /C "cd . && C:\Users\Marc\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=aarch64-none-linux-android21 --gcc-toolchain=C:/Users/Marc/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64 --sysroot=C:/Users/Marc/AppData/Local/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/sysroot -fPIC -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -std=c++14 -frtti -fexceptions -ftemplate-depth=1024 -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a -static-libstdc++ -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Qunused-arguments -Wl,-z,noexecstack -shared -Wl,-soname,libviro_renderer.so -o C:\Users\Marc\Documents\BlipdProjects\Repositories\virocore-cpp\android\virocore\build\intermediates\cmake\debug\obj\arm64-v8a\libviro_renderer.so @CMakeFiles/viro_renderer.rsp && cd ." C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence_c.cpp.o): In function `cvOpenFileStorage':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence_c.cpp:149: undefined reference to `gzopen'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvPuts(CvFileStorage, char const)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:38: undefined reference to `gzputs'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvGets(CvFileStorage, char, int)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:79: undefined reference to `gzgets'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvEof(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:99: undefined reference to `gzeof'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvCloseFile(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:110: undefined reference to `gzclose'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvRewind(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:125: undefined reference to `gzrewind'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libopencv_core.a(persistence.cpp.o): In function `icvCloseFile(CvFileStorage*)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../modules/core/src/persistence.cpp:110: undefined reference to `gzclose'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfPxr24Compressor.cpp.o): In function `Imf::Pxr24Compressor::compress(char const, int, Imath::Box<Imath::Vec2 >, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:399: undefined reference to `compress'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfPxr24Compressor.cpp.o): In function `Imf::Pxr24Compressor::uncompress(char const, int, Imath::Box<Imath::Vec2 >, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfPxr24Compressor.cpp:426: undefined reference to `uncompress'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfZipCompressor.cpp.o): In function `Imf::ZipCompressor::compress(char const, int, int, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfZipCompressor.cpp:156: undefined reference to `compress'

C:/Users/Marc/Documents/Repositories/virocore-cpp/android/app/../app/src/main/jniLibs/arm64-v8a/libIlmImf.a(ImfZipCompressor.cpp.o): In function `Imf::ZipCompressor::uncompress(char const, int, int, char const&)':

/Users/radvani/Source/ViroOpenCV/android/opencv-3.4.3/android_build/../3rdparty/openexr/IlmImf/ImfZipCompressor.cpp:189: undefined reference to `uncompress'

clang++: error: linker command failed with exit code 1 (use -v to see invocation)

ninja: build stopped: subcommand failed.

at com.android.build.gradle.internal.cxx.process.ProcessOutputJunction.execute(ProcessOutputJunction.kt:78)
at com.android.build.gradle.internal.cxx.process.ProcessOutputJunction.execute(ProcessOutputJunction.kt:119)
at com.android.build.gradle.tasks.ExternalNativeBuildTask.executeProcessBatch(ExternalNativeBuildTask.java:331)
at com.android.build.gradle.tasks.ExternalNativeBuildTask.buildImpl(ExternalNativeBuildTask.java:199)
at com.android.build.gradle.tasks.ExternalNativeBuildTask.build(ExternalNativeBuildTask.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
... 73 more
dthian commented 4 years ago

Hm, that should have worked. I can try building the render myself in the next few days and get back to you (I don't have access to an Android phone now).

I would advice doing a fresh checkout and building the nativeTest and/or renderTest onto your phone and see if that works or not.

marcspraragen commented 4 years ago

Hi Daniel--

Same result, unfortunately-- I can't build the project at all, because of opencv vs. zip library link errors

I also tried reinstalling NDK (20.0.5594570), not side-by-side version.

Target SDK of project: 28, with platform tools 29.0.1

Gradle distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

marcspraragen commented 4 years ago

Happy to report that I fixed the linking error. It was a simple change in the CMakeLists.txt file for app (viroreact) module: link the lib-z library last(!)

Also attached is modified build.gradle for app module, as I needed to upgrade its exoplayer version to get it to compile. Build successful!

CMakeLists.txt

build.gradle.txt

marcspraragen commented 4 years ago

The FBX renderer-based fine-grained skeletal changes in nativetest are working fine!

marcspraragen commented 4 years ago

A question about the 3D models generated (and manipulated) in native c++ : how can I reference them directly in Kotlin/Java?

There doesn't seem to be a Scene (AR or otherwise) instantiated in the ViroViewARCore packaged with "nativetest" app module.

dthian commented 4 years ago

Hey @marcspraragen, native C++ components in Viro are often exposed to Java via the JNI layer.

For example, a VRONode, is exposed via Node_JNI.cpp (through JNI) and then accessed in java via Node.java

Likewise for 3d models, we have the Object_JNI.cpp that exposes the native loading of models to Object3D.java in java.

marcspraragen commented 4 years ago

Awesome. I'm thinking that will also help me set skeletal animation speeds in Java in real time (using animation transactions), which as far as I know is currently only available at c++ level.

dthian commented 4 years ago

Cool, I would recommend taking a look at our animation components here. Also take a look at how Object3D.java components are used here in our tests.

Looking at these, i believe it's already possible to set variable animation speeds for skeletal animations in Java in real time.