In our workflow, there are situations where we might need to update the path of the alembic file in the scene downstream.
I did some experimentation (manually via a C4D interactive session) with that but found that after updating the file path, there is no update to the scene. Is there something else I need to do to get C4D to re-read the alembic file content ?
I can't really reproduce the issue here (or i don't understand it)
something like this is working. Using either the bracket or the SetParameter function is working.
from c4d import gui
# Welcome to the world of Python
# Main function
filePath = "C:\\bendcube.abc"
alembicPath = "/Cube/Cube_1/CubeShape"
op[c4d.ALEMBIC_PATH] = filePath
op[c4d.ALEMBIC_IDENTIFIER] = alembicPath
print "using setparameter"
filePathID = c4d.DescID(c4d.ALEMBIC_PATH)
alembicID = c4d.DescID ( c4d.ALEMBIC_IDENTIFIER)
op.SetParameter(filePathID, filePath, c4d.DESCFLAGS_SET_USERINTERACTION )
op.SetParameter(alembicID, alembicPath, c4d.DESCFLAGS_SET_USERINTERACTION )
# Execute main()
@m_magalhaes I was attempting to change the path to the alembic file in the UI of Cinema4d to understand how C4D handles alembic file before diving into python script, yes, eventually, the path swap will also be done via scripting. Is changing the path to the alembic file all that is required or do I have to click some other button to get C4D to rebuild the hierachy in C4D ? I am changing the path to the alembic file that was already loaded in C4D
you have to change the filepath and the object identifier. (the path inside the alembic file)
@m_magalhaes Is there a way to get Cinema4D to update the object identifier ? When I import an alembic file, Cinema4D builds a hierarchy and all the paths recursively. Is there a way to tell Cinema4D to rebuild that hierarchy or is deleting and re-importing the only way to get the object identifier rebuilt ?
well the alembic files can contain multiple objects sot there's no way for Cinema 4D to know witch one you want.
If your alembic file have an entire hierarchy, your only option is to remove the actual alembic object and re-import a new one.
That should build the new hierarchy for all the content of your alembic file
I'll set this thread to solved without further feedback :)