Profile Picture

Persistency of previous script

Posted By RobertoColombo 5 Years Ago
You don't have permission to rate!
Author
Message
RobertoColombo
RobertoColombo
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 1.6K, Visits: 3.0K
Hi RL,

during various experiment I found a high number of times a kind of persistency, so that a modified script does not change the output on the console, but if I close iClone and re-open it, the same script gives the expected output.
I do not have a test case here but I am pretty much sure that something is cached inside there and sometimes the latest modification is lost when the script is reloaded.
Sometimes the console window points to a blank line in the script as s ource of an error... but once I restart iClone and run the same script, the console output changes.

Pls, have a look at it.

  Roberto

My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390  RAM: 32GB DDR4 2.6GHz / HD: 2TB+3TB  /  
SSD: 2x512GB Samsung 860 EVO + 1x2TB Samsung
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the MOTU M4 I/F) / DirectX: 12

Edited
5 Years Ago by RobertoColombo
Kelleytoons
Kelleytoons
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 9.1K, Visits: 21.8K
Not sure exactly what you are referring to, Roberto, but one thing for sure -- if you want changes/additions to show up on the timeline you need to press play (the keys won't update until you do).

Otherwise I have not found anything like you are experiencing (however I am doing nothing with the UI so it might be that).



Alienware Aurora R12, Win 10, i9-119000KF, 3.5GHz CPU, 128GB RAM, RTX 3090 (24GB), Samsung 960 Pro 4TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
RobertoColombo
RobertoColombo
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 1.6K, Visits: 3.0K
Hi Mike,

no, it's not related to anything "dynamic":
I am just building up some test code to inspect the object model and try to develop some ad-hoc API for what is missing.
So, completely "static" code that just prints info...

  Roberto

My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390  RAM: 32GB DDR4 2.6GHz / HD: 2TB+3TB  /  
SSD: 2x512GB Samsung 860 EVO + 1x2TB Samsung
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the MOTU M4 I/F) / DirectX: 12

Edited
5 Years Ago by RobertoColombo
The-any-Key
The-any-Key
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 356, Visits: 1.9K
If you use your own modules in your main.py. ex:

# Import my extras
import PLUG
import FUNC


These modules will only be loaded once when you test your script in iClone after each start. The next time you test to run the script, and you have not re-started iClone. Python will come to these import modules lines, and check if it already loaded these modules before in this session. And if it have, it will use the compiled version it created then. So this is standard for Python to speed things up. I think the main.py will reload every time but not the modules.

But this is bad for developers. Because we run, change, save, run, change, save...
But you can force Python to reload the modules by using "importlib".

# Import my extras
import PLUG
import FUNC
# Re-import for debugging
import importlib
importlib.reload(PLUG)
importlib.reload(FUNC)


But note that you should comment those lines when you publish your code to give the end user the speed back. Because it will take a little longer to run the scripts. Because it need to recompile the modules every run.




