def draw_socket_layout(socket: bpy.types.NodeSocket, layout: bpy.types.UILayout, prop_name='default_value_raw'): if not socket.is_output and not socket.is_linked: layout.prop(socket, prop_name, text=socket.name) else: layout.label(text=socket.name)
def draw(cls, context, layout: bpy.types.UILayout, data, effect, richstrip): metastrip = cls.getEffectStrip(richstrip, effect, "mask") imgstrip = metastrip.sequences.get( cls.genRegularStripName(data.RichStripID, effect.EffectId, "img")) white = metastrip.sequences.get( cls.genRegularStripName(data.RichStripID, effect.EffectId, "white")) layout.label(text="Gradient:") layout.prop(metastrip, "mute", toggle=0, invert_checkbox=True, text="Only Mate") # layout.prop(white, cls.genbinderName(effect, "offsetFactor", True), text="Offset") exportbox.draw(layout, richstrip, cls.getBoolProperty(effect, "offset_export"), white, cls.genbinderName(effect, "offsetFactor", True), "Offset") exportbox.draw(layout, richstrip, cls.getBoolProperty(effect, "scale_export"), imgstrip, cls.genbinderName(effect, "scaleFactor", True), "Scale") return
def draw_advanced_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "data_directory", text="Data Directory") layout.prop(mixer_prefs, "ignore_version_check") layout.prop(mixer_prefs, "log_level") layout.prop(mixer_prefs, "show_server_console") layout.prop(mixer_prefs, "vrtist_protocol")
def draw_expand_handle(parent: bpy.types.UILayout, text: str, object_with_property, expand_property_field: str): parent.prop( object_with_property, expand_property_field, text=text, icon="TRIA_DOWN" if getattr( object_with_property, expand_property_field) else "TRIA_RIGHT", icon_only=True, emboss=False)
def draw_socket_layout_split(socket: bpy.types.NodeSocket, layout: bpy.types.UILayout, prop_name='default_value_raw'): if not socket.is_output and not socket.is_linked: # Blender layouts use 0.4 splits layout = layout.split(factor=0.4, align=True) layout.label(text=socket.name) if not socket.is_output and not socket.is_linked: layout.prop(socket, prop_name, text='')
def draw_expand_handle(parent: bpy.types.UILayout, text: str, object_with_expand_property, expand_property_field: str): """ :param parent: the parent layout :param text: the text for the expand handle :param object_with_expand_property: object with the expand/collapse property :param expand_property_field: expand/collapse field on the object :return: None """ parent.prop(object_with_expand_property, expand_property_field, text=text, icon="TRIA_DOWN" if getattr(object_with_expand_property, expand_property_field) else "TRIA_RIGHT", icon_only=True, emboss=False)
def draw_developer_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "no_send_scene_content", text="No send_scene_content") layout.prop(mixer_prefs, "no_start_server", text="Do not start server on connect") layout.prop(mixer_prefs, "send_base_meshes", text="Send Base Meshes") layout.prop(mixer_prefs, "send_baked_meshes", text="Send Baked Meshes") layout.prop(mixer_prefs, "commands_send_interval") box = layout.box().column() box.label(text="Gizmos") box.prop(mixer_prefs, "display_own_gizmos") box.prop(mixer_prefs, "display_frustums_gizmos") box.prop(mixer_prefs, "display_names_gizmos") box.prop(mixer_prefs, "display_ids_gizmos") box.prop(mixer_prefs, "display_selections_gizmos")
def draw_effect(self, effect, index: int, col: bpy.types.UILayout): '''Draw single effect in the event''' # If parent is collapsed don't draw anything box = col.box() col = box.column() row = col.row() row.label(text=f'{effect.effect_type}') # Delete button op_props = row.operator("mcblend.remove_effect", icon='X', text='') op_props.effect_index = index if effect.effect_type == EffectTypes.PARTICLE_EFFECT.value: col.prop(effect, "effect", text="Effect") col.prop(effect, "locator", text="Locator") col.prop(effect, "pre_effect_script", text="Pre effect script") col.prop(effect, "bind_to_actor", text="Bind to actor") elif effect.effect_type == EffectTypes.SOUND_EFFECT.value: col.prop(effect, "effect", text="Effect")
def draw_render_controller(self, rc, col: bpy.types.UILayout): ''' Draws single render controller GUI ''' geo_cache = rc.geometry_cache texture_cache = rc.texture_cache geo_choice = geo_cache.is_cached and len(geo_cache.values) > 1 texture_choice = texture_cache.is_cached and len( texture_cache.values) > 1 material_choice = False for mat in rc.materials: mat_cache = mat.value_cache # Not cached (shouldn't happen) -> assume you can select something # Cached -> check if there are at least 2 items (a choice for user) if (not mat_cache.is_cached or (mat_cache.is_cached and len(mat_cache.values) > 1)): material_choice = True break if (not geo_choice and not texture_choice and not material_choice): return # Nothing to draw box = col.box() col = box.column() row = col.row() row.label(text=f'{rc.name}') if geo_choice: col.prop(rc, "geometry", text="Geometry") if texture_choice: col.prop(rc, "texture", text="Texture") if material_choice: box = col.box() col = box.column() row = col.row() row.label(text="Materials") for mat in rc.materials: mat_cache = mat.value_cache if (not mat_cache.is_cached or (mat_cache.is_cached and len(mat_cache.values) > 1)): col.prop(mat, "value", text=mat.name)
def draw_gizmos_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "display_frustums_gizmos") layout.prop(mixer_prefs, "display_frustums_names_gizmos") layout.prop(mixer_prefs, "display_selections_gizmos") layout.prop(mixer_prefs, "display_selections_names_gizmos")
def draw_connection_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "host") layout.prop(mixer_prefs, "port")
def draw_user_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "user") layout.prop(mixer_prefs, "color", text="")
def __draw_location_properties(position_box: bpy.types.UILayout, position_properties: WorkpiecePosition): position_box.label(text="Origin type") position_box.prop(position_properties, "origin_type", text="") if position_properties.origin_type == "corner": position_box.label(text="Selected corner (local)") position_box.prop(position_properties, "origin_corner", text="") elif position_properties.origin_type == "edge-centered": position_box.label(text="Selected edge") position_box.prop(position_properties, "origin_edge", text="") elif position_properties.origin_type == "face-centered": position_box.label(text="Selected face") position_box.prop(position_properties, "origin_face", text="") position_box.label(text="Origin location") position_box.prop(position_properties, "origin_location", text="") if position_properties.origin_location == "position": position_box.label(text="Coordinates") position_box.prop(position_properties, "location_coordinates", text="") elif position_properties.origin_location == "selected": position_box.label(text="Distance", icon='ARROW_LEFTRIGHT') position_box.prop(position_properties, "distance", text="")
def draw_mask_properties(self, mask, index: int, col: bpy.types.UILayout, *, colors=False, interpolate=False, normalize=False, p1p2=False, stripes=False, relative_boundaries=False, expotent=False, strength=False, hard_edge=False, horizontal=False, seed=False, color=False, children=False, mode=False): '''Draws properties of UV-mask.''' if colors: self.draw_colors(mask, index, col) # colors if interpolate: col.prop(mask, "interpolate") if normalize: col.prop(mask, "normalize") if p1p2: row = col.row() if mask.relative_boundaries: row.prop(mask, "p1_relative") row = col.row() row.prop(mask, "p2_relative") else: row.prop(mask, "p1") row = col.row() row.prop(mask, "p2") if relative_boundaries: col.prop(mask, "relative_boundaries") if stripes: self.draw_stripes(mask, index, col) # stripes if expotent: col.prop(mask, "expotent") if strength: col.row().prop(mask, "strength") if hard_edge: col.prop(mask, "hard_edge") if horizontal: col.prop(mask, "horizontal") if seed: row = col.row() row.prop(mask, "use_seed") if mask.use_seed: row.prop(mask, "seed") if color: col.prop(mask.color, "color") if mode: col.prop(mask, "mode") if children: col.prop(mask, "children")
def draw_content_import(cls, layout: bpy.types.UILayout, scene: bpy.types.Scene): layout.prop(scene.m3_import_options.content, "mesh") layout.prop(scene.m3_import_options.content, "materials") layout.prop(scene.m3_import_options.content, "bones") layout.prop(scene.m3_import_options.content, "rigging") layout.prop(scene.m3_import_options.content, "cameras") layout.prop(scene.m3_import_options.content, "fuzzyHitTests") layout.prop(scene.m3_import_options.content, "tightHitTest") layout.prop(scene.m3_import_options.content, "particleSystems") layout.prop(scene.m3_import_options.content, "ribbons") layout.prop(scene.m3_import_options.content, "forces") layout.prop(scene.m3_import_options.content, "rigidBodies") layout.prop(scene.m3_import_options.content, "lights") layout.prop(scene.m3_import_options.content, "billboardBehaviors") layout.prop(scene.m3_import_options.content, "attachmentPoints") layout.prop(scene.m3_import_options.content, "projections") layout.prop(scene.m3_import_options.content, "warps")
def draw_developer_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "statistics_directory", text="Stats Directory") layout.operator(bl_operators.OpenStatsDirOperator.bl_idname, text="Open Directory") layout.operator(bl_operators.WriteStatisticsOperator.bl_idname, text="Write Statistics") layout.prop(mixer_prefs, "auto_save_statistics", text="Auto Save Statistics") layout.prop(mixer_prefs, "no_send_scene_content", text="No send_scene_content") layout.prop(mixer_prefs, "no_start_server", text="Do not start server on connect") layout.prop(mixer_prefs, "send_base_meshes", text="Send Base Meshes") layout.prop(mixer_prefs, "send_baked_meshes", text="Send Baked Meshes") layout.prop(mixer_prefs, "commands_send_interval") box = layout.box().column() box.label(text="Gizmos") box.prop(mixer_prefs, "display_own_gizmos") box.prop(mixer_prefs, "display_frustums_gizmos") box.prop(mixer_prefs, "display_names_gizmos") box.prop(mixer_prefs, "display_ids_gizmos") box.prop(mixer_prefs, "display_selections_gizmos")
def draw_advanced_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "log_level") layout.prop(mixer_prefs, "env") layout.prop(mixer_prefs, "show_server_console")
def draw_layout(cls, layout: bpy.types.UILayout, scene: bpy.types.Scene): layout.prop(scene.m3_import_options, "contentPreset") if scene.m3_import_options.contentPreset == M3ImportContentPreset.Custom: ImportPanel.draw_content_import( layout.box().column(heading="Content to import"), scene) if scene.m3_import_options.contentPreset not in [ M3ImportContentPreset.MeshMaterials, M3ImportContentPreset.MeshMaterialsVG ]: layout.prop(scene.m3_import_options, "armatureObject") layout.prop(scene.m3_import_options, "rootDirectory", text="Root Directory") layout.prop(scene.m3_import_options, "generateBlenderMaterials", text="Generate Blender Materials At Import") layout.prop(scene.m3_import_options, "applySmoothShading", text="Apply Smooth Shading") layout.prop(scene.m3_import_options, "markSharpEdges", text="Mark sharp edges") layout.prop(scene.m3_import_options, "teamColor", text="Team Color")
def draw_developer_settings_ui(layout: bpy.types.UILayout): mixer_prefs = get_mixer_prefs() layout.prop(mixer_prefs, "no_send_scene_content", text="No send_scene_content") layout.prop(mixer_prefs, "no_start_server", text="Do not start server on connect") layout.prop(mixer_prefs, "send_base_meshes", text="Send Base Meshes") layout.prop(mixer_prefs, "send_baked_meshes", text="Send Baked Meshes") layout.prop(mixer_prefs, "commands_send_interval") layout.prop(mixer_prefs, "display_own_gizmos") layout.prop(mixer_prefs, "display_ids_gizmos")
def draw_layout(cls, layout: bpy.types.UILayout, scene: bpy.types.Scene): layout.prop(scene.m3_export_options, "modlVersion") layout.prop(scene.m3_export_options, "animationExportAmount")