Ejemplo n.º 1
0
 public C4DInterface(GeListNode node, DDescriptionParams descparams)
     : base(false)
 {
     this.node = node;
     this.descparams = descparams;
     this.generate();
 }
Ejemplo n.º 2
0
 //GetDDescription für das erstellen des Interface
 public override bool GetDDescription(GeListNode node, DDescriptionParams descparams)
 {
     C4DInterface C4DInter = new C4DInterface(node, descparams);
     return true;
 }
Ejemplo n.º 3
0
 internal static HandleRef getCPtr(DDescriptionParams obj) {
   return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
 }
        /*
        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.GetLong(SPLINEOBJECT_INTERPOLATION);
                    return inter==SPLINEOBJECT_INTERPOLATION_NATURAL || inter==SPLINEOBJECT_INTERPOLATION_UNIFORM;

                case SPLINEOBJECT_ANGLE:
                    inter = data.GetLong(SPLINEOBJECT_INTERPOLATION);
                    return inter==SPLINEOBJECT_INTERPOLATION_ADAPTIVE || inter==SPLINEOBJECT_INTERPOLATION_SUBDIV;

                case SPLINEOBJECT_MAXIMUMLENGTH:
                    return data.GetLong(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.SetLong(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);
        }
Ejemplo n.º 5
0
 public virtual bool GetDDescription(GeListNode node, DDescriptionParams descparams) {
   bool ret = (SwigDerivedClassHasMethod("GetDDescription", swigMethodTypes31) ? C4dApiPINVOKE.ObjectDataM_GetDDescriptionSwigExplicitObjectDataM__SWIG_1(swigCPtr, GeListNode.getCPtr(node), DDescriptionParams.getCPtr(descparams)) : C4dApiPINVOKE.ObjectDataM_GetDDescription__SWIG_1(swigCPtr, GeListNode.getCPtr(node), DDescriptionParams.getCPtr(descparams)));
   return ret;
 }