Example #1
0
        public bool makeAnimalJoints(GeListNode node, DescriptionCommand desc)
        {
            CharakterAnimal Main = new CharakterAnimal(node, desc);

            this.wtagGlob = Main.getwtagJoint();
            return(true);
        }
Example #2
0
        public virtual BaseDocument GetDocument(GeListNode node)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.NodeData_GetDocument(swigCPtr, GeListNode.getCPtr(node));
            BaseDocument          ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseDocument(cPtr, false);

            return(ret);
        }
Example #3
0
        public GeListNode Get()
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.NodeData_Get(swigCPtr);
            GeListNode            ret  = (cPtr == global::System.IntPtr.Zero) ? null : new GeListNode(cPtr, false);

            return(ret);
        }
Example #4
0
        public static BaseContainer GetDataInstance(GeListNode node)
        {
            global::System.IntPtr cPtr = C4dApiPINVOKE.TagDataM_GetDataInstance__SWIG_1(GeListNode.getCPtr(node));
            BaseContainer         ret  = (cPtr == global::System.IntPtr.Zero) ? null : new BaseContainer(cPtr, false);

            return(ret);
        }
Example #5
0
        public override bool GetDDescription(GeListNode node, DDescriptionParams descparams)
        {
            if (!descparams.Desc.LoadDescription("tbase"))
            {
                return(false);
            }

            VisitProps(delegate(int itemID, string itemName, PropertyInfo pi)
            {
                DescID cid       = new DescID(new DescLevel(itemID, C4dApi.DTYPE_LONG, 0));
                BaseContainer bc = null;
                if (pi.PropertyType == typeof(int))
                {
                    bc = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);
                }
                else if (pi.PropertyType == typeof(string))
                {
                    bc = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_STRING);
                }
                bc.SetString(C4dApi.DESC_NAME, itemName);
                descparams.Desc.SetParameter(cid, bc, new DescID(new DescLevel(C4dApi.ID_TAGPROPERTIES)));
            });

            descparams.Flags |= DESCFLAGS_DESC.DESCFLAGS_DESC_LOADED;

            return(true); // base.GetDDescription(node, descparams);
        }
