Texture Weirdness (size issue?)



  • On 21/08/2017 at 08:31, xxxxxxxx wrote:

    I have a weird problem with a texture:

    _<_img src="http://35.io/media/c4d.png" height="932" width="1920" border="0" /_>_

    I think I can solve this problem in my plugin by combining those 256 "chunks" (MCNK #xxx) into ONE geometry instead of combining them with a connect object and then run the smoother (subdiv) over ONE object instead of the result from the combiner because that seems to actually work...

    So the question would be:
    Is there a ModelingCommand I can use in Python that does the same as the Connect+Delete command or do I have to do a

    c4d.CallCommand(16768)
    

    For some reason, I don't really like calling UI command from a script, that just seems kinda cheety...



  • On 21/08/2017 at 09:21, xxxxxxxx wrote:

    You don't call UI commands. You call commands that can also be called from UI. These commands exist for a reason. They save you a lot of work.

    Of course you can also assemble these objects by yourself. But why would you want to do that since the command already exists and you don't want to do some fancy stuff while connecting?

    A typical method to imitate Connect+Delete would go like:
    Get selected objects.
    Get first object in the list, hold it as parent for others.
    Iterate to the next one, get all polies, copy them to the parent object.
    etc.
    etc.
    Optimize.
    Delete all objects that aren't used anymore.
    Update parent object
    Update document.

    And of course, there's also some error-checking and Undo involved that has to be implemented by yourself.

    All this stuff can be done with a single command that someone has already written for you.



  • On 21/08/2017 at 11:18, xxxxxxxx wrote:

    Ok, so I'm doing this:

      
    c4d.CallCommand(100004767) # Deselect All  
    obj.SetBit(c4d.BIT_ACTIVE) # Select current object (obj is the parent NULL of all chunks)  
    c4d.CallCommand(100004768) # select all children  
    c4d.CallCommand(16768) # connect & delete  
    c4d.EventAdd()  
    

    The weird thing now is: The new object (combined) is not in the place of the "old" one" (it is at the document root) and the old subobjects are not being deleted...



  • On 21/08/2017 at 11:55, xxxxxxxx wrote:

    I can work around this with...

      
          # connect & delete and then optimize (convoluted amount of steps.... urgh...)  
          c4d.CallCommand(100004767) #Deselect All  
          obj.SetBit(c4d.BIT_ACTIVE) # Select current object  
          name = obj.GetName()  
          c4d.CallCommand(100004768) # select all children  
          c4d.CallCommand(16768) # connect & delete  
          nobj = doc.GetFirstObject()  
          nobj.InsertUnder(subparent)  
          sobj = nobj.GetNext()  
          sobj.Remove()  
          nobj.SetName(name)  
          c4d.EventAdd()  
    

    but that just seems way too complicated...



  • On 22/08/2017 at 02:16, xxxxxxxx wrote:

    Hello,

    I just want to confirm that there is no modelling command corresponding to the "Connect Objects + Delete" function.

    Using CallCommand() is perfectly fine. But be aware that using CallCommand() is the same as pressing the the corresponding button in the UI. This means the command invoked with CallCommand() will do its own undo-handling etc.

    best wishes,
    Sebastian


Log in to reply