def execute(self, context): try: mesh = bpy.data.objects[self.currentobject]; except: mesh = context.active_object; if(mesh is not None): heat_colors, k = getHKSColors(context, mesh, mesh.eigen_k, mesh.hks_t, mesh.hks_current_t); pp = mesh.post_process_colors; ppmin = mesh.post_process_min; ppmax = mesh.post_process_max; applyColoringForMeshErrors(context, mesh, heat_colors, v_group_name='hks', use_weights=False, use_histogram_preprocess=pp, percent_min=ppmin, percent_max=ppmax); if(mesh.spectral_sync): paired_mesh = detectMorN(mesh); # pp = paired_mesh.post_process_colors; # ppmin = paired_mesh.post_process_min; # ppmax = paired_mesh.post_process_max; if(paired_mesh): heat_colors, k = getHKSColors(context, paired_mesh, mesh.eigen_k, mesh.hks_t, mesh.hks_current_t); applyColoringForMeshErrors(context, paired_mesh, heat_colors, v_group_name='hks', use_weights=False, use_histogram_preprocess=pp, percent_min=ppmin, percent_max=ppmax); return{'FINISHED'};
def execute(self, context): try: mesh = bpy.data.objects[self.currentobject]; except: mesh = context.active_object; if(mesh is not None): gisif_colors, k, gisif_name = getGISIFColorsInner(context, mesh); mesh.gisif_group_name = gisif_name; mesh.gisif_signatures.clear(); if(not mesh.gisif_symmetries or not len(mesh.generic_landmarks)): normalized_gisifs = np.interp(gisif_colors, (gisif_colors.min(), gisif_colors.max()), (0.0,1.0)); else: if(len(mesh.generic_landmarks)): mindex = min(len(mesh.generic_landmarks), mesh.gisif_symmetry_index) - 1; marker = mesh.generic_landmarks[mindex]; bmarker = getBlenderMarker(mesh, marker); bpy.ops.object.select_all(action="DESELECT"); bmarker.select = True; indices = np.array(marker.v_indices); uvw = np.array(marker.v_ratios); o_vid = indices[np.argmax(uvw)]; normalized_gisifs = gisif_colors / np.sqrt(np.sum(gisif_colors**2)); delta_gisif_colors = np.sqrt((normalized_gisifs[o_vid] - normalized_gisifs)**2); normalized_gisifs = np.interp(delta_gisif_colors, (delta_gisif_colors.min(), delta_gisif_colors.max()), (0.0,1.0)); pp = mesh.post_process_colors; ppmin = mesh.post_process_min; ppmax = mesh.post_process_max; applyColoringForMeshErrors(context, mesh, normalized_gisifs, v_group_name='gisif', use_weights=False, use_histogram_preprocess=pp, percent_min=ppmin, percent_max=ppmax); if(mesh.spectral_sync): paired_mesh = detectMorN(mesh); # pp = paired_mesh.post_process_colors; # ppmin = paired_mesh.post_process_min; # ppmax = paired_mesh.post_process_max; if(paired_mesh): gisif_colors, k, gisif_name = getGISIFColorsInner(context, mesh, applyMesh=paired_mesh); paired_mesh.gisif_group_name = gisif_name; normalized_gisifs = np.interp(gisif_colors, (gisif_colors.min(), gisif_colors.max()), (0.0,1.0)); applyColoringForMeshErrors(context, paired_mesh, normalized_gisifs, v_group_name='gisif', use_weights=False, use_histogram_preprocess=pp, percent_min=ppmin, percent_max=ppmax); return{'FINISHED'};
def execute(self, context): try: mesh = bpy.data.objects[self.currentobject]; except: mesh = context.active_object; if(mesh is not None): if(self.use_eigen_k != -1): self.applySpectralShape(context, mesh, self.use_eigen_k); else: self.applySpectralShape(context, mesh, mesh.eigen_k); if(mesh.spectral_sync): paired_mesh = detectMorN(mesh); if(paired_mesh): self.applySpectralShape(context, paired_mesh, mesh.eigen_k); return{'FINISHED'};
def execute(self, context): try: mesh = bpy.data.objects[self.currentobject] except: mesh = context.active_object if (mesh is not None): wks_colors, k = getWKSColors(context, mesh, mesh.eigen_k, mesh.wks_e, mesh.wks_current_e, mesh.wks_variance) pp = mesh.post_process_colors ppmin = mesh.post_process_min ppmax = mesh.post_process_max applyColoringForMeshErrors(context, mesh, wks_colors, v_group_name='wks', use_weights=False, use_histogram_preprocess=pp, percent_min=ppmin, percent_max=ppmax) if (mesh.spectral_sync): paired_mesh = detectMorN(mesh) # pp = paired_mesh.post_process_colors; # ppmin = paired_mesh.post_process_min; # ppmax = paired_mesh.post_process_max; if (paired_mesh): wks_colors, k = getWKSColors(context, paired_mesh, mesh.eigen_k, mesh.wks_e, mesh.wks_current_e, mesh.wks_variance) applyColoringForMeshErrors(context, paired_mesh, wks_colors, v_group_name='wks', use_weights=False, use_histogram_preprocess=pp, percent_min=ppmin, percent_max=ppmax) return {'FINISHED'}