예제 #1
0
        void SetupComponentCapturer(CaptureNode node)
        {
            if (node.setup)
            {
                return;
            }

            int timeSamplingIndex = GetCurrentTimeSamplingIndex();
            var parent            = node.parent;

            node.transformCapturer                   = new TransformCapturer();
            node.transformCapturer.recorder          = this;
            node.transformCapturer.parent            = parent == null ? m_root : parent.transformCapturer;
            node.transformCapturer.timeSamplingIndex = timeSamplingIndex;
            node.transformCapturer.inherits          = true;
            node.transformCapturer.Setup(node.transform);

            if (node.componentType != null)
            {
                var component = node.transform.GetComponent(node.componentType);
                if (component != null)
                {
                    var cr = m_capturerTable[node.componentType];
                    node.componentCapturer                   = Activator.CreateInstance(cr.type) as ComponentCapturer;
                    node.componentCapturer.recorder          = this;
                    node.componentCapturer.parent            = node.transformCapturer;;
                    node.componentCapturer.timeSamplingIndex = timeSamplingIndex;
                    node.componentCapturer.Setup(component);
                }
            }

            node.setup = true;
        }
예제 #2
0
        CaptureNode ConstructTree(Transform trans)
        {
            if (trans == null)
            {
                return(null);
            }
            usdiLog("ConstructTree() : " + trans.name);

            // return existing one if found
            CaptureNode ret;

            if (m_captureNodes.TryGetValue(trans, out ret))
            {
                return(ret);
            }

            ret       = new CaptureNode();
            ret.trans = trans;
            m_captureNodes.Add(trans, ret);

            var parent = ConstructTree(trans.parent);

            if (parent != null)
            {
                ret.parent = parent;
                parent.children.Add(ret);
            }
            else
            {
                m_rootNodes.Add(ret);
            }

            return(ret);
        }
예제 #3
0
        CaptureNode ConstructTree(Transform node)
        {
            if (node == null)
            {
                return(null);
            }

            CaptureNode cn;

            if (m_capture_node.TryGetValue(node, out cn))
            {
                return(cn);
            }

            cn     = new CaptureNode();
            cn.obj = node;
            m_capture_node.Add(node, cn);

            var parent = ConstructTree(node.parent);

            if (parent != null)
            {
                parent.children.Add(cn);
            }
            else
            {
                m_top_nodes.Add(cn);
            }

            return(cn);
        }
예제 #4
0
        CaptureNode ConstructTree(Transform trans)
        {
            if (trans == null)
            {
                return(null);
            }
            usdiLog("ConstructTree() : " + trans.name);

            CaptureNode cn;

            if (m_capture_node.TryGetValue(trans, out cn))
            {
                return(cn);
            }

            cn       = new CaptureNode();
            cn.trans = trans;
            m_capture_node.Add(trans, cn);

            var parent = ConstructTree(trans.parent);

            if (parent != null)
            {
                parent.children.Add(cn);
            }
            else
            {
                m_top_nodes.Add(cn);
            }

            return(cn);
        }
예제 #5
0
파일: Regex.cs 프로젝트: akinomyoga/afh
 private bool IsMember(INode node)
 {
     if (this.name != null)
     {
         CaptureNode cnode = node as CaptureNode;
         return(cnode != null && cnode.Name == this.name);
     }
     else
     {
         return(node == this.node);
     }
 }
예제 #6
0
        void SetupComponentCapturer(CaptureNode parent, CaptureNode node)
        {
            usdiLog("SetupComponentCapturer() " + node.trans.name);

            node.parent = parent;
            var parent_capturer = parent == null ? m_root : parent.capturer;


            if (node.componentType == null)
            {
                node.capturer = new TransformCapturer(this, parent_capturer, node.trans);
            }
            else if (node.componentType == typeof(Transform))
            {
                node.capturer = new TransformCapturer(this, parent_capturer, node.trans.GetComponent <Transform>());
            }
            else if (node.componentType == typeof(Camera))
            {
                node.capturer = new CameraCapturer(this, parent_capturer, node.trans.GetComponent <Camera>());
            }
            else if (node.componentType == typeof(MeshRenderer))
            {
                node.capturer = new MeshCapturer(this, parent_capturer, node.trans.GetComponent <MeshRenderer>());
            }
            else if (node.componentType == typeof(SkinnedMeshRenderer))
            {
                node.capturer = new SkinnedMeshCapturer(this, parent_capturer, node.trans.GetComponent <SkinnedMeshRenderer>());
            }
            else if (node.componentType == typeof(ParticleSystem))
            {
                node.capturer = new ParticleCapturer(this, parent_capturer, node.trans.GetComponent <ParticleSystem>());
            }
            else if (node.componentType == typeof(usdiCustomComponentCapturer))
            {
                node.capturer = new CustomCapturerHandler(this, parent_capturer, node.trans.GetComponent <usdiCustomComponentCapturer>());
            }

            if (node.capturer != null)
            {
                m_capturers.Add(node.capturer);
            }

            foreach (var c in node.children)
            {
                SetupComponentCapturer(node, c);
            }
        }
예제 #7
0
        CaptureNode ConstructTree(Transform node)
        {
            if (node == null)
            {
                return(null);
            }

            int         iid = node.gameObject.GetInstanceID();
            CaptureNode cn;

            if (m_nodes.TryGetValue(iid, out cn))
            {
                return(cn);
            }

            cn            = new CaptureNode();
            cn.instanceID = iid;
            cn.transform  = node;
            cn.parent     = ConstructTree(node.parent);
            m_nodes.Add(iid, cn);
            m_newNodes.Add(cn);
            return(cn);
        }
