How to use addprops method in fMBT

Best Python code snippet using fMBT_python

handlers.py

Source:handlers.py Github

copy

Full Screen

1#-------------------------------------------------------------------2# handlers.py3# Purpose: Handler classes for WaxRF support4# Author: Jason Gedge5#6# TODO:7# - Provide a facility to use the ArtProvider8# (put this in WaxRF_LoadImage)9# - ToolBar support, but Wax needs this first! :)10# - StatusBar support? (maybe load a panel setup?)11# - More work for StyledTextBoxHandler (colors, lexer, etc)12#-------------------------------------------------------------------13import wax14import imgcoder15import wax.tools.wizard16import wx17from bitmapcombobox import BitmapComboBox18##################################################################################19def get_and_delete(dict, key, default):20 """ checks for the item in the dictionary, and if it exists it will be21 be returned and deleted. """22 value = dict.get(key, default)23 if key in dict:24 del dict[key]25 return value26def WaxRF_LoadImage(bmpref, waxrf):27 bmp = waxrf.LoadImage(bmpref)28 if bmp: return bmp29 bmp = wax.BitmapFromFile(bmpref)30 if bmp: return bmp31 raise ValueError('could not load bitmap for staticbitmap')32##################################################################################33class BasicHandler:34 def __init__(self, control, attribs, addprops, children, waxrf):35 self.control = control36 self.attribs = attribs37 self.addprops = addprops38 self.children = children39 self.waxrf = waxrf40 def Handle(self, parent):41 object = wax.__dict__[self.control](parent, **self.attribs)42 if self._objname:43 setattr(parent, self._objname, object)44 return object45##################################################################################46class BasicContainerHandler:47 def __init__(self, control, attribs, addprops, children, waxrf):48 self.control = control49 self.attribs = attribs50 self.addprops = addprops51 self.children = children52 self.waxrf = waxrf53 def Handle(self, parent):54 object = wax.__dict__[self.control](parent, **self.attribs)55 if self._objname:56 setattr(parent, self._objname, object)57 # load all its children, pack it, and return it58 for child in self.children:59 cobject = child.Handle(object)60 border, align, expand = child.addprops61 object.AddComponent(cobject, border=border, expand=expand, align=align)62 object.Pack()63 return object64##################################################################################65class XMLSimpleDialog(wax.CustomDialog):66 def __init__(self, parent, children, *args, **kwargs):67 self.children = children68 wax.CustomDialog.__init__(self, parent, *args, **kwargs)69 def Body(self):70 # load all its children, pack it, and return it71 for child in self.children:72 cobject = child.Handle(self)73 border, align, expand = child.addprops74 self.AddComponent(cobject, border=border, expand=expand, align=align)75class XMLDialog(wax.Dialog):76 def __init__(self, parent, children, *args, **kwargs):77 self.children = children78 wax.Dialog.__init__(self, parent, *args, **kwargs)79 def Body(self):80 # load all its children, pack it, and return it81 for child in self.children:82 cobject = child.Handle(self)83 border, align, expand = child.addprops84 self.AddComponent(cobject, border=border, expand=expand, align=align)85class DialogHandler:86 def __init__(self, control, attribs, addprops, children, waxrf):87 self.control = control88 self.attribs = attribs89 self.addprops = addprops90 self.children = children91 self.waxrf = waxrf92 self.buttonpanel = bool(get_and_delete(self.attribs, 'buttonpanel', False))93 def Handle(self, parent):94 if self.buttonpanel:95 object = XMLDialog(parent, self.children, **self.attribs)96 else:97 object = XMLSimpleDialog(parent, self.children, **self.attribs)98 if self._objname:99 setattr(parent, self._objname, object)100 return object101##################################################################################102class GridHandler:103 # note:104 # --- children, in order, are added left to right, top to bottom105 def __init__(self, control, attribs, addprops, children, waxrf):106 self.control = control107 self.attribs = attribs108 self.addprops = addprops109 self.children = children110 self.waxrf = waxrf111 def Handle(self, parent):112 object = wax.GridPanel(parent, **self.attribs)113 if self._objname:114 setattr(parent, self._objname, object)115 rows = self.attribs.get('rows', 1)116 cols = self.attribs.get('cols', 1)117 crow = 0118 ccol = 0119 # load all its children, pack it, and return it120 for child in self.children:121 # make sure crow/ccol is restricted correctly122 if ccol >= cols:123 ccol = 0124 crow += 1125 if crow >= rows:126 break127 # add the child128 cobject = child.Handle(object)129 border, align, expand = child.addprops130 object.AddComponent(ccol, crow, cobject, border=border, expand=expand, align=align)131 # increment the column132 ccol += 1133 object.Pack()134 return object135##################################################################################136class FlexGridHandler:137 # note:138 # --- children, in order, are added left to right, top to bottom139 def __init__(self, control, attribs, addprops, children, waxrf):140 self.control = control141 self.attribs = attribs142 self.addprops = addprops143 self.children = children144 self.waxrf = waxrf145 gcols = get_and_delete(self.attribs, 'gcols', '').split(',')146 grows = get_and_delete(self.attribs, 'grows', '').split(',')147 self.rows = self.attribs.get('rows', 1)148 self.cols = self.attribs.get('cols', 1)149 # make sure the right amount of children exists150 assert len(self.children) == self.rows * self.cols151 # fetch the growable rows and cols152 if grows:153 self.grows = []154 for x in grows:155 try:156 self.grows.append(int(x))157 except:158 pass # XXX exception / error message?!159 if gcols:160 self.gcols = []161 for x in gcols:162 try:163 self.gcols.append(int(x))164 except:165 pass # XXX exception / error message?!166 def Handle(self, parent):167 object = wax.FlexGridPanel(parent, **self.attribs)168 if self._objname:169 setattr(parent, self._objname, object)170 for x in self.grows:171 object.AddGrowableRow(x)172 for x in self.gcols:173 object.AddGrowableCol(x)174 crow = 0175 ccol = 0176 # load all its children, pack it, and return it177 for child in self.children:178 # make sure crow/ccol is restricted correctly179 if ccol >= self.cols:180 ccol = 0181 crow += 1182 if crow >= self.rows:183 break184 # add the child185 cobject = child.Handle(object)186 border, align, expand = child.addprops187 object.AddComponent(ccol, crow, cobject, border=border, expand=expand, align=align)188 # increment the column189 ccol += 1190 object.Pack()191 return object192##################################################################################193class SplitterHandler:194 def __init__(self, control, attribs, addprops, children, waxrf):195 self.control = control196 self.attribs = attribs197 self.addprops = addprops198 self.children = children199 self.waxrf = waxrf200 self.direction = get_and_delete(self.attribs, 'direction', 'h')201 self.sashpos = get_and_delete(self.attribs, 'sashposition', 100)202 self.minsize = get_and_delete(self.attribs, 'minsize', 20)203 # make sure the right amount of children exists204 assert len(self.children) == 2205 def Handle(self, parent):206 object = wax.Splitter(parent, **self.attribs)207 if self._objname:208 setattr(parent, self._objname, object)209 # load all its children, pack it, and return it210 win1 = self.children[0].Handle(object)211 win2 = self.children[1].Handle(object)212 # split it213 object.Split(win1, win2, self.direction, self.sashpos, self.minsize)214 return object215##################################################################################216class MenuHandler:217 def __init__(self, control, attribs, addprops, children, waxrf):218 self.control = control219 self.attribs = attribs220 self.addprops = addprops221 self.children = children222 self.waxrf = waxrf223 self.title = get_and_delete(self.attribs, 'text', '')224 def Handle(self, parent):225 object = wax.Menu(parent, **self.attribs)226 if self._objname:227 setattr(parent, self._objname, object)228 # load all its children, pack it, and return it229 for x in self.children:230 if x.control == "MenuItem":231 item = object.Append( x.text, **x.attribs )232 if item.IsCheckable(): item.Check(x.checked)233 item.Enable(x.enabled)234 elif x.control == "Separator":235 object.AppendSeparator()236 elif x.control == "Menu":237 object.AppendMenu( x.title, x.Handle(parent) )238 return object239class MenuItemHandler:240 def __init__(self, control, attribs, addprops, children, waxrf):241 self.control = control242 self.attribs = attribs243 self.addprops = addprops244 self.children = children245 self.waxrf = waxrf246 self.text = get_and_delete(self.attribs, 'text', '')247 self.checked = bool(get_and_delete(self.attribs, 'checked', False))248 self.enabled = bool(get_and_delete(self.attribs, 'enabled', True))249 def Handle(self, parent):250 pass251class MenuBarHandler:252 def __init__(self, control, attribs, addprops, children, waxrf):253 self.control = control254 self.attribs = attribs255 self.addprops = addprops256 self.children = children257 self.waxrf = waxrf258 def Handle(self, parent):259 object = wax.MenuBar(parent, **self.attribs)260 if self._objname:261 setattr(parent, self._objname, object)262 for menu in self.children:263 object.Append(menu.Handle(parent), menu.title)264 return object265##################################################################################266class CheckBoxHandler:267 def __init__(self, control, attribs, addprops, children, waxrf):268 self.control = control269 self.attribs = attribs270 self.addprops = addprops271 self.children = children272 self.waxrf = waxrf273 self.state = get_and_delete(self.attribs, 'state', 'unchecked')274 def Handle(self, parent):275 object = wax.CheckBox(parent, **self.attribs)276 if self._objname:277 setattr(parent, self._objname, object)278 object.Set3StateValue(self.state)279 return object280##################################################################################281class CheckListBoxHandler:282 def __init__(self, control, attribs, addprops, children, waxrf):283 self.control = control284 self.attribs = attribs285 self.addprops = addprops286 self.children = children287 self.waxrf = waxrf288 def Handle(self, parent):289 object = wax.CheckListBox(parent, **self.attribs)290 if self._objname:291 setattr(parent, self._objname, object)292 for item in self.children:293 text = item.attribs.get('text', '<no text>')294 checked = bool(item.attribs.get('checked', False))295 index = object.Append(text)296 object.Check(index, checked)297 return object298##################################################################################299class ComboBoxHandler:300 def __init__(self, control, attribs, addprops, children, waxrf):301 self.control = control302 self.attribs = attribs303 self.addprops = addprops304 self.children = children305 self.waxrf = waxrf306 self.text = get_and_delete(self.attribs, 'text', '')307 def Handle(self, parent):308 object = wax.__dict__[self.control](parent, **self.attribs)309 if self._objname:310 setattr(parent, self._objname, object)311 object.SetValue(self.text)312 for item in self.children:313 text = item.attribs.get('text', '<no text>')314 object.Append(text)315 return object316##################################################################################317class ListBoxHandler:318 def __init__(self, control, attribs, addprops, children, waxrf):319 self.control = control320 self.attribs = attribs321 self.addprops = addprops322 self.children = children323 self.waxrf = waxrf324 def Handle(self, parent):325 object = wax.__dict__[self.control](parent, **self.attribs)326 if self._objname:327 setattr(parent, self._objname, object)328 selected = -1329 for item in self.children:330 text = item.attribs.get('text', '<no text>')331 index = object.Append(text)332 if item.attribs.get('selected', False):333 object.SetSelection(index)334 return object335##################################################################################336class ListViewHandler:337 def __init__(self, control, attribs, addprops, children, waxrf):338 self.control = control339 self.attribs = attribs340 self.addprops = addprops341 self.children = children342 self.waxrf = waxrf343 self.columns = get_and_delete(self.attribs, 'columns', '').split(',')344 self.numcols = len(self.columns)345 self.columnwidths = get_and_delete(self.attribs, 'colwidths', ',' * (self.numcols-1)).split(',')346 for x in range(len(self.columnwidths)):347 try:348 self.columnwidths[x] = int(self.columnwidths[x])349 except:350 self.columnwidths[x] = 100351 assert self.numcols > 0352 def Handle(self, parent):353 object = wax.ListView(parent, columns=self.columns, **self.attribs)354 if self._objname:355 setattr(parent, self._objname, object)356 selected = -1357 num = 0358 for row in self.children:359 num = self._handlerow(object, row, num)360 return object361 def _handlerow(self, lv, row, num):362 assert len(row.children) <= self.numcols363 new_num = row.attribs.get('num', num)364 for col in range(len(row.children)):365 lv[new_num, col] = row.children[col].textValue366 return new_num + 1367##################################################################################368class ToggleButtonHandler:369 def __init__(self, control, attribs, addprops, children, waxrf):370 self.control = control371 self.attribs = attribs372 self.addprops = addprops373 self.children = children374 self.waxrf = waxrf375 self.state = bool(get_and_delete(self.attribs, 'pressed', False))376 def Handle(self, parent):377 object = wax.ToggleButton(parent, **self.attribs)378 if self._objname:379 setattr(parent, self._objname, object)380 object.SetValue(self.state)381 return object382##################################################################################383class TreeViewHandler:384 def __init__(self, control, attribs, addprops, children, waxrf):385 self.control = control386 self.attribs = attribs387 self.addprops = addprops388 self.children = children389 self.waxrf = waxrf390 def Handle(self, parent):391 if len(self.children) != 1:392 raise Exception("error: only one child allowed for treeview")393 object = wax.TreeView(parent, **self.attribs)394 if self._objname:395 setattr(parent, self._objname, object)396 # start loading the items397 self._load_node(object, self.children[0])398 return object399 def _load_node(self, object, node, parent=None):400 # load the attributes401 text = str(node.attribs.get('text', '<no text>'))402 value = node.attribs.get('value', None)403 expanded = bool(node.attribs.get('expanded', False))404 # add the item and set its text/data405 item = None406 if parent:407 item = object.AppendItem(parent, text)408 else:409 item = object.AddRoot(text)410 object.SetPyData(item, value)411 # load this nodes children412 for child in node.children:413 self._load_node(object, child, item)414 # expand this node, if necessary415 if expanded:416 object.Expand(item)417 return item418##################################################################################419class TreeListViewHandler:420 def __init__(self, control, attribs, addprops, children, waxrf):421 self.control = control422 self.attribs = attribs423 self.addprops = addprops424 self.children = children425 self.waxrf = waxrf426 self.columns = get_and_delete(self.attribs, 'columns', '').split(',')427 self.numcols = len(self.columns)428 self.maincolumn = get_and_delete(self.attribs, 'maincol', 0)429 self.columnwidths = get_and_delete(self.attribs, 'colwidths', ',' * (self.numcols-1)).split(',')430 for x in range(len(self.columnwidths)):431 try:432 self.columnwidths[x] = int(self.columnwidths[x])433 except:434 self.columnwidths[x] = 100435 assert self.numcols > 0436 def Handle(self, parent):437 if len(self.children) != 1:438 raise Exception("error: only one child allowed for treelistview")439 object = wax.TreeListView(parent, columns=self.columns, **self.attribs)440 if self._objname:441 setattr(parent, self._objname, object)442 # set the initial attributes443 object.SetMainColumn(self.maincolumn)444 for x in range(len(self.columnwidths)):445 object.SetColumnWidth(x, self.columnwidths[x])446 # load the root item and its children447 root = self._load_node(object, self.children[0])448 return object449 def _load_node(self, object, node, parent=None):450 # get the attributes451 expanded = bool(node.attribs.get('expanded', False))452 # get the text values for each column453 texts = []454 for x in range(1, self.numcols+1):455 texts.append(str(node.attribs.get('col%d' % x, '')))456 # now add it to the treelistview object457 item = None458 if parent:459 item = object.AppendItem(parent, '<no text>')460 else:461 item = object.AddRoot('<no text>')462 # load the text values into each column463 for x in range(self.numcols):464 object.SetItemText(item, texts[x], x)465 # load this nodes children466 for child in node.children:467 self._load_node(object, child, item)468 # expand the node, if necessary469 if expanded:470 object.Expand(item)471 return item472##################################################################################473class NoteBookHandler:474 def __init__(self, control, attribs, addprops, children, waxrf):475 self.control = control476 self.attribs = attribs477 self.addprops = addprops478 self.children = children479 self.waxrf = waxrf480 def Handle(self, parent):481 object = wax.NoteBook(parent, **self.attribs)482 if self._objname:483 setattr(parent, self._objname, object)484 for page in self.children:485 assert len(page.children) == 1486 text = page.attribs.get('text', '<no text>')487 win = page.children[0].Handle(object)488 object.AddPage(win, text=text)489 return object490##################################################################################491class BitmapHandler:492 def __init__(self, control, attribs, addprops, children, waxrf):493 self.control = control494 self.attribs = attribs495 self.addprops = addprops496 self.children = children497 self.waxrf = waxrf498 self.bmpobj = None499 def Handle(self, parent):500 if not self.bmpobj:501 data = imgcoder.DecodeImage(self.textValue)502 self.bmpobj = wax.BitmapFromData(data)503 if self._objname:504 setattr(parent, self._objname, self.bmpobj)505 return self.bmpobj506##################################################################################507class BitmapObjectHandler:508 def __init__(self, control, attribs, addprops, children, waxrf):509 self.control = control510 self.attribs = attribs511 self.addprops = addprops512 self.children = children513 self.waxrf = waxrf514 self.bmpref = get_and_delete(self.attribs, 'bmp', None)515 def Handle(self, parent):516 bmp = self.waxrf.LoadObject(parent, self.bmpref)517 object = wax.__dict__[self.control](parent, bmp, **self.attribs)518 if self._objname:519 setattr(parent, self._objname, object)520 return object521##################################################################################522class RadioButtonHandler:523 def __init__(self, control, attribs, addprops, children, waxrf):524 self.control = control525 self.attribs = attribs526 self.addprops = addprops527 self.children = children528 self.waxrf = waxrf529 self.selected = bool(get_and_delete(self.attribs, 'selected', None))530 def Handle(self, parent):531 object = wax.RadioButton(parent, **self.attribs)532 if self._objname:533 setattr(parent, self._objname, object)534 if self.selected:535 object.SetValue(self.selected)536 return object537##################################################################################538class ImageListHandler:539 def __init__(self, control, attribs, addprops, children, waxrf):540 self.control = control541 self.attribs = attribs542 self.addprops = addprops543 self.children = children544 self.waxrf = waxrf545 self.imglist = None546 def Handle(self, parent):547 if self.imglist is None:548 self.imglist = wax.ImageList(**self.attribs)549 for item in self.children:550 bmp = item.attribs.get('bmp', None)551 bmp = self.waxrf.LoadObject(parent, bmp)552 self.imglist.Add(bmp, item._objname)553 if self._objname:554 setattr(parent, self._objname, self.imglist)555 return self.imglist556##################################################################################557class ToolBarHandler:558 def __init__(self, control, attribs, addprops, children, waxrf):559 self.control = control560 self.attribs = attribs561 self.addprops = addprops562 self.children = children563 self.waxrf = waxrf564 def Handle(self, parent):565 object = wax.ToolBar(**self.attribs)566 if self._objname:567 setattr(parent, self._objname, object)568 for img in self.children:569 pass570 return object571##################################################################################572class StyledTextBoxHandler:573 def __init__(self, control, attribs, addprops, children, waxrf):574 self.control = control575 self.attribs = attribs576 self.addprops = addprops577 self.children = children578 self.waxrf = waxrf579 def Handle(self, parent):580 object = wax.StyledTextBox(parent, **self.attribs)581 if self._objname:582 setattr(parent, self._objname, object)583 return object584##################################################################################585# USER ADDITION AREA586##################################################################################587class BitmapComboBoxHandler:588 def __init__(self, control, attribs, addprops, children, waxrf):589 self.control = control590 self.attribs = attribs591 self.addprops = addprops592 self.children = children593 self.waxrf = waxrf594 self.text = get_and_delete(self.attribs, 'text', '')595 def Handle(self, parent):596 object = BitmapComboBox(parent, **self.attribs)597 if self._objname:598 setattr(parent, self._objname, object)599 object.SetValue(self.text)600 for item in self.children:601 bmp = item.attribs.get('bmp',wx.NullBitmap)602 bmp = self.waxrf.LoadObject(parent, bmp)603 text = item.attribs.get('text', '<no text>')604 object.Append(text, bmp)...

