Code Monkey home page Code Monkey logo

animvrunitytoolkit's Introduction

header

AnimVR Unity Toolkit

This packages allows you to drag the .stage files you create with AnimVR into Unity3D and treat them like any other asset.

Main Features

  • Import complete stages, including animation, meshes, textures, cameras and sound.
  • Use the Unity Timeline API to playback animations, do scene transitions and integrate it with the rest of your game/movie.
  • Create new stages directly in the Unity Editor and open them in AnimVR. When you save, the changes are instantly visible in Unity.

Requirements

  • Unity 2017.3
  • AnimVR beta

Getting Started

  • Download the Unity Package here
  • Import it into your Unity project as described here
  • Right click in your Unity project panel and choose "Create -> AnimVR -> Stage" (you can also drag an exisiting stage into your project window).
  • Double click the created asset. The first time you do this you'll need to set up the application to open .stage files with. In Windows 10 this done by clicking "More Apps", scrolling all the way down and clicking "Look for another app on this PC". Look for the folder your copy of AnimVR is installed to and choose "ANIMVR.exe".
  • AnimVR will open and load the stage. Make any changes you want and save the file as usual. When you go back to Unity the asset will get reimported.
  • You can drag the imported asset into a stage like any other mesh or prefab. As long as the prefab instance is intact, changes to the stage will be reflected everywhere you are using the prefab.

Things to watch out for

  • Some features from AnimVR might not be suppoerted! Currently that is fading layers!
  • Currently we only support import on Windows platforms! We plan on supporting MacOS in the future and would love to hear from you if you urgently need MacOS support. Note that this only concerns importing stage files. You can still use the imported file on MacOS.
  • Stages with audio need to be imported twice the first time you import them. The import editor will show a "Fixup audio clips" button if that's the case. Just press it and you're good to go!

If you run into any problems, please open an issue in this repository!

Dario wrote a blog post on some of the technical considerations and implementation details on his website.


Documentation

Import Settings

Base Shader

Change this to set the Shader to use for all imported objects. The shader used should support vertex colors. Additionally, following properties are set by the importer:

  • _Color: The base diffuse color.
  • _SpecColor: The base specular color.
  • _EmissionColor: The base emission color.
  • _Unlit: Float that indicates if the mesh should be affected by lighting.
  • _Gamma: Gamma value, 1.0 when linear color space is selected in AnimVR, 2.2 otherwise.

Default Wrap Mode

The wrap mode of the created PlayableDirector.

Audio Import Setting

Set how to handle audio layers.

  • None: Don't import anything
  • Only Clips: Import sound files and create Unity audio clips
  • Clips and Tracks: Import files and also create timeline audio tracks (experimental)

Import Cameras

Whether or not to import camera layers.

animvrunitytoolkit's People

Contributors

daseyb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animvrunitytoolkit's Issues

How to slim down Build?

We've got a project with many minutes of AnimVR sequences imported, and when we go to build the project, we get errors because the one scene containing all of the animations is too large (serializes to 5+GB, Unity caps a single serializable file at 4GB). Do you have a recommended way to split animations into AssetBundles or some other way to load in such large files if they're all on the same timeline?

Multiple compilation errors on import

Hello,

I'm trying to import the AnimVR unity SDK along with some other asset packages, and am encountering multiple compilation issues. More specifically:

