Welcome, Guest. Please Login or Register
Home Help Search Login Register
Pages: 1 2 3 4 5 ... 8
Send Topic Print
sIBL_Framework (Read 22467 times)
Blochi
Administrator
*****
Offline



Posts: 1726
Hollywood
Re: sIBL_Framework
Reply #30 - 09/15/08 at 00:38:34
 
Also, FYI: If you're posting links to the Smart IBL main page, just post this top level domain:

www.smartibl.com

Back to top
 
WWW  
IP Logged
 
Kel Solaar
Moderator
*****
Offline


Curious Apprentice

Posts: 1117
Re: sIBL_Framework
Reply #31 - 09/15/08 at 09:51:07
 
Blochi wrote on 09/15/08 at 00:22:30:
I let you two battle this out... just a quick feature request in-between: Since you know the datatype of additional attributes from the template definition, it would be nicer to present booleans as checkboxes.


Yeah that's definitely how it should be :] Currently I didn't dived into dynamic interface creation in PyQt and don't really know how to do it, That would be the best and I will do it in the next releases. For now I'm in fact using a special spreadsheet (QTableWidget) with the ability to display custom widgets in his cell and not only text. I tried with a checkbox into the cell, but it was ugly :]. I can also maybe use sort of a big push/pull button that stay pushed or not following the attribute value. I will screenshot you the different things so we can decide what is the best ^^

Blochi wrote on 09/15/08 at 00:22:30:
I've attached a PSD with all matching icons, feel free to use them... makes good branding for the whole Smart IBL suite.


Hehe yes :]


Blochi wrote on 09/15/08 at 00:22:30:
Oh, one more thing: Not sure if a true socket connection is necessary. In Lightwave, when I spawn an external program in a commandline, I can have the script listen to the returning commandline output....  not sure about MAX, but that would be a good way for notifications.

Blochi


This connection thing is pretty hard to deal with because every package seem to have a different way of communicating with exterior. The last release can direclty connect to Maya through socket connection. I can/will implement different connection protocols depending what's available on the target system. XSI for example should be able with python to accept socket connection, but when I open a socket, the app freeze till something go through it, pretty annoying :[

Blochi wrote on 09/15/08 at 00:38:34:
Also, FYI: If you're posting links to the Smart IBL main page, just post this top level domain:

www.smartibl.com



I'll modify all my links to point to this one, definitely better and eye candy  Wink


Oh and I included Dschaga Templates in the 0.9.2 release too :]
Back to top
 
 
IP Logged
 
Dschaga
Ex Member


Re: sIBL_Framework
Reply #32 - 09/15/08 at 12:15:59
 
For 3ds max a OLE connection is possible!
I was able to open a maxscriptfile from the python commandline:
Code:
import win32com.client
conn = win32com.client.Dispatch("MAX.Application")
conn._FlagAsMethod("DoSomething")
conn.DoSomething("fileIn \"F:\Maps\sIbl\sIBL_loader_95.ms\"") 



I would say this is easy, but would need the win32 extensions to be installed. I don't know if it's possible to deliver the sibl gui with the extensions, but the OLE connection would be a very nice way for me to implement the connection



Maybe you could add an template param where the python gui can decide how it will be connected to the 3d app: Code:
Connection = @connectiontype | connectionname | String | Connection 



in the case of the sample above and 3ds max it would be:
Code:
Connection = @OLE | DoSomething | String | Connection 


You could offer different ways to connect back to the 3d app.
If maya don't want a socket connection, then you could go with OLE or something else and only have to write a "case of" expression (or however it is called in python) where you send the callback in the way the 3dapp can understand it.



In most cases it is a call to run a script and this could be also a param for the template: Code:
executecall = @executecall | executecode | String | executecall  



in my case it needs the fileIn "path..." Code:
executecall = @executecall | fileIn "$path" | String | executecall  


Back to top
 
 
IP Logged
 
Dschaga
Ex Member


Re: sIBL_Framework
Reply #33 - 09/15/08 at 12:24:25
 
btw:
i recognised the little change in the templates but it would be better when you rethink the additonal name at the end:

Version = @Version | 2008+ | String
| Version
Back to top
 
 
IP Logged
 
Kel Solaar
Moderator
*****
Offline


Curious Apprentice

Posts: 1117
Re: sIBL_Framework
Reply #34 - 09/15/08 at 13:27:17
 
Quote:
For 3ds max a OLE connection is possible!
I was able to open a maxscriptfile from the python commandline:


Sweet I'll try to add this tonight to the current code, the fact win32 is needeed should not be a problem I think because once I will package the code to an executable, it should be included inside it. It will need some testing to be sure its still working once packaged.

Quote:
btw:
i recognised the little change in the templates but it would be better when you rethink the additonal name at the end:

Version = @Version | 2008+ | String
| Version


Sorry I don't really understand what you mean  Embarrassed

I noticed that I broke the Collection Filtering in the 0.9.2 release by introducing an error in the filter method, I'll correct this as soon as I get back from work. I don't have the source code here.
Back to top
 
 
IP Logged
 
Dschaga
Ex Member


