def __init__(self, blenderObject: bpy.types.Object) -> None: # When true, keyframes and Custom Animation Properties # are included in OBJ # True for split parent feature or not visible self.export_animation_only = blenderObject.hide_get( ) or blenderObject.hide_viewport self.blenderObject = blenderObject #This is assigned and tied together in in XPlaneBone's constructor self.xplaneBone = None # type: xplane_bone.XPlaneBone self.name = blenderObject.name # type: str self.type = self.blenderObject.type # type: str self.datarefs = {} # type: Dict[str,str] self.bakeMatrix = None # type: Optional[mathutils.Matrix] self.attributes = XPlaneAttributes() self.cockpitAttributes = XPlaneAttributes() self.animAttributes = XPlaneAttributes() self.conditions = [ ] # type: List[io_xplane2blender.xplane_props.XPlaneCondition] # This represents all specializations of lods, on this subject, # including it's parents. Set in XPlaneBone's constructor self.effective_buckets: Tuple[...] = (False, ) * 4 for i, dataref in self.blenderObject.xplane.datarefs.items(): self.datarefs[dataref.path] = dataref self.setWeight()
def send_object_visibility(client: Client, object_: bpy.types.Object): logger.debug("send_object_visibility %s", object_.name_full) buffer = (common.encode_string(object_.name_full) + common.encode_bool(object_.hide_viewport) + common.encode_bool(object_.hide_select) + common.encode_bool(object_.hide_render) + common.encode_bool(object_.hide_get())) client.add_command( common.Command(common.MessageType.OBJECT_VISIBILITY, buffer, 0))
def object_visibility(o: bpy.types.Object): return ObjectVisibility(o.hide_viewport, o.hide_select, o.hide_render, o.hide_get())