Been reading the
iClone Python API especially the bit that opens up from the link I find a little confusing. The whole lot of it is not very clear to me so I will be doing a lot of experimenting with codes so I can eventually figure out what reallusion are trying to say. I also intend joining the other people who will be posting the things as we figure them out because maybe it might assist others who also find it difficult to fully understanding due to the way its written. Also the things posted by other people may help me get the use of this API clear in my head.
SOME POINTS AS I UNDERSTAND SO FARThe way I read it the first method where we save the python file here
iClone Install Directory \ Bin64 \ OpenPlugin folder\ [Your Plugin Name] and it must be names
Main.py suggests to me that this is a python file that will automatically load into iClones menu bar named
Plugins whenever we load iClone. The fact that the python file must be named
Main.py suggests to me that there can only ever be 1 python file that will automatically load when we load iClone. So the way I am thinking on that is if we want more make more than one that will automatically load we will need to remove the one we don't want and add the one we do want before we load iClone. Maybe there is a way to have that single main.py file list all python plugins we want to automatically load in when we start iclone but I'm only guessing so far. Its also not very clear to me how the folder for python plugins in Bin64 needs to be named. I see there is a folder named plugin in there. But the document says OpenPlugin Folder. Not sure yet So, I am ignoring this first method at the moment. I will get into it later as I get to understand how to write python addons for iClone better.
As I understand it the second method means we can create as many python addons as we want and we can name and save them however we want. All we need to do is Load iClone first and then click the Menu bar named Script, click Load Python navigate to the folder where we save them and double click the one we want to load. Repeatedly load as many as we need for the project we are working on. Auto loading might be better but this way suits me at the moment because I don't have to restart iClone to reload a python addon after I have modified the code. Just reload the file after I have modified it using the Script menu bar. One problem with that is the previous one loaded doesn't get replaced and the only way to remove it is to close and restart iClone. At least, that's all I have found for removing them from the Plugins menu bar so far. So making a change to the code and reloading it say 10 times ends up with that plugin being listed in the plugins menu bar 10 times. I wish the one we load from the Script menu bar would just replace rather than add one in the Plugins menu bar if it has the same name.
Anyway, enough of the beginning points. I am now working on adding how I got my first attempt working as far as I can tell.
I haven't fully tested it but it loads and displays the user interface when I select it in the plugins menu bar.
I will also be showing my first attempts that didn't work and why they didn't work. In Script menu bar there is a
Console Log that displays errors returned to iClone by python. Took me a little bit of experimenting to understand this but its starting to help me figure out what is wrong with the code.
Working on publishing this in the next comment for this post now. Should have it done in an hour or so.
Looking forward reading replies from anyone for comments, suggestions or notified bad thinking on my side.
I'm in the learning process of using python as an API for iClone.
i7-3770 3.4GHz CPU 16 GB Ram
GeForce GTX1080 TI 11GB
Windows 10 Pro 64bit