예제 #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;
        }
예제 #2
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;
        }