예제 #8
0
        void SetupComponentCapturer(CaptureNode parent, CaptureNode node)
        {
            node.parent             = parent;
            node.transform          = CreateComponentCapturer(parent == null ? m_root : parent.transform, node.obj);
            node.transform.inherits = true;

            if (node.componentType == null)
            {
                // do nothing
            }
            else if (node.componentType == typeof(Camera))
            {
                node.transform.invertForward = true;
                node.component = CreateComponentCapturer(node.transform, node.obj.GetComponent <Camera>());
            }
            else if (node.componentType == typeof(MeshRenderer))
            {
                node.component = CreateComponentCapturer(node.transform, node.obj.GetComponent <MeshRenderer>());
            }
            else if (node.componentType == typeof(SkinnedMeshRenderer))
            {
                node.component = CreateComponentCapturer(node.transform, node.obj.GetComponent <SkinnedMeshRenderer>());
            }
            else if (node.componentType == typeof(ParticleSystem))
            {
                node.component = CreateComponentCapturer(node.transform, node.obj.GetComponent <ParticleSystem>());
            }
            else if (node.componentType == typeof(AlembicCustomComponentCapturer))
            {
                node.component = CreateComponentCapturer(node.transform, node.obj.GetComponent <AlembicCustomComponentCapturer>());
            }

            foreach (var c in node.children)
            {
                SetupComponentCapturer(node, c);
            }
        }
예제 #9
0
        void SetupComponentCapturer(CaptureNode node, AbcAPI.aeObject parent)
        {
            node.transform          = CreateComponentCapturer(node.obj, parent);
            node.transform.inherits = true;

            if (node.componentType == null)
            {
                // do nothing
            }
            else if (node.componentType == typeof(Camera))
            {
                node.transform.invertForward = true;
                node.component = CreateComponentCapturer(node.obj.GetComponent <Camera>(), node.transform.abc);
            }
            else if (node.componentType == typeof(MeshRenderer))
            {
                node.component = CreateComponentCapturer(node.obj.GetComponent <MeshRenderer>(), node.transform.abc);
            }
            else if (node.componentType == typeof(SkinnedMeshRenderer))
            {
                node.component = CreateComponentCapturer(node.obj.GetComponent <SkinnedMeshRenderer>(), node.transform.abc);
            }
            else if (node.componentType == typeof(ParticleSystem))
            {
                node.component = CreateComponentCapturer(node.obj.GetComponent <ParticleSystem>(), node.transform.abc);
            }
            else if (node.componentType == typeof(AlembicCustomComponentCapturer))
            {
                node.component = CreateComponentCapturer(node.obj.GetComponent <AlembicCustomComponentCapturer>(), node.transform.abc);
            }

            foreach (var c in node.children)
            {
                SetupComponentCapturer(c, node.transform.abc);
            }
        }
예제 #10
0
        void SetupComponentCapturer(CaptureNode parent, CaptureNode node)
        {
            usdiLog("SetupComponentCapturer() " + node.trans.name);

            node.parent = parent;
            var parent_capturer = parent == null ? m_root : parent.capturer;

            bool fallback = false;

            if (node.componentType == typeof(Camera))
            {
                node.capturer = new CameraCapturer(this, parent_capturer, node.trans.GetComponent <Camera>());
            }
            else if (node.componentType == typeof(MeshRenderer))
            {
                var renderer = node.trans.GetComponent <MeshRenderer>();
                if (MeshCapturer.canCapture(renderer))
                {
                    node.capturer = new MeshCapturer(this, parent_capturer, renderer);
                }
                else
                {
                    Debug.LogWarning("Mesh \"" + renderer.name + "\" is not readable and be skipped");
                    fallback = true;
                }
            }
            else if (node.componentType == typeof(SkinnedMeshRenderer))
            {
                var renderer = node.trans.GetComponent <SkinnedMeshRenderer>();
                if (SkinnedMeshCapturer.canCapture(renderer))
                {
                    node.capturer = new SkinnedMeshCapturer(this, parent_capturer, renderer);
                }
                else
                {
                    Debug.LogWarning("SkinnedMesh \"" + renderer.name + "\" is not readable and be skipped");
                    fallback = true;
                }
            }
            else if (node.componentType == typeof(ParticleSystem))
            {
                node.capturer = new ParticleCapturer(this, parent_capturer, node.trans.GetComponent <ParticleSystem>());
            }
            else if (node.componentType == typeof(UsdCustomComponentCapturer))
            {
                node.capturer = new CustomCapturerHandler(this, parent_capturer, node.trans.GetComponent <UsdCustomComponentCapturer>());
            }
            else
            {
                fallback = true;
            }

            if (fallback)
            {
                node.capturer = new TransformCapturer(this, parent_capturer, node.trans.GetComponent <Transform>());
            }

            if (node.capturer != null)
            {
                m_capturers.Add(node.capturer);
            }

            foreach (var c in node.children)
            {
                SetupComponentCapturer(node, c);
            }
        }
예제 #11
0
 public void setCaptureNode(CaptureNode node)
 {
     captureNode = node;
 }
예제 #12
0
 public void setCaptureNode(CaptureNode town)
 {
     captureNode = town;
 }