Re: sIBL_Framework
Reply #35 - 09/15/08 at 13:40:30
 
it's more a cosmetic thing:

This is now :
Version = @Version | 2008+ | String | Version

and this was:
Version = @Version | 2008+ | String

last one makes more sense for me...
name, variablename in the script, defaultvalue, type


btw, what IDE do you use for coding in python?
Back to top
 
 
IP Logged
 
Kel Solaar
Moderator
*****
Offline


Curious Apprentice

Posts: 1117
Re: sIBL_Framework
Reply #36 - 09/15/08 at 14:37:38
 
Quote:
it's more a cosmetic thing:

This is now :
Version = @Version | 2008+ | String | Version

and this was:
Version = @Version | 2008+ | String

last one makes more sense for me...
name, variablename in the script, defaultvalue, type


btw, what IDE do you use for coding in python?



Ah yeah I see what you mean, In fact its because I need some kind of "Nice Name" to put in the GUI, otherwise for the "createBackground "attribute you would get "createBackground", instead of "Create Background". If we are sure that we stick to a convention where the attribute name is still formatted the same way, like "doSomethingToThis" or "currentThing" with capital letters to separate the string component, I can think about a way to automatically parse the string and show it as nice name like Maya is doing it.

"createBackground" would result in "Create Background" in the GUI or
"doSomethingToThis" would result "Do Something To This" in the GUI

If you are ok with this I'll will rollback to the previous style ( and I prefer to be honest  Grin )


Quote:
btw, what IDE do you use for coding in python?


jEdit for small scale stuff and Eclipse with Aptana and Pydev as plugins when it comes to heavy artillery things :]
Back to top
 
 
IP Logged
 
Dschaga
Ex Member


Re: sIBL_Framework
Reply #37 - 09/15/08 at 14:59:21
 
Why not offer this as an optional attribute?
When it's there, then take this "Nice Name", else take the name of the variable...
Back to top
 
 
IP Logged
 
Kel Solaar
Moderator
*****
Offline


Curious Apprentice

Posts: 1117
Re: sIBL_Framework
Reply #38 - 09/15/08 at 15:55:45
 
Quote:
Why not offer this as an optional attribute?
When it's there, then take this "Nice Name", else take the name of the variable...

Yes it's another solution, I can still do the automatic nice name thing over that if the nice name attribute is not present or you think its not usefull ?

And here is a shot from Eclipse : http://files.myopera.com/KelSolaar/blog/CG/sIBL_Framework/Posts/Pictures/Eclipse...
Back to top
« Last Edit: 09/15/08 at 19:46:04 by Kel Solaar »  
 
IP Logged
 
Kel Solaar
Moderator
*****
Offline


Curious Apprentice

Posts: 1117
Re: sIBL_Framework
Reply #39 - 09/15/08 at 23:57:07
 
Dschaga : I did the "Attribute Name" thing optional like you wanted and the nice name stuff: That mean that if there is no "Attribute Name" provided, the GUI will try to get a nice string from the "Attribute"

Code:
createUltimateBackground = @createUltimateBackground | 1 | String 


Would result in "Create Ultimate Background" in the interface

Code:
createUltimateBackground = @createUltimateBackground | 1 | String | Yeahhhh Baby 


Would result in "Yeahhhh Baby" in the interface

Btw I installed Max but I didnt managed to get it work as an OLE server. I added the option into sIBL_GUI to get an OLE/win32 connection but can't try it :[

Here is the code in sIBL_GUI :

Code:
elif cConnectionType == "Win32" :
	try :
		cConnection = win32com.client.Dispatch( "\"" + cTemplateFile.getExtraAttributeComponents( cRemoteConnectionAttributes["TargetApplication"], "Value" ) + "\"" )
		cConnection._FlagAsMethod("ExecuteLoaderScript")
		cConnectionCommand = cTemplateFile.getExtraAttributeComponents( cRemoteConnectionAttributes["ExecutionCommand"], "Value" ).replace( "$loaderScriptPath", cEnvVariable.getPath().replace( "\\", "/" ) + "/" + cTemplateFile.getExtraAttributeComponents( cTemplateAttributes["OutputScript"], "Value" ) )
		cConnection.ExecuteLoaderScript(cConnectionCommand)
	except:
		self.displayQTCriticalMessage( "Remote Connection Failed !" )
	break 



And you will need something like that in your max template :

Code:
[Remote Connection]
ConnectionType = @ConnectionType | Win32 | String
TargetApplication = @TargetApplication | MAX.Application | String
ExecutionCommand = @ExecutionCommand | fileIn "$loaderScriptPath" | String 



Here is the build : http://kelsolaar.hdrlabs.com/sIBL_Framework/sIBL_GUI/Nightly/Windows/sIBL_GUI-Ni...

I hope there was no includes missing for win32 when I builded the executable, sometimes it's when I launch the executable and use the function that they are popping as missing.
Back to top
« Last Edit: 10/12/08 at 00:25:35 by Kel Solaar »  
 
IP Logged
 
Dschaga
Ex Member


Re: sIBL_Framework
Reply #40 - 09/16/08 at 09:09:54
 
