Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Sliders don't change my object anymore

    Scheduled Pinned Locked Moved PYTHON Development
    1 Posts 0 Posters 124 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 05/06/2013 at 15:24, xxxxxxxx wrote:

      Hey,

      I have placed my functions to create objects in another file.
      They get called when a button is pressed. In the same Command-method the objects need to be changed, depending on some sliders.

      It all worked fine, untill I replaced my functions. The other files loads properly, the function as well, the objects get created. However, when I change the sliders, the objects won't change.

      First it gave an Error that global "L_Foot" isn't defined. Then I defined them again in my main file, and the error was gone, but still the objects won't change.

      Here's a snippet of my code:

        
      def Command(self, id, msg) :     #Commands  
              
            if (id == 10002) :           #Button Create Character  
                GENDER = self.GetLong(10001)  
                print GENDER  
                doc = c4d.documents.GetActiveDocument()  
                AddLeftFoot(doc)  
                AddRightFoot(doc)  
                AddLeftToes(doc)  
                AddRightToes(doc)  
                AddLeftLeg(doc)  
                AddRightLeg(doc)  
                AddLeftThigh(doc)  
                AddRightThigh(doc)  
                AddHip(doc)  
                AddBody(doc)  
                AddLeftArm(doc)  
                AddRightArm(doc)  
                AddLeftUpperArm(doc)  
                AddRightUpperArm(doc)  
                AddLeftLowerArm(doc)  
                AddRightLowerArm(doc)  
                AddLeftWrist(doc)  
                AddRightWrist(doc)  
                c4d.CallCommand(17105) # Gouraud Shading (Lines)  
                c4d.CallCommand(12148) # Frame Geometry  
                c4d.EventAdd()  
                  
            #Sliders#  
              
              
              
      ########################################################################################################################################################  
      ### Left_Foot SLiderCode  
      ########################################################################################################################################################  
              
              
            L_Foot = c4d.PolygonObject(8, 6)  
                      
            if id in (FOOT_X_SLIDER, FOOT_Y_SLIDER, FOOT_Z_SLIDER, FOOT_AXIS_X_SLIDER, LEG_X_SLIDER, LEG_Z_SLIDER) :  
                FOOT_X = self.GetReal(FOOT_X_SLIDER)  
                FOOT_Y = self.GetReal(FOOT_Y_SLIDER)  
                FOOT_Z = self.GetReal(FOOT_Z_SLIDER)  
                FOOT_AXIS_X = self.GetReal(FOOT_AXIS_X_SLIDER)  
                LEG_X = self.GetReal(LEG_X_SLIDER)  
                LEG_Z = self.GetReal(LEG_Z_SLIDER)  
                L_Foot.SetPoint(0, c4d.Vector((FOOT_AXIS_X -FOOT_X/2.0), (ZERO), (-LEG_Z/2.0 -(FOOT_Z -LEG_Z) +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.SetPoint(1, c4d.Vector((FOOT_AXIS_X -FOOT_X/2.0), (FOOT_Y), (-LEG_Z/2.0 -(FOOT_Z -LEG_Z) +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.SetPoint(2, c4d.Vector((FOOT_AXIS_X +FOOT_X/2.0), (ZERO), (-LEG_Z/2.0 -(FOOT_Z -LEG_Z) +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.SetPoint(3, c4d.Vector((FOOT_AXIS_X +FOOT_X/2.0), (FOOT_Y), (-LEG_Z/2.0 -(FOOT_Z -LEG_Z) +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.SetPoint(4, c4d.Vector((FOOT_AXIS_X +FOOT_X/2.0), (ZERO), (LEG_Z/2.0 +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.SetPoint(5, c4d.Vector((FOOT_AXIS_X +FOOT_X/2.0), (FOOT_Y), (LEG_Z/2.0 +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.SetPoint(6, c4d.Vector((FOOT_AXIS_X -FOOT_X/2.0), (ZERO), (LEG_Z/2.0 +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.SetPoint(7, c4d.Vector((FOOT_AXIS_X -FOOT_X/2.0), (FOOT_Y), (LEG_Z/2.0 +(FOOT_X -LEG_X)/2.0)))  
                L_Foot.Message(c4d.MSG_UPDATE)  
                c4d.EventAdd()  
      

      Any ideas how to fix it???

      Thanx in advance for any or no answers 🙂

      1 Reply Last reply Reply Quote 0
      • First post
        Last post