** Continuing from Basic_01 .... **
** Click here for the above ** RF Python Basic_01
http://qiita.com/ts_bros/items/17dd84e550897ed42343
LayoutData (.lay)
*
: If you want to customize View to your liking ...
Each view has the following select.Split on the right_tool (Split Vertical:Vertical split horizontal:Lateral direction)
The left is chooser
The format that stores the edited layoutData is ... It will be .lay.
You can save and load with load / Save layout.
If you want to set Custom Layout to Default ...
*It can be set in File / Preference / Layout.
Will begin the main subject
-Python Realflow Scripting-
: Not really for Beginner ..... http://www.realflowforum.com/viewforum.php?f=39
That's why ...
RF_Python lesson01
Create Null Geometry
[Python]
#Create Null
null = scene.addNull();
#SetName
null.setName("locator");
Create a Hub
[Python]
#Create Null
hub = scene.addHub();
Create a Hub and rename it
#Create Hub
hub = scene.addHub();
Hubname =scene.getDefaultHubName();
scene.message(Hubname);
#Return List HubName
geth = scene.getHubs();
listHub = geth[0];
scene.renameHub(listHub,"Target");
Without using: setName () ... Approach to get Hubgeometry with list and change it with renameHub ()
`Connect Hub and Null`` [Python]
#Create Geometry
hub01 = scene.addHub();
null01 = scene.addNull();
hub02 = scene.addHub();
null02 = scene.addNull();
#setName
null01.setName("Null_A");
null02.setName("Null_B");
#Return List HubName
geth = scene.getHubs();
listHub1 = geth[0];
listHub2 = geth[1];
#RenameHub
hubname01=scene.renameHub(listHub1,"A");
hubname02=scene.renameHub(listHub2,"B");
#Create NodeConection
newhubs = scene.getHubs();
New_hub01 = newhubs[0];
New_hub02 = newhubs[1];
newnodes = scene.getNodes();
New_null01 = newnodes[0];
nullname01 = New_null01.getName();
New_null02 = newnodes[1];
nullname02 = New_null02.getName();
#print node&Hub Name
scene.message("hub=" +New_hub01+New_hub02+"Node=" +nullname01+nullname02);
#Change Conect
scene.addLink(nullname01,New_hub02);
scene.addLink(nullname02,New_hub02);
`Delete Hub after creating Null`` [Python]
#Create Null
null01 = scene.addNull();
null02 = scene.addNull();
#get Hubname
Hubs = scene.getHubs();
Hubname = Hubs[0];
#remove Hub
delete = scene.removeHub(Hubname);
Create multiple Nulls and modify the Name for each Node
[Python]
Created with array
array = ['1','2','3','4','5'];
for i in array:
Null = scene.addNull();
Null.setName("Blast"+i);
iterate =10;
for i in range(0,iterate):
null = scene.addNull();
null.setName("Blast"+i);
Created with While
iterate =0;
while iterate<30:
null = scene.addNull();
iterate = iterate+1;
Since the description of Loop processing of RF_Python seems to be a little different It should be noted
Handle while with care (it will be processed forever .....)
Recommended Posts