I'm afraid that i can't test your script today, but the reason why it doesn't work is that 3dsmax have to listen to the OLE connection:

run this script or place a script with this content in the script/startup folder:
Code:
fn ExecutionCommand obj = (
  try(
	   execute obj
	   return true
   )catch(
	   return false
	   )
)
registerOLEInterface #(ExecutionCommand)

 




and this is the python code which works for me and creates a simple box
Code:
import win32com.client
conn = win32com.client.Dispatch("MAX.Application")
conn._FlagAsMethod("ExecutionCommand")
conn.ExecutionCommand("box ()")

 

Back to top
 
 
IP Logged
 
Kel Solaar
Moderator
*****
Offline


Curious Apprentice

Posts: 1117
Re: sIBL_Framework
Reply #41 - 09/16/08 at 12:32:31
 
Quote:
I'm afraid that i can't test your script today, but the reason why it doesn't work is that 3dsmax have to listen to the OLE connection:

run this script or place a script with this content in the script/startup folder:
Code:
fn ExecutionCommand obj = (
  try(
	   execute obj
	   return true
   )catch(
	   return false
	   )
)
registerOLEInterface #(ExecutionCommand)

 




and this is the python code which works for me and creates a simple box
Code:
import win32com.client
conn = win32com.client.Dispatch("MAX.Application")
conn._FlagAsMethod("ExecutionCommand")
conn.ExecutionCommand("box ()")

 



Hello o/

I gave a try at home with 3dsmax8 and at work with 3dsmax9 and didnt had any chances with one or another. I registered Max as an OLE server with the .reg. Tried different stuff and each time I failed. I'm certainly doing something wrong  Grin
Back to top
 
 
IP Logged
 
Dschaga
Ex Member


Re: sIBL_Framework
Reply #42 - 09/16/08 at 13:55:49
 
with earlier versions you have to add a ref file to the registry, but with max2008+ max should register automatically.

anyway..
try:
conn = win32com.client.Dispatch("MAX.Application.8")
where the last number is always the max version number ..but this depends on the reg entry..somehow tricky with older max versions..i know!
btw, you may have to edit the path inside the reg file
Back to top
 
 
IP Logged
 
keksonja
Ex Member


Re: sIBL_Framework
Reply #43 - 09/16/08 at 14:39:59
 
Nice work guys... just one question.  Is this addon supported under vista 64 bit ?  I have installed it but when i run Launch sIBL_GUI from the ppg i get the following error C; user /xsi/softimage/xsi7.0/addons/sIBL_GUI_for_XSI/Application/Plugins/s.../sIBL_GUI.
exe.ink
the specified path does not exist

check the path and then try again.  I checked the follerder and everything is there why this .ink?

Everything work under XP just fine.

here is what script editor spits out

System "" & Chr(34) & "C:/Users/xsi/Softimage/XSI_7.0/Addons/sIBL_GUI_For_XSI/Application/Plugins/sIBL
_GUI_Windows/sIBL_GUI.exe.lnk" & Chr(34) & ""


Thanks Smiley
Back to top
 
 
IP Logged
 
Kel Solaar
Moderator
*****
Offline


Curious Apprentice

Posts: 1117
Re: sIBL_Framework
Reply #44 - 09/16/08 at 15:21:06
 
Quote:
with earlier versions you have to add a ref file to the registry, but with max2008+ max should register automatically.

anyway..
try:
conn = win32com.client.Dispatch("MAX.Application.8")
where the last number is always the max version number ..but this depends on the reg entry..somehow tricky with older max versions..i know!
btw, you may have to edit the path inside the reg file


Ok thanx dschaga, I'll try to get a max2008 version


Quote:
Nice work guys... just one question.  Is this addon supported under vista 64 bit ?  I have installed it but when i run Launch sIBL_GUI from the ppg i get the following error C; user /xsi/softimage/xsi7.0/addons/sIBL_GUI_for_XSI/Application/Plugins/s.../sIBL_GUI.
exe.ink
the specified path does not exist

check the path and then try again.  I checked the follerder and everything is there why this .ink?

Everything work under XP just fine.

here is what script editor spits out

System "" & Chr(34) & "C:/Users/xsi/Softimage/XSI_7.0/Addons/sIBL_GUI_For_XSI/Application/Plugins/sIBL
_GUI_Windows/sIBL_GUI.exe.lnk" & Chr(34) & ""


Thanks Smiley


Hello keksonja o/
In fact the .lnk is a shortcut for the executable. It's a workaround because I didnt find a way to call sIBL_GUI directly without having XSI or Maya stuck waiting for the end of the execution of sIBL_GUI ( on linux you can launch a program with "&" at the end and it deliver the shell or the parent program). I use this .lnk as a sublauncher but if someone manage to find a way to launch an external program without freezing XSI I'll be really glad to implement it. That's for the explanation.

For the vista problem I don't really know, maybe you can try to regenerate a shortcut from sIBL_GUI.exe, just be sure it has the same name than what the script is requesting ( should be sIBL_GUI.exe.lnk). You can check the name in windows command line.
Back to top
 
 
IP Logged
 
Pages: 1 2 3 4 5 ... 8
Send Topic Print