Full Screen

Full Screen

HandDrag.py

Source:HandDrag.py Github

copy

Full Screen

1import bpy2from mathutils import Vector3from mathutils import noise4from ..vic_tools import addProps5def collectVertexColor( mesh, color_layer ):6 ret = {}7 i = 08 for poly in mesh.polygons:9 for idx in poly.loop_indices:10 loop = mesh.loops[idx]11 v = loop.vertex_index12 linked = ret.get(v, [])13 linked.append(color_layer.data[i].color)14 ret[v] = linked15 i += 116 return ret 17 18def avg_col(cols):19 avg_col = Color((0.0, 0.0, 0.0))20 for col in cols:21 avg_col[0] += col[0]/len(cols)22 avg_col[1] += col[1]/len(cols)23 avg_col[2] += col[2]/len(cols)24 return avg_col 25# def addProps( target, name, value, override = False ):26# if not name in target or override:27# target[name] = value28 29def back_to_origin_vertex_position( target ):30 for i, v in enumerate( target.data.vertices, 0 ):31 target.data.vertices[i].co = target['vic_init_vertex_position'][i]32 to_proxy = target.matrix_world @ Vector( target['vic_init_vertex_position'][i] )33 target['vic_proxy_vertex_position'][i][0] = to_proxy.x34 target['vic_proxy_vertex_position'][i][1] = to_proxy.y35 target['vic_proxy_vertex_position'][i][2] = to_proxy.z36 37def save_vertex_position( target ):38 # active when 1, or close by 039 addProps( target, 'vic_active', True )40 # no nagetive number, the higher value the more detail41 addProps( target, 'vic_detail', 1.0 )42 # 0.0~1.0 will be best! 43 addProps( target, 'vic_effective', 1.0 )44 # using vertex color45 addProps( target, 'vic_using_vertex_color_map', False )46 # using vertex color for effective value47 addProps( target, 'vic_effective_by_vertex_color', 'Col' )48 49 detail = target['vic_detail']50 map_vertex_color = target['vic_effective_by_vertex_color'] 51 addProps( target, 'vic_init_vertex_position', [ v.co.copy() for v in target.data.vertices ], True)52 addProps( target, 'vic_proxy_vertex_position', [ target.matrix_world @ v.co.copy() for v in target.data.vertices ], True )53 54 if map_vertex_color in target.data.vertex_colors:55 collect_color = collectVertexColor( target.data, target.data.vertex_colors[map_vertex_color] ) 56 map_vertexs = [avg_col(v).hsv[2] for k, v in collect_color.items() ]57 addProps( target, 'vic_force_for_each_vertex_by_vertex_color', map_vertexs, True ) 58 else:59 addProps( target, 'vic_force_for_each_vertex_by_vertex_color', [ .2 for v in target.data.vertices ], True )60 addProps( target, 'vic_force_for_each_vertex', [ ((noise.noise(Vector(v)*detail)) + 1) / 2 for v in target['vic_init_vertex_position'] ], True ) 61 62def move_vertice( target ):63 mat = target.matrix_world64 vs = target.data.vertices65 66 # check the object is not in the scene67 if not 'vic_init_vertex_position' in target: return None68 active = target['vic_active']69 if active == 0: return None70 init_pos = target['vic_init_vertex_position']71 proxy_pos = target['vic_proxy_vertex_position']72 force_pos = target['vic_force_for_each_vertex_by_vertex_color'] if target['vic_using_vertex_color_map'] else target['vic_force_for_each_vertex']73 effective = target['vic_effective']74 for i, v in enumerate(vs,0):75 toPos = mat @ Vector( init_pos[i] )76 proxy_pos_vec = Vector(proxy_pos[i])77 proxy_pos_vec += (toPos - proxy_pos_vec) * force_pos[i] * effective 78 set_pos = mat.inverted() @ proxy_pos_vec79 v.co = set_pos80 81 proxy_pos[i][0] = proxy_pos_vec.x82 proxy_pos[i][1] = proxy_pos_vec.y83 proxy_pos[i][2] = proxy_pos_vec.z84 85def filterCanEffect( objs ): 86 return [ o for o in objs if o.data is not None and hasattr( o.data, 'vertices' ) ] 87def update( scene ):88 eff_objects = filterCanEffect( bpy.data.objects )89 for o in eff_objects:90 if 'vic_active' in o:91 move_vertice( o )92def addListener():93 #if update in bpy.app.handlers.frame_change_pre:94 try:95 bpy.app.handlers.frame_change_pre.remove( update )96 except:97 print( 'update handler is not in the list' )98 bpy.app.handlers.frame_change_pre.clear()99 bpy.app.handlers.frame_change_pre.append( update ) 100class vic_hand_drag(bpy.types.Operator):101 bl_idname = 'vic.hand_drag'102 bl_label = 'Make It Drag'103 bl_description = 'Every time you update vertex color, you should rebuild this effect! see custom properties in object data panel'104 105 def doEffect( self ):106 init_objects = filterCanEffect( bpy.context.selected_objects.copy() )107 for o in init_objects:108 save_vertex_position( o )109 addListener() 110 def execute(self, context):111 self.doEffect()112 return {'FINISHED'}113 '''114class vic_set_value_to_all_effect_object( bpy.types.Operator):115 bl_idname = 'vic.set_value_to_all_effect_object'116 bl_label = 'Rewalk All Active Object'117 118 def doEffect( self ):119 init_objects = filterCanEffect( bpy.data.objects )120 for o in init_objects:121 if 'vic_active' in o:122 save_vertex_position( o )123 addListener()124 def execute(self, context):125 self.doEffect()126 return {'FINISHED'} 127 '''128class vic_healing_all_effect_objects( bpy.types.Operator):129 bl_idname = 'vic.healing_all_effect_objects'130 bl_label = 'Healing All'131 bl_description = 'Reset mesh shape to original'132 133 def doEffect( self ):134 bpy.context.scene.frame_current = 1135 bpy.ops.object.paths_calculate()136 init_objects = filterCanEffect( bpy.data.objects )137 for o in init_objects:138 if 'vic_active' in o.data:139 back_to_origin_vertex_position( o )140 bpy.ops.object.paths_clear()141 addListener() 142 def execute(self, context):143 self.doEffect()...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run fMBT automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful