我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用bpy.types.PropertyGroup()。
def setup(self, context, o, datablock, snap_callback=None): """ Factory return a manipulator object or None o: object datablock: datablock to modify snap_callback: function call y """ self.get_prefs(context) global manipulators_class_lookup if self.type_key not in manipulators_class_lookup.keys() or \ not manipulators_class_lookup[self.type_key].poll(context): # RuntimeError is overkill but may be enabled for debug purposes # Silentely ignore allow skipping manipulators if / when deps as not meet # manip stack will simply be filled with None objects # raise RuntimeError("Manipulator of type {} not found".format(self.type_key)) return None m = manipulators_class_lookup[self.type_key](context, o, datablock, self, handle_size, snap_callback) # points storage model as described upside self.pts_mode = m.pts_mode return m # ------------------------------------------------------------------ # Define Manipulable to make a PropertyGroup manipulable # ------------------------------------------------------------------