Exemplo n.º 1
0
        public ComboGestureCompilerInternal(
            ComboGestureIntegrator integrator)
        {
            _animatorController = (AnimatorController)integrator.animatorController;
            _conflictPrevention = ConflictPrevention.OfIntegrator(integrator.writeDefaults);

            // FIXME: Incorrect pattern in use here, none of those are necessary
            _comboLayers                               = new List <GestureComboStageMapper>();
            _parameterGeneration                       = ParameterGeneration.Unique;
            _gesturePlayableLayerController            = null;
            _customEmptyClip                           = null;
            _analogBlinkingUpperThreshold              = 0f;
            _featuresToggles                           = 0;
            _conflictPreventionTempGestureLayer        = ConflictPrevention.OfFxLayer(WriteDefaultsRecommendationMode.UseUnsupportedWriteDefaultsOn);
            _compilerConflictFxLayerMode               = ConflictFxLayerMode.KeepBoth;
            _compilerIgnoreParamList                   = new AnimationClip();
            _compilerFallbackParamList                 = new AnimationClip();
            _avatarDescriptor                          = null;
            _expressionsAvatarMask                     = null;
            _logicalAvatarMask                         = null;
            _weightCorrectionAvatarMask                = null;
            _gesturePlayableLayerExpressionsAvatarMask = null;
            _gesturePlayableLayerTechnicalAvatarMask   = null;
            _integrateLimitedLipsync                   = false;
            _limitedLipsync                            = null;
            _assetContainer                            = null;
            _useGestureWeightCorrection                = false;
            _useSmoothing                              = _useGestureWeightCorrection;
        }
Exemplo n.º 2
0
        public CgeActivityEditorLipsync(ComboGestureLimitedLipsync limitedLipsync, Action onClipRenderedFn, CgeEditorEffector editorEffector, EeRenderingCommands renderingCommands)
        {
            _limitedLipsync    = limitedLipsync;
            _onClipRenderedFn  = onClipRenderedFn;
            _editorEffector    = editorEffector;
            _renderingCommands = renderingCommands;

            _visemePreviews = Enumerable.Range(0, 15)
                              .Select(i => new EeRenderingSample(
                                          new AnimationClip(),
                                          CgeMemoryQuery.NewPreviewTexture2D(LipsyncPreviewWidth, LipsyncPreviewHeight),
                                          OnClipRendered)
                                      )
                              .ToList();
        }
