ScriptToMoBus

The script is comfortable for it’s easy migration between versions of the software. It’s not as disease, like for example the compiled plugin. In Mobu set of features and functionality as a whole remains for the past 4 versions of the same but there are those little changes and the lack of backward compatibility.

 

For example, an elementary function to create the window, FBCreateUniqueTool in new versions and CreateUniqueTool in older versions . Or search for an object name FBFindModelByLabelName in new versions and FBFindModelByName old ones. For many situations, I made ​​up as follows : I create a copy of the script , add a suffix to the name with the MoBu version number and I’am submitting changes to the script for this version of the program to run it. This set of scripts complicates further work on improving the script , because the changes you need to make in every script , with nothing overlooked.
And in this case, I would like to have a one working script for all versions and functions that differ somehow I would like to wrap in some structure to support both the old names and new.

Here is a sample how to deal with different function names:

 

1
2
3
4
5
6
7
8
9
10
11
12
t = None
try:
  t = FBCreateUniqueTool("Renamer tool (by Neill3d)")
except NameError:
  t = CreateUniqueTool("Renamer tool (by Neill3d)")
  print "supporting MoBu 2010"

if t:
  t.StartSizeX = 292
  t.StartSizeY = 514
  PopulateTool(t)
  ShowTool(t)
One script for different MoBu versions
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *