Hi Peter, see if the code below can temporary solve your issue.
import c4d
def Rename (op):
# check for op being valid
if op is None:
return
# get the name
name = op.GetName()
# find last ".""
pos = name.rfind(".")
if pos != -1:
# get substring
name = name[0:pos]
# remove the additional "."
name = name.replace(".", "_")
# set the name
op.SetName(name)
# iterate over the child
if op.GetDown() is not None:
Rename(op.GetDown())
# iterate over the sibling
if op.GetNext() is not None:
Rename(op.GetNext())
# Main function
def main():
# retrieve the first item in the Object Manager and pass it to Rename
Rename(doc.GetFirstObject())
# notify Cinema
c4d.EventAdd()
# Execute main()
if __name__=='__main__':
main()
The code above is just a draft example on how you can get it done but it should be on you to adapt it to your specific needs. Using a code without any grain of salt can be dangerous and error prone and it should also be noted that we're here to support rather than to provide solution.
I again iterate the suggestion to have a look to BaseList2D and GeListNode to get familiar with the concepts needed to properly traverse the scene and manage the information found belonging to the encountered objects and also, in your case, to Python tutorials for beginners.
Finally, if no further help is needed, remember to mark the thread as "SOLVED".
Best, R