Example #1
0
        private bool getLegs(BaseContainer dataKoerper)
        {
            DescID        cid            = new DescID(new DescLevel(SKELETT_UNTERKOERPER_BOX, C4dApi.DTYPE_BOOL, 0));
            BaseContainer bcUnterKoerper = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_BOOL);

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

            BaseContainer dataUnterKoerper = GetDataInstance(node);

            //Erstellt ein weiteres Feld für die Beine
            cid = new DescID(new DescLevel(SKELETT_BEINE, C4dApi.DTYPE_LONG, 0));
            BaseContainer bcBeine = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_LONG);

            bcBeine.SetString(C4dApi.DESC_NAME, "Beine");
            //Definiert den minimalen Wert
            bcBeine.SetInt64(C4dApi.DESC_MIN, 0);
            //Definiert den maximalen Wert


            bool temp2 = dataKoerper.GetBool(SKELETT_UNTERKOERPER_BOX);

            if (temp2 == true && dataKoerper.GetInt64(SKELETT_TYPE) == 3)//Schaltung zwischen 4 Beiner und Menschen Ist der Type ein 4 Beiner so ist die Maximal zahl der Beine 4
            {
                bcBeine.SetInt64(C4dApi.DESC_MAX, 4);
                bcBeine.SetBool(C4dApi.DESC_HIDE, false);
                Bein    = true;
                Schwanz = true;
            }
            else if (temp2 == true && dataKoerper.GetInt64(SKELETT_TYPE) != 3)//Schaltung zwischen 4 Beiner und Menschen Ist der Type ein Mensch so ist die Maximal zahl der Beine 2
            {
                bcBeine.SetInt64(C4dApi.DESC_MAX, 2);
                bcBeine.SetBool(C4dApi.DESC_HIDE, false);
                Bein = true;
            }
            else
            {
                bcBeine.SetBool(C4dApi.DESC_HIDE, true);
                Bein = false;
            }

            if (!descparams.Desc.SetParameter(cid, bcBeine, new DescID(new DescLevel(C4dApi.ID_OBJECTPROPERTIES))))
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        public override SplineObject GetContour(BaseObject op, BaseDocument doc, double lod, BaseThread bt)
        {
            BaseContainer bc = op.GetDataInstance();
            SplineObject  bp = GenerateCircle(bc.GetFloat(CIRCLEOBJECT_RAD));

            if (bp == null)
            {
                return(null);
            }
            BaseContainer bb = bp.GetDataInstance();

            bb.SetInt32(C4dApi.SPLINEOBJECT_INTERPOLATION, bc.GetInt32(C4dApi.SPLINEOBJECT_INTERPOLATION));
            bb.SetInt32(C4dApi.SPLINEOBJECT_SUB, bc.GetInt32(C4dApi.SPLINEOBJECT_SUB));
            bb.SetFloat(C4dApi.SPLINEOBJECT_ANGLE, bc.GetFloat(C4dApi.SPLINEOBJECT_ANGLE));
            bb.SetFloat(C4dApi.SPLINEOBJECT_MAXIMUMLENGTH, bc.GetFloat(C4dApi.SPLINEOBJECT_MAXIMUMLENGTH));

            OrientObject(bp, bc.GetInt32(C4dApi.PRIM_PLANE), bc.GetBool(C4dApi.PRIM_REVERSE));

            return(bp);
        }
Example #3
0
        private bool getArms(BaseContainer dataKoerper)
        {
            //Erstellt ein weiteres Feld für die Arme
            DescID        cid    = new DescID(new DescLevel(SKELETT_ARME, C4dApi.DTYPE_LONG, 0));
            BaseContainer bcArme = C4dApi.GetCustomDataTypeDefault(C4dApi.DTYPE_REAL);

            bcArme.SetString(C4dApi.DESC_NAME, "Arme");
            //Definiert den minimalen Wert
            bcArme.SetInt64(C4dApi.DESC_MIN, 0);
            //Definiert den maximalen Wert
            bcArme.SetInt64(C4dApi.DESC_MAX, 2);

            bool temp = dataKoerper.GetBool(SKELETT_OBERKOERPER_BOX);

            if (dataKoerper.GetInt64(SKELETT_TYPE) == 3)
            {
                temp = false;
                bcArme.SetInt64(C4dApi.DESC_DEFAULT, 0);
            }

            if (temp == true)
            {
                bcArme.SetBool(C4dApi.DESC_HIDE, false);
                Hand = true;
            }
            else
            {
                bcArme.SetBool(C4dApi.DESC_HIDE, true);
                Hand = false;
            }

            //bcArme.SetBool(C4dApi.DESC_HIDE, true);
            if (!descparams.Desc.SetParameter(cid, bcArme, new DescID(new DescLevel(C4dApi.ID_OBJECTPROPERTIES))))
            {
                return(true);
            }

            return(false);
        }