Assertion failed: Assertion failed on expression: 'm_CurrentEntriesPtr != NULL && m_IsGettingEntries' 0x00000001412F15D6 (Unity) StackWalker::GetCurrentCallstack 0x00000001412F214F (Unity) StackWalker::ShowCallstack 0x00000001411B11C0 (Unity) GetStacktrace 0x00000001406DA453 (Unity) DebugStringToFile 0x00000001406DAC31 (Unity) DebugStringToFile 0x000000014110E194 (Unity) EditorMonoConsole::GetEntryInternal 0x0000000141362C50 (Unity) LogEntries_CUSTOM_GetEntryInternal 0x0000000045C4BD4D (Mono JIT Code) (wrapper managed-to-native) UnityEditor.LogEntries:GetEntryInternal (int,UnityEditor.LogEntry) 0x0000000045C3F16F (Mono JIT Code) [ConsoleWindow.cs:676] UnityEditor.ConsoleWindow:OnGUI () 0x00000000029D7672 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr) 0x00007FF8E0B664AF ((<unknown>)) 0x00007FF8E0AB8A19 ((<unknown>)) 0x00007FF8E0ABEF27 ((<unknown>)) 0x00007FF8E0A7D34F ((<unknown>)) 0x00000000029A0AB7 (Mono JIT Code) (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) 0x000000000299EC12 (Mono JIT Code) [MonoMethod.cs:222] System.Reflection.MonoMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) 0x0000000002A5465F (Mono JIT Code) [MethodBase.cs:115] System.Reflection.MethodBase:Invoke (object,object[]) 0x0000000020F6EED5 (Mono JIT Code) [HostView.cs:295] UnityEditor.HostView:Invoke (string,object) 0x0000000020F6ED7A (Mono JIT Code) [HostView.cs:288] UnityEditor.HostView:Invoke (string) 0x00000000425D5C0E (Mono JIT Code) [HostView.cs:255] UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect) 0x00000000425C62D3 (Mono JIT Code) [DockArea.cs:387] UnityEditor.DockArea:OldOnGUI () 0x00000000425B1298 (Mono JIT Code) [IMGUIContainer.cs:179] UnityEngine.Experimental.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event) 0x00000000425B04C8 (Mono JIT Code) [IMGUIContainer.cs:333] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event) 0x0000000020F61DC8 (Mono JIT Code) [IMGUIContainer.cs:317] UnityEngine.Experimental.UIElements.IMGUIContainer:HandleEvent (UnityEngine.Experimental.UIElements.EventBase) 0x0000000020F5A09F (Mono JIT Code) [EventDispatcher.cs:459] UnityEngine.Experimental.UIElements.EventDispatcher:PropagateEvent (UnityEngine.Experimental.UIElements.EventBase) 0x0000000020F57B2A (Mono JIT Code) [EventDispatcher.cs:340] UnityEngine.Experimental.UIElements.EventDispatcher:DispatchEvent (UnityEngine.Experimental.UIElements.EventBase,UnityEngine.Experimental.UIElements.IPanel) 0x000000004258354F (Mono JIT Code) [UIElementsUtility.cs:251] UnityEngine.Experimental.UIElements.UIElementsUtility:DoDispatch (UnityEngine.Experimental.UIElements.BaseVisualElementPanel) 0x000000004258301B (Mono JIT Code) [UIElementsUtility.cs:78] UnityEngine.Experimental.UIElements.UIElementsUtility:ProcessEvent (int,intptr) 0x0000000042582B3D (Mono JIT Code) [GUIUtility.cs:175] UnityEngine.GUIUtility:ProcessEvent (int,intptr) 0x0000000042582CFE (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_bool_int_intptr (object,intptr,intptr,intptr) 0x00007FF8E0B664AF ((<unknown>)) 0x00007FF8E0AB8A19 ((<unknown>)) 0x0000000140A2EAEC (Unity) scripting_method_invoke 0x0000000140A2243A (Unity) ScriptingInvocation::Invoke 0x0000000140A234EA (Unity) ScriptingInvocation::Invoke<bool> 0x000000014028278E (Unity) IMGUIScriptingClasses::ProcessEvent 0x000000014112A2AF (Unity) GUIView::ProcessRetainedMode 0x00000001413F9748 (Unity) GUIView::OnInputEvent 0x000000014112A193 (Unity) GUIView::ProcessInputEvent 0x00000001413F1715 (Unity) GUIView::ProcessEventMessages 0x00000001413FB70A (Unity) GUIView::GUIViewWndProc 0x00007FF93247B85D (USER32) CallWindowProcW 0x00007FF93247B1EF (USER32) DispatchMessageW 0x000000014140EAB0 (Unity) MainMessageLoop 0x00000001414103B5 (Unity) WinMain 0x0000000141E643A8 (Unity) __tmainCRTStartup 0x00007FF932C61FE4 (KERNEL32) BaseThreadInitThunk 0x00007FF932D9EFC1 (ntdll) RtlUserThreadStart

ArgumentException: Value does not fall within the expected range. SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.LanguageOf (SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit unit) SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits (System.String method) SyntaxTree.VisualStudio.Unity.Bridge.CompilationUnit.CompilationUnits () SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder..ctor () SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolutionBuilder.CreateSolutionFromAssetDatabase () SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.GenerateProject () SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilePostprocessor.OnPreGeneratingCSProjectFiles () System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222) Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation. System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232) System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115) UnityEditor.AssetPostprocessingInternal.OnPreGeneratingCSProjectFiles () (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:61) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.Sync () (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:189) UnityEditor.VisualStudioIntegration.SolutionSynchronizer.SyncIfNeeded (IEnumerable1 affectedFiles) (at C:/buildslave/unity/build/Editor/Mono/VisualStudioIntegration/SolutionSynchronizer.cs:178)
UnityEditor.SyncVS.PostprocessSyncProject (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at C:/buildslave/unity/build/Editor/Mono/SyncProject.cs:177)
UnityEditor.AssetPostprocessingInternal.PostprocessAllAssets (System.String[] importedAssets, System.String[] addedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromPathAssets) (at C:/buildslave/unity/build/Editor/Mono/AssetPostprocessor.cs:31)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)`

Assets/MetaSDK/Meta/Reconstruction/Scripts/MetaReconstruction.cs(512,21): error CS1593: Delegate System.Threading.ParameterizedThreadStart' does not take 0' arguments

Assets/MetaSDK/Meta/Reconstruction/Scripts/MetaReconstruction.cs(532,62): error CS1061: Type MeshData' does not contain a definition for Name' and no extension method Name' of type MeshData' could be found. Are you missing an assembly reference?

There are two additional errors concerning missing definitions for "Vertices" and "Triangles" within the MeshData type.

The other asset packages included in the project are the MetaSDK by metavision as well as TiltBrush.

Any guidance would be appreciated here.

Thanks,

Unity 2018.2.0f2 bug + fix

Just upgraded our project to Unity 2018.2.0f2 and get an error that PlayableBinding is handled different.

In AnimVRFramesAsset.cs and AnimControlPlayableAsset.cs I changed the binding like so:

var binding = ScriptPlayableBinding.Create(this.name + " Parent", this, typeof(GameObject));
// var binding = new PlayableBinding();
// binding.streamType = DataStreamType.None;
// binding.sourceObject = this;
// binding.streamName = this.name + " Parent";
// binding.sourceBindingType = typeof(GameObject);
return new PlayableBinding[] { binding };

(In AnimControlPlayableAsset.cs "Parent" should be "Source" of course)

Toolkit compatibility / Stage import error

Hey guys,
congrats for releasing AnimVR also on Oculus!
What is your roadmap regarding the toolkit, which unity versions will be supported and how do you plan to update it with every new animVR or unity version?

right now it doesn't import stages in 2017.3 or 2018 with the latest animvr from the oculus store.

NullReferenceException: Object reference not set to an instance of an object AnimData.LoadFromFile (System.String filepath) (at Assets/AnimVR UnityImporter/Utils/AnimData.cs:3509) ANIMVR.AnimVRImporter.OnImportAsset (UnityEditor.Experimental.AssetImporters.AssetImportContext ctx) (at Assets/AnimVR UnityImporter/Editor/AnimVRImporter.cs:82) UnityEditor.Experimental.AssetImporters.ScriptedImporter.GenerateAssetData (ImportRequest request) (at C:/buildslave/unity/build/Editor/Mono/AssetPipeline/ScriptedImporter.cs:123)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.