Search is not available for this dataset
text
stringlengths
75
104k
def curl_rim(script, curl_radius=None, start_radius=None, end_radius=None, end_height=None): """ flare_radius must be >= z2 (height) r2 max = flare_radius + r r2 (num): radius of mesh at end of flare +15 r= 8.8205 -15 r= 1.1795 z=10, 5 +/-15 - +/-15*0.745355992499...
def wrap2cylinder(script, radius=1, pitch=0, taper=0, pitch_func=None, taper_func=None): """Deform mesh around cylinder of radius and axis z y = 0 will be on the surface of radius "radius" pitch != 0 will create a helix, with distance "pitch" traveled in z for each rotation taper = ch...
def bend(script, radius=1, pitch=0, taper=0, angle=0, straght_start=True, straght_end=False, radius_limit=None, outside_limit_end=True): """Bends mesh around cylinder of radius radius and axis z to a certain angle straight_ends: Only apply twist (pitch) over the area that is bent outside_limit_en...
def deform2curve(script, curve=mp_func.torus_knot('t'), step=0.001): """ Deform a mesh along a parametric curve function Provide a parametric curve function with z as the parameter. This will deform the xy cross section of the mesh along the curve as z increases. Source: http://blackpawn.com/texts/pqt...
def vc2tex(script, tex_name='TEMP3D_texture.png', tex_width=1024, tex_height=1024, overwrite_tex=False, assign_tex=False, fill_tex=True): """Transfer vertex colors to texture colors Args: script: the FilterScript object or script filename to write the filter to. ...
def mesh2fc(script, all_visible_layers=False): """Transfer mesh colors to face colors Args: script: the FilterScript object or script filename to write the filter to. all_visible_layers (bool): If true the color mapping is applied to all the meshes """ filter_xml = ''.join([...
def vert_attr_2_meshes(script, source_mesh=0, target_mesh=1, geometry=False, normal=False, color=True, quality=False, selection=False, quality_distance=False, max_distance=0.5): """Vertex Attribute Transfer (between 2 meshes) ...
def vert_attr2tex_2_meshes(script, source_mesh=0, target_mesh=1, attribute=0, max_distance=0.5, tex_name='TEMP3D_texture.png', tex_width=1024, tex_height=1024, overwrite_tex=True, assign_tex=False, fill_tex=True)...
def tex2vc_2_meshes(script, source_mesh=0, target_mesh=1, max_distance=0.5): """Transfer texture colors to vertex colors (between 2 meshes) Args: script: the FilterScript object or script filename to write the filter to. source_mesh (int): The mesh with associated texture that we wa...
def simplify(script, texture=True, faces=25000, target_perc=0.0, quality_thr=0.3, preserve_boundary=False, boundary_weight=1.0, optimal_placement=True, preserve_normal=False, planar_quadric=False, selected=False, extra_tex_coord_weight=1.0, preserve_topology=True, qua...
def uniform_resampling(script, voxel=1.0, offset=0.0, merge_vert=True, discretize=False, multisample=False, thicken=False): """ Create a new mesh that is a resampled version of the current one. The resampling is done by building a uniform volumetric representation where each voxel co...
def hull(script, reorient_normal=True): """ Calculate the convex hull with Qhull library http://www.qhull.org/html/qconvex.htm The convex hull of a set of points is the boundary of the minimal convex set containing the given non-empty finite set of points. Args: script: the FilterScrip...
def surface_poisson(script, octree_depth=10, solver_divide=8, samples_per_node=1.0, offset=1.0): """ Use the points and normals to build a surface using the Poisson Surface reconstruction approach. Args: script: the FilterScript object or script filename to write ...
def surface_poisson_screened(script, visible_layer=False, depth=8, full_depth=5, cg_depth=0, scale=1.1, samples_per_node=1.5, point_weight=4.0, iterations=8, confidence=False, pre_clean=False): """ This surface reconstruction alg...
def curvature_flipping(script, angle_threshold=1.0, curve_type=0, selected=False): """ Use the points and normals to build a surface using the Poisson Surface reconstruction approach. Args: script: the FilterScript object or script filename to write the filter...
def voronoi(script, hole_num=50, target_layer=None, sample_layer=None, thickness=0.5, backward=True): """ Turn a model into a surface with Voronoi style holes in it References: http://meshlabstuff.blogspot.com/2009/03/creating-voronoi-sphere.html http://meshlabstuff.blogspot.com/2009/04/creating-vorono...
def all(script, face=True, vert=True): """ Select all the faces of the current mesh Args: script: the FilterScript object or script filename to write the filter to. faces (bool): If True the filter will select all the faces. verts (bool): If True the filter will select all t...
def grow(script, iterations=1): """ Grow (dilate, expand) the current set of selected faces Args: script: the FilterScript object or script filename to write the filter to. iterations (int): the number of times to grow the selection. Layer stack: No impacts MeshLab...
def shrink(script, iterations=1): """ Shrink (erode, reduce) the current set of selected faces Args: script: the FilterScript object or script filename to write the filter to. iterations (int): the number of times to shrink the selection. Layer stack: No impacts Me...
def small_parts(script, ratio=0.2, non_closed_only=False): """ Select the small disconnected parts (components) of a mesh. Args: script: the FilterScript object or script filename to write the filter to. ratio (float): This ratio (between 0 and 1) defines the meaning of ...
def vert_quality(script, min_quality=0.0, max_quality=0.05, inclusive=True): """ Select all the faces and vertexes within the specified vertex quality range. Args: script: the FilterScript object or script filename to write the filter] to. min_quality (float): Minimum accept...
def face_function(script, function='(fi == 0)'): """Boolean function using muparser lib to perform face selection over current mesh. See help(mlx.muparser_ref) for muparser reference documentation. It's possible to use parenthesis, per-vertex variables and boolean operator: (, ), and, or, ...
def vert_function(script, function='(q < 0)', strict_face_select=True): """Boolean function using muparser lib to perform vertex selection over current mesh. See help(mlx.muparser_ref) for muparser reference documentation. It's possible to use parenthesis, per-vertex variables and boolean operator: ...
def cylindrical_vert(script, radius=1.0, inside=True): """Select all vertices within a cylindrical radius Args: radius (float): radius of the sphere center_pt (3 coordinate tuple or list): center point of the sphere Layer stack: No impacts MeshLab versions: 2016.12 ...
def spherical_vert(script, radius=1.0, center_pt=(0.0, 0.0, 0.0)): """Select all vertices within a spherical radius Args: radius (float): radius of the sphere center_pt (3 coordinate tuple or list): center point of the sphere Layer stack: No impacts MeshLab versions: 2...
def join(script, merge_visible=True, merge_vert=False, delete_layer=True, keep_unreferenced_vert=False): """ Flatten all or only the visible layers into a single new mesh. Transformations are preserved. Existing layers can be optionally deleted. Args: script: the mlx.FilterScript obje...
def delete(script, layer_num=None): """ Delete layer Args: script: the mlx.FilterScript object or script filename to write the filter to. layer_num (int): the number of the layer to delete. Default is the current layer. Not supported on the file base API. Layer stac...
def rename(script, label='blank', layer_num=None): """ Rename layer label Can be useful for outputting mlp files, as the output file names use the labels. Args: script: the mlx.FilterScript object or script filename to write the filter to. label (str): new label for the mes...
def change(script, layer_num=None): """ Change the current layer by specifying the new layer number. Args: script: the mlx.FilterScript object or script filename to write the filter to. layer_num (int): the number of the layer to change to. Default is the last layer if s...
def duplicate(script, layer_num=None): """ Duplicate a layer. New layer label is '*_copy'. Args: script: the mlx.FilterScript object or script filename to write the filter to. layer_num (int): layer number to duplicate. Default is the current layer. Not supported on...
def split_parts(script, part_num=None, layer_num=None): """ Split current layer into many layers, one for each part (connected component) Mesh is split so that the largest part is the lowest named layer "CC 0" and the smallest part is the highest numbered "CC" layer. Args: script: the ...
def delete_lower(script, layer_num=None): """ Delete all layers below the specified one. Useful for MeshLab ver 2016.12, whcih will only output layer 0. """ if layer_num is None: layer_num = script.current_layer() if layer_num != 0: change(script, 0) for i in range(layer_num): ...
def handle_error(program_name, cmd, log=None): """Subprocess program error handling Args: program_name (str): name of the subprocess program Returns: break_now (bool): indicate whether calling program should break out of loop """ print('\nHouston, we have a problem.', '\...
def run(script='TEMP3D_default.mlx', log=None, ml_log=None, mlp_in=None, mlp_out=None, overwrite=False, file_in=None, file_out=None, output_mask=None, cmd=None, ml_version=ML_VERSION, print_meshlabserver_output=True): """Run meshlabserver in a subprocess. Args: log (str): filena...
def find_texture_files(fbasename, log=None): """Finds the filenames of the referenced texture file(s) (and material file for obj) for the mesh. Args: fbasename (str): input filename. Supported file extensions: obj ply dae x3d wrl l...
def default_output_mask(file_out, texture=True, vert_normals=True, vert_colors=False, face_colors=False, ml_version=ML_VERSION): """ Set default output mask options based on file extension Note: v1.34BETA changed -om switch to -m Possible options (not all options are available fo...
def begin(script='TEMP3D_default.mlx', file_in=None, mlp_in=None): """Create new mlx script and write opening tags. Performs special processing on stl files. If no input files are provided this will create a dummy file and delete it as the first filter. This works around the meshlab limitation tha...
def create_mlp(file_out, mlp_mesh=None, mlp_raster=None): """ Create mlp file mlp_mesh (list containing dictionary) filename* label matrix mlp_raster filename* label semantic camera trans_vector* rotation_matrix* fo...
def add_layer(self, label, change_layer=True): """ Add new mesh layer to the end of the stack Args: label (str): new label for the mesh layer change_layer (bool): change to the newly created layer """ self.layer_stack.insert(self.last_layer() + 1, label) ...
def del_layer(self, layer_num): """ Delete mesh layer """ del self.layer_stack[layer_num] # Adjust current layer if needed if layer_num < self.current_layer(): self.set_current_layer(self.current_layer() - 1) return None
def save_to_file(self, script_file): """ Save filter script to an mlx file """ # TODO: rasie exception here instead? if not self.filters: print('WARNING: no filters to save to file!') script_file_descriptor = open(script_file, 'w') script_file_descriptor.write(''.join...
def run_script(self, log=None, ml_log=None, mlp_out=None, overwrite=False, file_out=None, output_mask=None, script_file=None, print_meshlabserver_output=True): """ Run the script """ temp_script = False temp_ml_log = False if self.__no_file_in: # ...
def main(): """Run main script""" # segments = number of segments to use for circles segments = 50 # star_points = number of points (or sides) of the star star_points = 5 # star_radius = radius of circle circumscribing the star star_radius = 2 # ring_thickness = thickness of the colored ...
def small_parts(script, ratio=0.2, non_closed_only=False): """ Select & delete the small disconnected parts (components) of a mesh. Args: script: the FilterScript object or script filename to write the filter to. ratio (float): This ratio (between 0 and 1) defines the meaning of ...
def selected(script, face=True, vert=True): """ Delete selected vertices and/or faces Note: if the mesh has no faces (e.g. a point cloud) you must set face=False, or the vertices will not be deleted Args: script: the FilterScript object or script filename to write the filter to. ...
def unreferenced_vert(script): """ Check for every vertex on the mesh: if it is NOT referenced by a face, removes it. Args: script: the FilterScript object or script filename to write the filter to. Layer stack: No impacts MeshLab versions: 2016.12 ...
def duplicate_verts(script): """ "Check for every vertex on the mesh: if there are two vertices with the same coordinates they are merged into a single one. Args: script: the FilterScript object or script filename to write the filter to. Layer stack: No impacts Mes...
def hausdorff_distance(script, sampled_layer=1, target_layer=0, save_sample=False, sample_vert=True, sample_edge=True, sample_faux_edge=False, sample_face=True, sample_num=1000, maxdist=10): """ Compute the Hausdorff Distance between two meshes, s...
def poisson_disk(script, sample_num=1000, radius=0.0, montecarlo_rate=20, save_montecarlo=False, approx_geodesic_dist=False, subsample=False, refine=False, refine_layer=0, best_sample=True, best_sample_pool=10, exact_num=False, radius_variance=1.0): ...
def mesh_element(script, sample_num=1000, element='VERT'): """ Create a new layer populated with a point sampling of the current mesh, at most one sample for each element of the mesh is created. Samples are taking in a uniform way, one for each element (vertex/edge/face); all the elements have the ...
def clustered_vert(script, cell_size=1.0, strategy='AVERAGE', selected=False): """ "Create a new layer populated with a subsampling of the vertexes of the current mesh The subsampling is driven by a simple one-per-gridded cell strategy. Args: script: the FilterScript object or script filen...
def flat_plane(script, plane=0, aspect_ratio=False): """Flat plane parameterization """ filter_xml = ''.join([ ' <filter name="Parametrization: Flat Plane ">\n', ' <Param name="projectionPlane"', 'value="%d"' % plane, 'description="Projection plane"', 'enum_val0=...
def per_triangle(script, sidedim=0, textdim=1024, border=2, method=1): """Trivial Per-Triangle parameterization """ filter_xml = ''.join([ ' <filter name="Parametrization: Trivial Per-Triangle ">\n', ' <Param name="sidedim"', 'value="%d"' % sidedim, 'description="Quads p...
def voronoi(script, region_num=10, overlap=False): """Voronoi Atlas parameterization """ filter_xml = ''.join([ ' <filter name="Parametrization: Voronoi Atlas">\n', ' <Param name="regionNum"', 'value="%d"' % region_num, 'description="Approx. Region Num"', 'type="...
def isometric(script, targetAbstractMinFaceNum=140, targetAbstractMaxFaceNum=180, stopCriteria=1, convergenceSpeed=1, DoubleStep=True): """Isometric parameterization """ filter_xml = ''.join([ ' <filter name="Iso Parametrization">\n', ' <Param name="targetAbstractMinFaceNu...
def isometric_build_atlased_mesh(script, BorderSize=0.1): """Isometric parameterization: Build Atlased Mesh This actually generates the UV mapping from the isometric parameterization """ filter_xml = ''.join([ ' <filter name="Iso Parametrization Build Atlased Mesh">\n', ' <Param na...
def isometric_save(script, AbsName="TEMP3D.abs"): """Isometric parameterization: Save Abstract Domain """ filter_xml = ''.join([ ' <filter name="Iso Parametrization Save Abstract Domain">\n', ' <Param name="AbsName"', 'value="%s"' % AbsName, 'description="Abstract Mesh f...
def isometric_load(script, AbsName="TEMP3D.abs"): """Isometric parameterization: Load Abstract Domain """ filter_xml = ''.join([ ' <filter name="Iso Parametrization Load Abstract Domain">\n', ' <Param name="AbsName"', 'value="%s"' % AbsName, 'description="Abstract Mesh f...
def isometric_transfer(script, sourceMesh=0, targetMesh=1): """Isometric parameterization: transfer between meshes Provide the layer numbers of the source and target meshes. """ filter_xml = ''.join([ ' <filter name="Iso Parametrization transfer between meshes">\n', ' <Param name="...
def isometric_remesh(script, SamplingRate=10): """Isometric parameterization: remeshing """ filter_xml = ''.join([ ' <filter name="Iso Parametrization Remeshing">\n', ' <Param name="SamplingRate"', 'value="%d"' % SamplingRate, 'description="Sampling Rate"', 'type...
def set_texture(script, textName="TEMP3D.png", textDim=1024): """Set texture """ filter_xml = ''.join([ ' <filter name="Set Texture">\n', ' <Param name="textName"', 'value="%s"' % textName, 'description="Texture file"', 'type="RichString"', 'tooltip="If t...
def project_rasters(script, tex_file_out="TEMP3D.png", tex_size=1024, fill_atlas_gaps=False, depth_threshold=0.5, selected=False, use_angle=True, use_distance=True, use_borders=True, use_silhouettes=True, use_alpha=False): """Set texture Creates new t...
def param_texture_from_rasters(script, textName="TEMP3D.png", texsize=1024, colorCorrection=True, colorCorrectionFilterSize=1, useDistanceWeight=True, useImgBorderWeight=True, useAlphaWeight=False, cleanIsolatedTriangles=True, ...
def param_from_rasters(script, useDistanceWeight=True, useImgBorderWeight=True, useAlphaWeight=False, cleanIsolatedTriangles=True, stretchingAllowed=False, textureGutter=4): """Set texture """ filter_xml = ''.join([ ' <filter name="Parameterization fro...
def section(script, axis='z', offset=0.0, surface=False, custom_axis=None, planeref=2): """ Compute the polyline representing a planar section (a slice) of a mesh. If the resulting polyline is closed the result can be filled with a triangular mesh representing the section. Args: sc...
def measure_geometry(script): """ Compute a set of geometric measures of a mesh/pointcloud. Bounding box extents and diagonal, principal axis, thin shell barycenter (mesh only), vertex barycenter and quality-weighted barycenter (pointcloud only), surface area (mesh only), volume (closed mesh) and Inert...
def measure_topology(script): """ Compute a set of topological measures over a mesh Args: script: the mlx.FilterScript object or script filename to write the filter to. Layer stack: No impacts MeshLab versions: 2016.12 1.3.4BETA """ filter_xml = ' ...
def parse_geometry(ml_log, log=None, ml_version='2016.12', print_output=False): """Parse the ml_log file generated by the measure_geometry function. Warnings: Not all keys may exist if mesh is not watertight or manifold Args: ml_log (str): MeshLab log file to parse log (str): filename to l...
def parse_topology(ml_log, log=None, ml_version='1.3.4BETA', print_output=False): """Parse the ml_log file generated by the measure_topology function. Args: ml_log (str): MeshLab log file to parse log (str): filename to log output Returns: dict: dictionary with the following keys: ...
def parse_hausdorff(ml_log, log=None, print_output=False): """Parse the ml_log file generated by the hausdorff_distance function. Args: ml_log (str): MeshLab log file to parse log (str): filename to log output Returns: dict: dictionary with the following keys: number_po...
def function(script, red=255, green=255, blue=255, alpha=255, color=None): """Color function using muparser lib to generate new RGBA color for every vertex Red, Green, Blue and Alpha channels may be defined by specifying a function for each. See help(mlx.muparser_ref) for muparser reference do...
def voronoi(script, target_layer=0, source_layer=1, backward=True): """ Given a Mesh 'M' and a Pointset 'P', the filter projects each vertex of P over M and color M according to the geodesic distance from these projected points. Projection and coloring are done on a per vertex basis. Ar...
def cyclic_rainbow(script, direction='sphere', start_pt=(0, 0, 0), amplitude=255 / 2, center=255 / 2, freq=0.8, phase=(0, 120, 240, 0), alpha=False): """ Color mesh vertices in a repeating sinusiodal rainbow pattern Sine wave follows the following equation for each color c...
def mp_atan2(y, x): """muparser atan2 function Implements an atan2(y,x) function for older muparser versions (<2.1.0); atan2 was added as a built-in function in muparser 2.1.0 Args: y (str): y argument of the atan2(y,x) function x (str): x argument of the atan2(y,x) function Retur...
def v_cross(u, v): """muparser cross product function Compute the cross product of two 3x1 vectors Args: u (list or tuple of 3 strings): first vector v (list or tuple of 3 strings): second vector Returns: A list containing a muparser string of the cross product """ """ ...
def v_multiply(scalar, v1): """ Multiply vector by scalar""" vector = [] for i, x in enumerate(v1): vector.append('(({})*({}))'.format(scalar, v1[i])) return vector
def torus_knot(t, p=3, q=4, scale=1.0, radius=2.0): """ A tight (small inner crossings) (p,q) torus knot parametric curve Source (for trefoil): https://en.wikipedia.org/wiki/Trefoil_knot """ return ['{scale}*(sin({t}) + ({radius})*sin({p}*({t})))'.format(t=t, p=p, scale=scale, radius=radius), ...
def vert_attr(script, name='radius', function='x^2 + y^2'): """ Add a new Per-Vertex scalar attribute to current mesh and fill it with the defined function. The specified name can be used in other filter functions. It's possible to use parenthesis, per-vertex variables and boolean operator: ...
def vq_function(script, function='vi', normalize=False, color=False): """:Quality function using muparser to generate new Quality for every vertex<br>It's possibile to use the following per-vertex variables in the expression:<br>x, y, z, nx, ny, nz (normal), r, g, b (color), q (quality), rad, vi, <br>and all custom...
def quatrefoil(): """ Rainbow colored voronoi quatrefoil (3,4) torus knot """ start_time = time.time() os.chdir(THIS_SCRIPTPATH) #ml_version = '1.3.4BETA' ml_version = '2016.12' # Add meshlabserver directory to OS PATH; omit this if it is already in # your PATH meshlabserver_path = 'C:...
def flip(script, force_flip=False, selected=False): """ Invert faces orientation, flipping the normals of the mesh. If requested, it tries to guess the right orientation; mainly it decides to flip all the faces if the minimum/maximum vertexes have not outward point normals for a few directions. Works w...
def point_sets(script, neighbors=10, smooth_iteration=0, flip=False, viewpoint_pos=(0.0, 0.0, 0.0)): """ Compute the normals of the vertices of a mesh without exploiting the triangle connectivity, useful for dataset with no faces. Args: script: the FilterScript object or script f...
def laplacian(script, iterations=1, boundary=True, cotangent_weight=True, selected=False): """ Laplacian smooth of the mesh: for each vertex it calculates the average position with nearest vertex Args: script: the FilterScript object or script filename to write the fil...
def taubin(script, iterations=10, t_lambda=0.5, t_mu=-0.53, selected=False): """ The lambda & mu Taubin smoothing, it make two steps of smoothing, forth and back, for each iteration. Based on: Gabriel Taubin "A signal processing approach to fair surface design" Siggraph 1995 Args: ...
def twostep(script, iterations=3, angle_threshold=60, normal_steps=20, fit_steps=20, selected=False): """ Two Step Smoothing, a feature preserving/enhancing fairing filter. It is based on a Normal Smoothing step where similar normals are averaged together and a step where the vertexes are fitte...
def depth(script, iterations=3, viewpoint=(0, 0, 0), selected=False): """ A laplacian smooth that is constrained to move vertices only along the view direction. Args: script: the FilterScript object or script filename to write the filter to. iterations (int): The number of t...
def measure_aabb(fbasename=None, log=None, coord_system='CARTESIAN'): """ Measure the axis aligned bounding box (aabb) of a mesh in multiple coordinate systems. Args: fbasename (str): filename of input model log (str): filename of log file coord_system (enum in ['CARTESIAN', 'CYLIND...
def measure_section(fbasename=None, log=None, axis='z', offset=0.0, rotate_x_angle=None, ml_version=ml_version): """Measure a cross section of a mesh Perform a plane cut in one of the major axes (X, Y, Z). If you want to cut on a different plane you will need to rotate the model in ...
def polylinesort(fbasename=None, log=None): """Sort separate line segments in obj format into a continuous polyline or polylines. NOT FINISHED; DO NOT USE Also measures the length of each polyline Return polyline and polylineMeta (lengths) """ fext = os.path.splitext(fbasename)[1][1:].strip()...
def measure_topology(fbasename=None, log=None, ml_version=ml_version): """Measures mesh topology Args: fbasename (str): input filename. log (str): filename to log output Returns: dict: dictionary with the following keys: vert_num (int): number of vertices ed...
def measure_all(fbasename=None, log=None, ml_version=ml_version): """Measures mesh geometry, aabb and topology.""" ml_script1_file = 'TEMP3D_measure_gAndT.mlx' if ml_version == '1.3.4BETA': file_out = 'TEMP3D_aabb.xyz' else: file_out = None ml_script1 = mlx.FilterScript(file_in=fbas...
def measure_dimension(fbasename=None, log=None, axis1=None, offset1=0.0, axis2=None, offset2=0.0, ml_version=ml_version): """Measure a dimension of a mesh""" axis1 = axis1.lower() axis2 = axis2.lower() ml_script1_file = 'TEMP3D_measure_dimension.mlx' file_out = 'TEMP3D_measure_...
def lowercase_ext(filename): """ This is a helper used by UploadSet.save to provide lowercase extensions for all processed files, to compare with configured extensions in the same case. .. versionchanged:: 0.1.4 Filenames without extensions are no longer lowercased, only the extension...
def patch_request_class(app, size=64 * 1024 * 1024): """ By default, Flask will accept uploads to an arbitrary size. While Werkzeug switches uploads from memory to a temporary file when they hit 500 KiB, it's still possible for someone to overload your disk space with a gigantic file. This patc...
def config_for_set(uset, app, defaults=None): """ This is a helper function for `configure_uploads` that extracts the configuration for a single set. :param uset: The upload set. :param app: The app to load the configuration from. :param defaults: A dict with keys `url` and `dest` from the ...
def configure_uploads(app, upload_sets): """ Call this after the app has been configured. It will go through all the upload sets, get their configuration, and store the configuration on the app. It will also register the uploads module if it hasn't been set. This can be called multiple times with di...
def config(self): """ This gets the current configuration. By default, it looks up the current application and gets the configuration from there. But if you don't want to go to the full effort of setting an application, or it's otherwise outside of a request context, set the `_co...
def url(self, filename): """ This function gets the URL a file uploaded to this set would be accessed at. It doesn't check whether said file exists. :param filename: The filename to return the URL for. """ base = self.config.base_url if base is None: ...
def path(self, filename, folder=None): """ This returns the absolute path of a file uploaded to this set. It doesn't actually check whether said file exists. :param filename: The filename to return the path for. :param folder: The subfolder within the upload set previously used ...
def extension_allowed(self, ext): """ This determines whether a specific extension is allowed. It is called by `file_allowed`, so if you override that but still want to check extensions, call back into this. :param ext: The extension to check, without the dot. """ ...