I'm trying to use this keyframe selection code from Cineversity..
I select an object but it prints nothing in the console. It also does not error out. You can see an illustration of the problem here:
Should I change something in the code to accommodate possible changes in the Python API?
works fine for me. But the code is missing import statements and a call to main(). Also the indentation is all messed up when you copy the code from their homepage. I just mangled the code through an autopeper, added import and invoked main().
On a side note: I am not sure if this is code you should learn from. This fine if you just want to get something done. For a learning site I find this unsuitable, but maybe I am to picky.
if not op or not op.KeyframeSelectionContent():
keySelection = 
desc = op.GetDescription(c4d.DESCFLAGS_DESC_0)
for bc, paramid, groupid in desc:
# print paramid
# Handle Vectors - seems desc iterator only does top level
if paramid.dtype == c4d.DTYPE_VECTOR:
for i in xrange(c4d.VECTOR_X, c4d.VECTOR_Z+1):
did = c4d.DescID(
paramid, c4d.DescLevel(i, c4d.DTYPE_REAL, 0))
# Handle top level DescIDs
keySelection = GetKeyframeSelection(op)
print "*"*4, "Keyframe Select IDs", "*"*4
if __name__ == "__main__":
Thanks for the clarification.
Yea, I guess so but just learning as much as I can.