iClone 7, 3DXchange 7 Pipeline, CC3 Pipeline, CT8 Pipeline, Iray, Live Face, iPhone Xr, Win 10, i9 9900K ~5GHz, Nvidia RTX 2080 8GB, 16GB Ram, M.2 SSD
Edited
5 Years Ago by The-any-Key
The-any-Key
The-any-Key
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 356, Visits: 1.9K
Kelleytoons (1/13/2019)
Not sure exactly what you are referring to, Roberto, but one thing for sure -- if you want changes/additions to show up on the timeline you need to press play (the keys won't update until you do).

Otherwise I have not found anything like you are experiencing (however I am doing nothing with the UI so it might be that).


You can also update and show the keys by hide and show the object:

# Refresh so keys will show in timeline
RLPy.RScene.Hide(object)
RLPy.RScene.Show(object






iClone 7, 3DXchange 7 Pipeline, CC3 Pipeline, CT8 Pipeline, Iray, Live Face, iPhone Xr, Win 10, i9 9900K ~5GHz, Nvidia RTX 2080 8GB, 16GB Ram, M.2 SSD
jlittle
jlittle
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 1.9K, Visits: 17.1K
For testing I don't use the main.py but create another name like test1.py or something and then use the Script | Load Python menu option to load it and test.
This way you don't have to restart iClone each time since using the main.py in the ..\OPenPlugin\<your_py_name> folder) causes it to be loaded when iClone starts and if there are any changes in your program then you must restart iClone to reload it.

Jeff




Get my Plugin Manager and TaskNotes plugins for iClone.
Check out EZColors and Other products for CTA/CA. EZColors: the easy way to change Render Styled (RS) colors!
See my CTA Tutorials on the YouTube channel CTAStepByStep

RobertoColombo
RobertoColombo
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 1.6K, Visits: 3.0K
Thanks a lot!

My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390  RAM: 32GB DDR4 2.6GHz / HD: 2TB+3TB  /  
SSD: 2x512GB Samsung 860 EVO + 1x2TB Samsung
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the MOTU M4 I/F) / DirectX: 12

RobertoColombo
RobertoColombo
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 1.6K, Visits: 3.0K
After working a bit more on the code, I still got the same behavior.
It is not linked to any pre-compiled module, but it is surely due to a situation where multiple Python fiels are involved, i.e. one main script importing several modules.
I have teh feeling that the problem pops up when some wrong code impacts some low level functionality, so that an error of the RLPy module is reported.
Now I can shack up with this, because everytime I see an error still pointing to a line of code that I have corrected and is now right, I know that I need to restart iClone.
Btw, it should not be thr case and I hope RL wants to have a check on it, because developing complex plug-ins can't be done in just 1 file...

  Roberto

My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390  RAM: 32GB DDR4 2.6GHz / HD: 2TB+3TB  /  
SSD: 2x512GB Samsung 860 EVO + 1x2TB Samsung
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the MOTU M4 I/F) / DirectX: 12

jlittle
jlittle
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)Distinguished Member (6.7K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 1.9K, Visits: 17.1K
RobertoColombo (1/16/2019)
... it should not be the case and I hope RL wants to have a check on it, because developing complex plug-ins can't be done in just 1 file...

I'm not sure what your are doing but I have been debugging a complex single file py script and have not restarted iClone for days.
I use the "Script | Load Python" menu option to load and run my script multiple times without issue.

Now, if your script creates a menu in the RL GUI then the script will be persistent! It has to be to be able to execute the menu action.
Try debugging just your menu action (not the menu creation part) in it's own script file or create a window with buttons to execute each of your menu actions as if from a menu.
When it's all debugged then you can add in the menu creation and do a final test.

Jeff




Get my Plugin Manager and TaskNotes plugins for iClone.
Check out EZColors and Other products for CTA/CA. EZColors: the easy way to change Render Styled (RS) colors!
See my CTA Tutorials on the YouTube channel CTAStepByStep

RobertoColombo
RobertoColombo
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)Distinguished Member (10.2K reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 1.6K, Visits: 3.0K
jlittle (1/16/2019)

...I have been debugging a complex single file... 


Hi jeff,

no, the prb is not a single file project, I think I was clear enough.
And it is not even something related to a GUI.
The prb comes out developing a project based on many Python files, which are not 3rd party modules, and only when I make some specific coding mistakes that seem to be not digested very well by iClone...

  Roberto



My PC:
OS: Windows 10 Pro English 64-bit / CPU: Intel i7-9700 3.6GHz / MB: ASUS ROG Strix Z390  RAM: 32GB DDR4 2.6GHz / HD: 2TB+3TB  /  
SSD: 2x512GB Samsung 860 EVO + 1x2TB Samsung
VB: Palit GTX2080 TI GamingPro 11GB / AB: embedded in the MB and VB (audio from the MOTU M4 I/F) / DirectX: 12

Edited
5 Years Ago by RobertoColombo



Reading This Topic