【发布时间】:2013-11-11 04:17:40
【问题描述】:
我想在列表中添加一个回调函数,这将导致在适当的时间使用一个参数调用回调。但是,我也希望回调也传递另一个变量。
注意:我习惯了 C++ 中的 std::bind 或 boost::bind,所以我一直在寻找类似的东西。
注意:顺便说一下,这是在 Python 中。
碰撞问题示例:
def collision_callback(hit, hitter)
# doing something relevant...
object = create_object()
collision_callbacks.append(collision_callback(_1, object)) # _1 is a placeholder from C++ lol.
# as you can see here _1 is expected
# to be filled in with the hit object.
【问题讨论】:
标签: python callback blender collision