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
# ------------------------------------------------------------------
python类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
# ------------------------------------------------------------------