split_object takes a multi-molecular object and converts it into a multi-state object. Similar to
split_states but for molecules instead of states and the result of this is a multi-state object.
<source lang="python">
import pymol
def split_object(target_obj=None, source_obj=None, max_iter=500, quiet=1, _self=cmd):
"""
DESCRIPTION
Splits a multi-molecular object into one multi-state object
ARGUMENTS
target_obj
(string) name of target object
source_obj
(string) name of source object
max_iter
(int) maximum number of object to process; set to 0 to unlimit
"""
if source_object==None:
print "Error: Please provide a source object."
return
# ensure the user gave us one object; save for prefix
obj_list = _self.get_object_list(target_obj)
if len(obj_list)>1:
print " Error: Please provide only one object at a time."
return
if target_object==None:
target_object = _self.get_unused_name(sou ..→