Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    R21.207 How to apply Reset Scale with compensating points to all selected objects?

    Cinema 4D SDK
    2
    2
    492
    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.
    • C
      Crea
      last edited by

      Hi, devs. I'm working with a rigging model, and in some cases I have to scale it which will make the scale value not be 1 (Figure 1). And every child object's real scale value is changed.
      Figure 1
      f5ee8e14-e99e-4d7f-a8b9-ba3db92693ca-image.png

      Then I'm using Reset Scale( c4d. CallCommand(12317) )(Figure 2)
      to solve this problem, but it can only solve them one by one selected.

      Figure 2
      6494c922-a412-49fa-bb82-b9196f1b3339-image.png

      Then I wrote a Python script to see if this would be applied by one click.

      import c4d
      
      def main():
      
          SelectedObjs = doc.GetActiveObjects(1) 
          cnt = len(SelectedObjs)
      
          print SelectedObjs # to check whether objs can be read
      
          for obj in SelectedObjs:
              print obj # to check whether each obj can be read 
              c4d.CallCommand(12317,0)
      
      if __name__=='__main__':
      main()
      

      And it turned out that objects could be read indeed, but Reset Scale just didn't make effects to children objects.

      Is there anyway can solve this Reset Scale problem? I didn't use freeze scale because I worried about errors happenning in interactions with like Xparticle, dynamics, simulations stuffs.

      1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand
        last edited by ferdinand

        Hi @Crea,

        thank you for reaching out to us. Unfortunately I am a bit slow again this morning, so I have trouble understanding your posting.

        1. What do you mean by a real scale value? The size of the bounding box of an object?
        2. It also not quite clear to me what you are trying to achieve:
          a. Reset the scaling component of the transforms of the objects you did previously scale up.
          b. Or so to speak "reset" the scaling of the children of these objects - so that they "take on" their original size, while the scaling and size of their parent remains modified?
        3. Your script seems to work fine for me, but then again I am not quite clear on what you are trying to do.

        What confuses me the most is that the selected object in your screen is not in a child-parent relation and also the fact that scaling a parent will not change the relative transform of its children, i.e. their local matrix, i.e. what you are seeing the coordinates tab of the attribute manager.

        Sorry for all the confusion, but we would apricate it if you would clarify some points.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

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