Example #6
0
 public virtual void GetBubbleHelp(GeListNode node, SWIGTYPE_p_String str)
 {
     C4dApiPINVOKE.NodeData_GetBubbleHelp(swigCPtr, GeListNode.getCPtr(node), SWIGTYPE_p_String.getCPtr(str));
     if (C4dApiPINVOKE.SWIGPendingException.Pending)
     {
         throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Example #7
0
        public override bool Init(GeListNode node)
        {
            Thread thread = new Thread(CheckForNewVersion);

            thread.Start();

            return(true);
        }
Example #8
0
        public override bool Init(GeListNode node)
        {
            BaseContainer data = GetDataInstance(node);

            data.SetInt32(GENERAL_TAG_THEINT, TheInt);
            data.SetString(GENERAL_TAG_THENAME, TheName);

            return(true);
        }
Example #9
0
        public virtual bool SetDParameter(GeListNode node, DescID id, GeData t_data, SWIGTYPE_p_DESCFLAGS_SET flags)
        {
            bool ret = C4dApiPINVOKE.NodeData_SetDParameter(swigCPtr, GeListNode.getCPtr(node), DescID.getCPtr(id), GeData.getCPtr(t_data), SWIGTYPE_p_DESCFLAGS_SET.getCPtr(flags));

            if (C4dApiPINVOKE.SWIGPendingException.Pending)
            {
                throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #10
0
        public virtual bool GetDEnabling(GeListNode node, DescID id, GeData t_data, DESCFLAGS_ENABLE flags, BaseContainer itemdesc)
        {
            bool ret = C4dApiPINVOKE.NodeData_GetDEnabling(swigCPtr, GeListNode.getCPtr(node), DescID.getCPtr(id), GeData.getCPtr(t_data), (int)flags, BaseContainer.getCPtr(itemdesc));

            if (C4dApiPINVOKE.SWIGPendingException.Pending)
            {
                throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #11
0
        public virtual bool TranslateDescID(GeListNode node, DescID id, DescID res_id, SWIGTYPE_p_p_C4DAtom res_at)
        {
            bool ret = C4dApiPINVOKE.NodeData_TranslateDescID(swigCPtr, GeListNode.getCPtr(node), DescID.getCPtr(id), DescID.getCPtr(res_id), SWIGTYPE_p_p_C4DAtom.getCPtr(res_at));

            if (C4dApiPINVOKE.SWIGPendingException.Pending)
            {
                throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #12
0
        public virtual bool IsDocumentRelated(GeListNode node, SWIGTYPE_p_Bool docrelated)
        {
            bool ret = C4dApiPINVOKE.NodeData_IsDocumentRelated(swigCPtr, GeListNode.getCPtr(node), SWIGTYPE_p_Bool.getCPtr(docrelated));

            if (C4dApiPINVOKE.SWIGPendingException.Pending)
            {
                throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #13
0
        public override bool GetDDescription(GeListNode node, Description description, SWIGTYPE_p_DESCFLAGS_DESC flags)
        {
            bool ret = (SwigDerivedClassHasMethod("GetDDescription", swigMethodTypes10) ? C4dApiPINVOKE.TagDataM_GetDDescriptionSwigExplicitTagDataM__SWIG_0(swigCPtr, GeListNode.getCPtr(node), Description.getCPtr(description), SWIGTYPE_p_DESCFLAGS_DESC.getCPtr(flags)) : C4dApiPINVOKE.TagDataM_GetDDescription__SWIG_0(swigCPtr, GeListNode.getCPtr(node), Description.getCPtr(description), SWIGTYPE_p_DESCFLAGS_DESC.getCPtr(flags)));

            if (C4dApiPINVOKE.SWIGPendingException.Pending)
            {
                throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #14
0
        public virtual bool GetDDescription(GeListNode node, Description description, SWIGTYPE_p_DESCFLAGS_DESC flags)
        {
            bool ret = C4dApiPINVOKE.NodeData_GetDDescription(swigCPtr, GeListNode.getCPtr(node), Description.getCPtr(description), SWIGTYPE_p_DESCFLAGS_DESC.getCPtr(flags));

            if (C4dApiPINVOKE.SWIGPendingException.Pending)
            {
                throw C4dApiPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
Example #15
0
        public override bool Init(GeListNode node)
        {
            BaseContainer data = GetDataInstance(node);

            data.SetFloat(CIRCLEOBJECT_RAD, 200.0);
            data.SetInt32(C4dApi.PRIM_PLANE, 0);
            data.SetBool(C4dApi.PRIM_REVERSE, false);
            data.SetInt32(C4dApi.SPLINEOBJECT_INTERPOLATION, C4dApi.SPLINEOBJECT_INTERPOLATION_ADAPTIVE);
            data.SetInt32(C4dApi.SPLINEOBJECT_SUB, 8);
            data.SetFloat(C4dApi.SPLINEOBJECT_ANGLE, 5.0 * Math.PI / 180.0);
            data.SetFloat(C4dApi.SPLINEOBJECT_MAXIMUMLENGTH, 5.0);

            return(true);
        }
Example #16
0
        public override bool Init(GeListNode node)
        {
            BaseContainer data = GetDataInstance(node);

            VisitProps(delegate(int itemID, string itemName, PropertyInfo pi)
            {
                if (pi.PropertyType == typeof(int))
                {
                    data.SetInt32(itemID, (int)pi.GetValue(this, null));
                }
                else if (pi.PropertyType == typeof(string))
                {
                    data.SetString(itemID, (string)pi.GetValue(this, null));
                }
            });

            return(true);
        }
Example #17
0
        /*
         * public override bool GetDEnabling(GeListNode node, DescID id, GeData t_data,DESCFLAGS_ENABLE flags, BaseContainer itemdesc)
         * {
         *  int inter;
         *  BaseContainer data = ((BaseObject)node).GetDataInstance();
         *  switch (id[0].id)
         *  {
         *      case SPLINEOBJECT_SUB:
         *              inter=data.GetInt32(SPLINEOBJECT_INTERPOLATION);
         *              return inter==SPLINEOBJECT_INTERPOLATION_NATURAL || inter==SPLINEOBJECT_INTERPOLATION_UNIFORM;
         *
         *      case SPLINEOBJECT_ANGLE:
         *              inter = data.GetInt32(SPLINEOBJECT_INTERPOLATION);
         *              return inter==SPLINEOBJECT_INTERPOLATION_ADAPTIVE || inter==SPLINEOBJECT_INTERPOLATION_SUBDIV;
         *
         *      case SPLINEOBJECT_MAXIMUMLENGTH:
         *              return data.GetInt32(SPLINEOBJECT_INTERPOLATION)==SPLINEOBJECT_INTERPOLATION_SUBDIV;
         *  }
         *  return true;
         * }
         */
        public override bool GetDDescription(GeListNode node, DDescriptionParams descparams)
        {
            // The main part of this code is taken from the "LookAtCamera.cpp" file from the original C4D API samples.
            // Be aware that the original LookAtCamera is not an object created from the Plugin menu but a
            // Tag type that can be added to existing objects from the "Objekte" context (right mouse button) menu under
            // the "Cinema4dsdk Tags" sub menu.

            // TODO: whatever this might be good for: if (!singleid || cid.IsPartOf(*singleid, NULL)) // important to check for speedup c4d!
            // {


            // This will load the main object attribute tabs ("Basis", "Koord", "Objekt")
            if (!descparams.Desc.LoadDescription("obase"))
            {
                return(false);
            }

            //////////////////////////////////////////////////////////////////////////////////////
            // Create a double value named radius on the "Objekt" tab's main level
            DescID        cid      = new DescID(new DescLevel(CIRCLEOBJECT_RAD, C4dApi.DTYPE_LONG, 0));   // The ID of the radius value (CIRCLEOBJECT_RAD)
            BaseContainer bcRadius = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_REAL);                  // The type of the radius value (REAL)

            bcRadius.SetString(C4dApi.DESC_NAME, "Radius");                                               // The user interface name (Radius)
            bcRadius.SetInt32(C4dApi.DESC_DEFAULT, 44);                                                   // The default value (44, but overridden to 200 in the Init method)
            // Create the new radius value as a child of the "Objekt" Tab (ID_OBJECTPROPERTIES)
            if (!descparams.Desc.SetParameter(cid, bcRadius, new DescID(new DescLevel(C4dApi.ID_OBJECTPROPERTIES))))
            {
                return(true);
            }


            /////////////////////////////////////////////////////////////////////////////////////
            // Create an entirely new Tab (called "Ein schöner Tab")
            cid = new DescID(new DescLevel(CIRCLEOBJECT_NEWTAB, C4dApi.DTYPE_GROUP, 0));
            BaseContainer bcMaingroup = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_GROUP);

            bcMaingroup.SetString(C4dApi.DESC_NAME, "Ein schöner Tab");
            // Create the new Group on the top level (DecLevel(0))
            if (!descparams.Desc.SetParameter(cid, bcMaingroup, new DescID(new DescLevel(0))))
            {
                return(true);
            }

            /////////////////////////////////////////////////////////////////////////////////////
            // Create an new sub group (called "Hübsches Grüppchen")
            cid = new DescID(new DescLevel(CIRCLEOBJECT_SUBGROUP, C4dApi.DTYPE_GROUP, 0));
            BaseContainer bcSubgroup = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_GROUP);

            bcSubgroup.SetString(C4dApi.DESC_NAME, "Hübsches Grüppchen");
            // Create the sub group on the "Ein schöner Tab" main tab (CIRCLEOBJECT_NEWTAB)
            if (!descparams.Desc.SetParameter(cid, bcSubgroup, new DescID(new DescLevel(CIRCLEOBJECT_NEWTAB))))
            {
                return(true);
            }

            /////////////////////////////////////////////////////////////////////////////////////
            // Create an new boolean value (as a checkbox) called "Check mich"
            cid = new DescID(new DescLevel(CIRCLEOBJECT_CHECKME, C4dApi.DTYPE_BOOL, 0));
            BaseContainer bcCheckMich = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_BOOL);

            bcCheckMich.SetString(C4dApi.DESC_NAME, "Check mich");
            bcCheckMich.SetBool(C4dApi.DESC_DEFAULT, true);
            // Create the boolean check box under the previously created sub group (CIRCLEOBJECT_SUBGROUP)
            if (!descparams.Desc.SetParameter(cid, bcCheckMich, new DescID(new DescLevel(CIRCLEOBJECT_SUBGROUP))))
            {
                return(true);
            }


            descparams.Flags |= DESCFLAGS_DESC.DESCFLAGS_DESC_LOADED;
            return(true); // base.GetDDescription(node, descparams);
        }
Example #18
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GeListNode obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #19
0
 public void SetCustomData(GeListNode node)
 {
     C4dApiPINVOKE.GeListNode_SetCustomData(swigCPtr, GeListNode.getCPtr(node));
 }
Example #20
0
        public virtual bool CopyTo(NodeData dest, GeListNode snode, GeListNode dnode, COPYFLAGS flags, AliasTrans trn)
        {
            bool ret = C4dApiPINVOKE.NodeData_CopyTo(swigCPtr, NodeData.getCPtr(dest), GeListNode.getCPtr(snode), GeListNode.getCPtr(dnode), (int)flags, AliasTrans.getCPtr(trn));

            return(ret);
        }
Example #21
0
        public virtual bool Message(GeListNode node, int type, SWIGTYPE_p_void data)
        {
            bool ret = C4dApiPINVOKE.NodeData_Message(swigCPtr, GeListNode.getCPtr(node), type, SWIGTYPE_p_void.getCPtr(data));

            return(ret);
        }
Example #22
0
        public virtual bool Read(GeListNode node, HyperFile hf, int level)
        {
            bool ret = C4dApiPINVOKE.NodeData_Read(swigCPtr, GeListNode.getCPtr(node), HyperFile.getCPtr(hf), level);

            return(ret);
        }
Example #23
0
        public virtual bool Write(GeListNode node, HyperFile hf)
        {
            bool ret = C4dApiPINVOKE.NodeData_Write(swigCPtr, GeListNode.getCPtr(node), HyperFile.getCPtr(hf));

            return(ret);
        }
Example #24
0
        public virtual bool Init(GeListNode node)
        {
            bool ret = C4dApiPINVOKE.NodeData_Init(swigCPtr, GeListNode.getCPtr(node));

            return(ret);
        }
Example #25
0
 public virtual void Free(GeListNode node)
 {
     C4dApiPINVOKE.NodeData_Free(swigCPtr, GeListNode.getCPtr(node));
 }
Example #26
0
 public void InsertAfter(GeListNode bl)
 {
     C4dApiPINVOKE.GeListNode_InsertAfter(swigCPtr, GeListNode.getCPtr(bl));
 }
Example #27
0
 public void InsertUnderLast(GeListNode bl)
 {
     C4dApiPINVOKE.GeListNode_InsertUnderLast(swigCPtr, GeListNode.getCPtr(bl));
 }
Example #28
0
        // Different ways how data (The...) is obtained and written.
        // Example 1: An override gets the baseTag/BaseObject:
        //
        // Working example from DoubleCircle:
        // public override retval OverrideMethod(..., BaseTag tag, ...)
        // {
        //    BaseContainer di = tag.GetDataInstance();                       // Get the data instance from the object
        //    int theIntContents = di.GetInt(GENERAL_TAG_THEINT);             // Retrieve the data from the data instance

        //  Question: Would it be sufficient to simply use this.GetDataInstance()



        public override bool GetDDescription(GeListNode node, DDescriptionParams descparams)
        {
            // The main part of this code is taken from the "LookAtCamera.cpp" file from the original C4D API samples.

            // TODO: whatever this might be good for: if (!singleid || cid.IsPartOf(*singleid, NULL)) // important to check for speedup c4d!
            // {
            if (!descparams.Desc.LoadDescription("tbase"))
            {
                return(false);
            }


            // According to https://developers.maxon.net/docs/Cinema4DCPPSDK/html/class_description.html and
            // with #define DESCID_ROOT DescID(DescLevel(1000491, 0, 0)) as set in lib_description.h
            // Set the tag's name to something meaningful (other than "Base Tag" or "Basis Tag"
            DescID        nCid    = new DescID(new DescLevel(1000491, 0, 0));                    // The ID of the radius value (GENERAL_TAG_THEINT)
            BaseContainer nBc     = descparams.Desc.GetParameterI(nCid, null);                   // The type of the radius value (LONG)
            string        OldName = nBc.GetString(C4dApi.DESC_NAME);

            nBc.SetString(C4dApi.DESC_NAME, TagName);



            //////////////////////////////////////////////////////////////////////////////////////
            // Create an int value named TheInt on the "Base" tab's main level
            DescID        cid = new DescID(new DescLevel(GENERAL_TAG_THEINT, C4dApi.DTYPE_LONG, 0)); // The ID of the radius value (GENERAL_TAG_THEINT)
            BaseContainer bc  = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);                  // The type of the radius value (LONG)

            bc.SetString(C4dApi.DESC_NAME, "TheInt");                                                // The user interface name (TheInt)
            bc.SetInt32(C4dApi.DESC_DEFAULT, 44);                                                    // The default value (44, but overridden to 42 in the Init method)
            if (!descparams.Desc.SetParameter(cid, bc, new DescID(new DescLevel(C4dApi.ID_TAGPROPERTIES))))
            {
                return(true);
            }


            //////////////////////////////////////////////////////////////////////////////////////
            // Create a string value named TheName on the "Base" tab's main level
            cid = new DescID(new DescLevel(GENERAL_TAG_THENAME, C4dApi.DTYPE_LONG, 0)); // The ID of the radius value (GENERAL_TAG_THENAME)
            bc  = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_STRING);                 // The type of the radius value (STRING)
            bc.SetString(C4dApi.DESC_NAME, "TheString");                                // The user interface name (TheName)
            bc.SetString(C4dApi.DESC_DEFAULT, "Worscht");                               // The default value (Worscht, but overridden to Horst in the Init method)
            if (!descparams.Desc.SetParameter(cid, bc, new DescID(new DescLevel(C4dApi.ID_TAGPROPERTIES))))
            {
                return(true);
            }



            /*
             * /////////////////////////////////////////////////////////////////////////////////////
             * // Create an entirely new Tab (called "Ein schöner Tab")
             * DescID cid = new DescID(new DescLevel(CIRCLEOBJECT_NEWTAB, C4dApi.DTYPE_GROUP, 0));
             * BaseContainer bcMaingroup = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_GROUP);
             * bcMaingroup.SetString(C4dApi.DESC_NAME, "Ein schöner Tab");
             * // Create the new Group on the top level (DecLevel(0))
             * if (!descparams.Desc.SetParameter(cid, bcMaingroup, new DescID(new DescLevel(0))))
             *  return true;
             *
             * /////////////////////////////////////////////////////////////////////////////////////
             * // Create an new sub group (called "Hübsches Grüppchen")
             * cid = new DescID(new DescLevel(CIRCLEOBJECT_SUBGROUP, C4dApi.DTYPE_GROUP, 0));
             * BaseContainer bcSubgroup = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_GROUP);
             * bcSubgroup.SetString(C4dApi.DESC_NAME, "Hübsches Grüppchen");
             * // Create the sub group on the "Ein schöner Tab" main tab (CIRCLEOBJECT_NEWTAB)
             * if (!descparams.Desc.SetParameter(cid, bcSubgroup, new DescID(new DescLevel(CIRCLEOBJECT_NEWTAB))))
             *  return true;
             *
             * /////////////////////////////////////////////////////////////////////////////////////
             * // Create an new boolean value (as a checkbox) called "Check mich"
             * cid = new DescID(new DescLevel(CIRCLEOBJECT_CHECKME, C4dApi.DTYPE_BOOL, 0));
             * BaseContainer bcCheckMich = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_BOOL);
             * bcCheckMich.SetString(C4dApi.DESC_NAME, "Check mich");
             * bcCheckMich.SetBool(C4dApi.DESC_DEFAULT, true);
             * // Create the boolean check box under the previously created sub group (CIRCLEOBJECT_SUBGROUP)
             * if (!descparams.Desc.SetParameter(cid, bcCheckMich, new DescID(new DescLevel(CIRCLEOBJECT_SUBGROUP))))
             *  return true;
             */

            descparams.Flags |= DESCFLAGS_DESC.DESCFLAGS_DESC_LOADED;

            return(true); // base.GetDDescription(node, descparams);
        }
Example #29
0
        public virtual int GetBranchInfo(GeListNode node, BranchInfo info, int max, GETBRANCHINFO flags)
        {
            int ret = C4dApiPINVOKE.NodeData_GetBranchInfo(swigCPtr, GeListNode.getCPtr(node), BranchInfo.getCPtr(info), max, (int)flags);

            return(ret);
        }
Example #30
0
        public virtual bool IsInstanceOf(GeListNode node, int type)
        {
            bool ret = C4dApiPINVOKE.NodeData_IsInstanceOf(swigCPtr, GeListNode.getCPtr(node), type);

            return(ret);
        }