Cinema 4D – Cloth Banner Drop

A client requested that a piece of art be dropped like a cloth banner at a circus. I was a little familiar with the cloth tag in C4D, but I had no idea of how to crinkle up the mesh so it would unfurl properly.

I used the following tutorial as a starting point for the setup of this project.

The only problem was that there was no discussion on how to control the dimensions with this method. The method has you make a spline and then extrude that out horizontally to make the cloth. This gives you control over the horizontal dimension but leaves you hanging for the vertical dimension of your cloth, so you must find the length of the spline that you are drawing.

In order to find the length of the spline, I came across this python script that would do exactly that.

import c4d
def CSTO(obj):
    obj = [obj.GetClone()]
    doc = c4d.documents.BaseDocument()
    doc.InsertObject(obj[0],None,None)
    obj = c4d.utils.SendModelingCommand(
                              command = c4d.MCOMMAND_CURRENTSTATETOOBJECT,
                              list = obj,
                              mode = c4d.MODELINGCOMMANDMODE_ALL,
                              doc = doc )
    return obj[0]
def EDGE2SPL(obj):
    obj = [obj.GetClone()]
    doc = c4d.documents.BaseDocument()
    sold = c4d.utils.SplineLengthData()
    doc.InsertObject(obj[0],None,None)
    sploper = c4d.utils.SendModelingCommand(
                              command = c4d.MCOMMAND_EDGE_TO_SPLINE,
                              list = obj,
                              mode = c4d.MODELINGCOMMANDMODE_EDGESELECTION,
                              doc = doc )
    if sploper and obj[0].GetDown():
        sold.Init(obj[0].GetDown())
        op[c4d.ID_USERDATA,1] = sold.GetLength()
    return
def main():
    trgop = op.GetObject()
    if trgop.CheckType(c4d.Obase):
        sold = c4d.utils.SplineLengthData()
        new = CSTO(trgop)
        if new.CheckType(c4d.Opolygon):
            newsp = EDGE2SPL(trgop)
            return
        sold.Init(new)
        op[c4d.ID_USERDATA,1] = sold.GetLength()
    if trgop.GetType() != c4d.Ospline: return
    else:
        sold = c4d.utils.SplineLengthData()
        sold.Init(trgop)
        op[c4d.ID_USERDATA,1] = sold.GetLength()        
 

The final result. A portrait style digital signage spot.


							
John Hilbert Written by: