Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. x_nerve
    3. Best
    X
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by x_nerve

    • RE: Some attempts at nondestructive modeling

      Hi:

      After a trial run, the script was tested successfully. By setting the name suffix of Python Tag, the problem of repeated running of Tag can be solved.

      Taking c4d.DIRTYFLAGS_SELECT as an example, if the point, line, and surface selections change, it will execute, otherwise it won't.

      The Python script code is as follows:

      import c4d
      #e-mail: xiuziye@qq.com
      
      def main():
             
          Name = op.GetName()
      
          Objects = op.GetObject()
          Changed = Objects.GetDirty(c4d.DIRTYFLAGS_SELECT)
      
          Text = ["xit" + str(Changed)[-1]]
          
          if str(Name).count(Text[0][:-1]) != 0 :
              
              if str(Name).find(Text[0][:-1]) != str(Name).rfind(Text[0][:-1]) :
                  
                  if str(Name)[str(Name).rfind(Text[0][:-1]):] == Text[0] :
                  
                      if str(Name).find(Text[0][:-1]) <= 0:
                          
                          #Do not execute, exit the program.
                          print ("Does not perform.")
                          op.SetName(str(Text[0]))
                          
                          return
                      
                      else:
                          #Do not execute, exit the program.
                          op.SetName(str(Name)[:str(Name).find(Text[0][:-1])] + str(Text[0]))
                          print ("Does not perform.")
                          
                          return
                          
                  else:
                      if str(Name).find(Text[0][:-1]) <= 0:
                          
                          op.SetName(str(Text[0]))
                          print ("Perform.")
                          
                      else:
                          
                          op.SetName(str(Name)[:str(Name).find(Text[0][:-1])] + str(Text[0]))
                          print ("Perform.")
      
              else:
                  
                  if str(Name)[str(Name).rfind(Text[0][:-1]):] == Text[0] :
                      #Do not execute, exit the program.
                  
                      print ("Does not perform.")
                      return
      
                  else:
      
                      op.SetName(str(Name)[:str(Name).find(Text[0][:-1])] + str(Text[0]))
                      print ("Perform.")
      
          else:
              print ("Perform.")
              op.SetName(str(Name) + str(Text[0]))
          
      
      
          print ("pass")
          #The next thing to execute.
      
      
      
      
      posted in General Programming & Plugin Discussions
      X
      x_nerve
    • RE: Moving a Point Along an Arc by Distance from another Point

      HI:

      I recently doing point cloud reconstruction, and it's really not a difficult problem. So the first thing you have to do is figure out 2 points and the center of the circle, so there are 3 points.Then figure out the length of each side of the triangle surrounded by 3 points, and finally figure out the Angle between 2 points and the center of the circle.You plug in the arc length formula and you get the arc length between 2 points.

      posted in General Programming & Plugin Discussions
      X
      x_nerve