Exemplo n.º 3
0
        public ComboGestureCompilerInternal(
            ComboGestureCompiler compiler,
            AssetContainer assetContainer)
        {
            _comboLayers         = compiler.comboLayers;
            _parameterGeneration = _comboLayers.Count <= 1 ? ParameterGeneration.Unique : (compiler.parameterMode == ParameterMode.SingleInt ? ParameterGeneration.UserDefinedActivity : ParameterGeneration.VirtualActivity);
            switch (_parameterGeneration)
            {
            case ParameterGeneration.Unique:
                _activityStageName = null;
                break;

            case ParameterGeneration.UserDefinedActivity:
                _activityStageName = compiler.activityStageName;
                break;

            case ParameterGeneration.VirtualActivity:
                _activityStageName = SharedLayerUtils.HaiVirtualActivity;
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
            _animatorController             = (AnimatorController)compiler.animatorController;
            _gesturePlayableLayerController = compiler.gesturePlayableLayerController as AnimatorController;
            _customEmptyClip = compiler.customEmptyClip;
            _analogBlinkingUpperThreshold = compiler.analogBlinkingUpperThreshold;
            _featuresToggles = (compiler.doNotGenerateBlinkingOverrideLayer ? FeatureToggles.DoNotGenerateBlinkingOverrideLayer : 0)
                               | (compiler.doNotGenerateLipsyncOverrideLayer ? FeatureToggles.DoNotGenerateLipsyncOverrideLayer : 0)
                               | (compiler.doNotGenerateWeightCorrectionLayer ? FeatureToggles.DoNotGenerateWeightCorrectionLayer : 0)
                               | (compiler.doNotFixSingleKeyframes ? FeatureToggles.DoNotFixSingleKeyframes : 0);
            _conflictPrevention = ConflictPrevention.OfFxLayer(compiler.writeDefaultsRecommendationMode);
            _conflictPreventionTempGestureLayer = ConflictPrevention.OfGestureLayer(compiler.writeDefaultsRecommendationModeGesture, compiler.gestureLayerTransformCapture);
            _compilerConflictFxLayerMode        = compiler.conflictFxLayerMode;
            _compilerIgnoreParamList            = compiler.ignoreParamList;
            _compilerFallbackParamList          = compiler.fallbackParamList;
            _avatarDescriptor           = compiler.avatarDescriptor;
            _expressionsAvatarMask      = compiler.expressionsAvatarMask ? compiler.expressionsAvatarMask : AssetDatabase.LoadAssetAtPath <AvatarMask>(SharedLayerUtils.FxPlayableLayerAvatarMaskPath);
            _logicalAvatarMask          = compiler.logicalAvatarMask ? compiler.logicalAvatarMask : AssetDatabase.LoadAssetAtPath <AvatarMask>(SharedLayerUtils.FxPlayableLayerAvatarMaskPath);
            _weightCorrectionAvatarMask = compiler.weightCorrectionAvatarMask ? compiler.weightCorrectionAvatarMask : AssetDatabase.LoadAssetAtPath <AvatarMask>(SharedLayerUtils.FxPlayableLayerAvatarMaskPath);
            _gesturePlayableLayerExpressionsAvatarMask = compiler.gesturePlayableLayerExpressionsAvatarMask ? compiler.gesturePlayableLayerExpressionsAvatarMask : AssetDatabase.LoadAssetAtPath <AvatarMask>(GesturePlayableLayerAvatarMaskPath);
            _gesturePlayableLayerTechnicalAvatarMask   = compiler.gesturePlayableLayerTechnicalAvatarMask ? compiler.gesturePlayableLayerTechnicalAvatarMask : AssetDatabase.LoadAssetAtPath <AvatarMask>(GesturePlayableLayerAvatarMaskPath);
            _integrateLimitedLipsync    = false; // For now, Limited Lipsync is disabled regardless of the compiler value
            _limitedLipsync             = compiler.lipsyncForWideOpenMouth;
            _assetContainer             = assetContainer;
            _useGestureWeightCorrection = compiler.WillUseGestureWeightCorrection();
            _useSmoothing = _useGestureWeightCorrection;
        }
 public LayerForLipsyncOverrideView(float analogBlinkingUpperThreshold,
                                    AvatarMask logicalAvatarMask,
                                    AnimatorGenerator animatorGenerator,
                                    VRCAvatarDescriptor avatarDescriptor,
                                    ComboGestureLimitedLipsync limitedLipsync,
                                    AssetContainer assetContainer,
                                    AnimationClip emptyClip,
                                    List <ManifestBinding> manifestBindings,
                                    bool writeDefaults)
 {
     _analogBlinkingUpperThreshold = analogBlinkingUpperThreshold;
     _logicalAvatarMask            = logicalAvatarMask;
     _animatorGenerator            = animatorGenerator;
     _avatarDescriptor             = avatarDescriptor;
     _limitedLipsync   = limitedLipsync;
     _assetContainer   = assetContainer;
     _emptyClip        = emptyClip;
     _manifestBindings = manifestBindings;
     _writeDefaultsForLipsyncBlendshapes = writeDefaults;
 }
 public bool IsLimitedLipsyncSameAs(ComboGestureLimitedLipsync selectedLimitedLipsync)
 {
     return(_lipsyncState.LimitedLipsync == selectedLimitedLipsync);
 }
 public void SetLipsync(ComboGestureLimitedLipsync limitedLipsync, Action repaintCallback)
 {
     _lipsyncState.LimitedLipsync           = limitedLipsync;
     _lipsyncState.SerializedLimitedLipsync = new SerializedObject(limitedLipsync);
     _lipsyncState.Lipsync = new CgeActivityEditorLipsync(limitedLipsync, repaintCallback, _editorEffector, _renderingCommands);
 }