Blender2indigo 0.62beta1

Announcements, requests and support regarding the Blender Indigo export script
Phil
Posts: 154
Joined: Mon Nov 06, 2006 2:22 am
Location: St. Wendel, Germany

Post by Phil » Fri Jan 05, 2007 11:17 pm

Hi all,

To lunch Indigo installed in a path with space, I found some poor results::cry:

Typing this in a python console worked for me: :D

cmd = '\"c:/Program Files (x86)/indigo.exe\" + sys.argv[default.xml]'
os.system(cmd)

This worked but Indigo could not find its initfile.
And I dit not managed to change the directory :(

Trying to implement this in the exporter gives me this error message:
AttributeError 'module' object has no attribute 'argv'

it is really frustrating!

Some questions:

Why do we need an IndigoWrapper.cmd after all?
Perhaps could it be easyer to work with a batch file?

[edit]

This seems to work for me :D
This is my indigowrapper.conf:

Code: Select all

C:/Program Files (x86)/indigo_06
This is the modif in the exporter:

Code: Select all

#########################################################################
###	 LAUNCH INDIGO AND RENDER CURRENT SCENE (WINDOWS ONLY)	      ###
###  psor's first steps to Python(executing Indigo per shell script)  ###
###  Modif by Phil to work with with space in path
#########################################################################

def launchIndigo(filename):
	filename = os.path.basename (filename)
	datadir = Blender.Get("datadir")
	# open 'IndigoWrapper.conf' and read the first line
	f = open(datadir + '/IndigoWrapper.conf', 'r+')
	ic=f.readline()
	f.close()
	# we change the working directory to indigo
	os.chdir(ic)
	#now we start indigo
	goindigo = "Indigo.exe " + filename + "\n"
	os.system(goindigo)

### END OF PSOR ##########################################################
[edit]

Regards, Phil

Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Sat Jan 06, 2007 9:28 pm

edited to remove all
Last edited by Big Fan on Mon May 07, 2007 1:26 am, edited 1 time in total.

User avatar
u3dreal
Posts: 346
Joined: Sun Jul 02, 2006 10:36 am

Post by u3dreal » Sun Jan 07, 2007 10:25 am

Hi Big Fan,

Yo are from Nelson i didn't see it before.. cool well at least i can
chat with ppl from NZ ;D but i would like to be there...

What do you mean with render API ??? do you have any links or info in that ...would that mean we could write a render plugin for Blender with python... that would be awesome... ;)

cheers

u3dreal ;)

User avatar
u3dreal
Posts: 346
Joined: Sun Jul 02, 2006 10:36 am

Post by u3dreal » Sun Jan 07, 2007 10:28 am

Linux version updated to beta2 ...

get it at the beginning of this post ..

cheers

u3dreal ;)

Big Fan
Posts: 745
Joined: Tue Oct 17, 2006 9:37 am
Location: Nelson NZ

Post by Big Fan » Sun Jan 07, 2007 12:51 pm

edited to remove all
Last edited by Big Fan on Mon May 07, 2007 1:27 am, edited 1 time in total.

sk2k
Posts: 35
Joined: Sun Jan 07, 2007 10:26 pm

Post by sk2k » Sun Jan 07, 2007 10:27 pm

u3dreal wrote:Linux version updated to beta2 ...

get it at the beginning of this post ..

cheers

u3dreal ;)
Uhm... no beta2 for windows?

MfG
sk2k

Jananton
Posts: 66
Joined: Sun Dec 31, 2006 12:56 pm
Location: Amsterdam, The Netherlands

Post by Jananton » Sun Jan 07, 2007 10:53 pm

u3dreal wrote:Linux version updated to beta2 ...

get it at the beginning of this post ..
Well, let me first say you've done a lot of work to make the script more usable, I'm using windows btw.. 8)

However, there is an issue ihmo in that the functionality of running Indigo from within blender breaks the possebility to export the xml file under any other name as default.xml to any other than the root folder of the Indigo installation. In other words, the buttons 'run', 'def' and 'geo' don't do what's expected. :?

For instance, if I switch 'def' off one should expect to get the blender file dialog so you can choose the location of where you want the exported xml file(s) to go, but that doesn't happen.

On a lighter note, in the buttonEvt function there's a global EnFile variable. I presume this is a typo that should read EnvFile... 8)

BTW don't let the above put you off, you've done a great job already.. :D

Greetings from cloudy Amsterdam,

Jan

User avatar
afecelis
Posts: 749
Joined: Tue Aug 01, 2006 4:14 am
Location: Colombia
3D Software: Blender
Contact:

Post by afecelis » Mon Jan 08, 2007 1:58 am

Unchecking "def" to save the xml file to a specific location is working fine in Linux; it's only in windows that it seems to not work. Yet, the windows version calls the render engine properly whereas in linux the renderer doesn't find the files because of / and \ issues. :(

but it's getting closer and closer! :wink:
AMD Ryzen 7 1800 @3.6ghz, 32GB ddr4 3200 mhz Ram, Nvidia RTX 3060 12GB, Win10, Blender/Sketchup/Modo/Cinema4d

User avatar
afecelis
Posts: 749
Joined: Tue Aug 01, 2006 4:14 am
Location: Colombia
3D Software: Blender
Contact:

Post by afecelis » Mon Jan 08, 2007 2:05 am

OOPs!! I hadn't checked the console. This is the error I'm getting (yet the files were exported properly)so probably not a / \ issue anymore but:
Image
AMD Ryzen 7 1800 @3.6ghz, 32GB ddr4 3200 mhz Ram, Nvidia RTX 3060 12GB, Win10, Blender/Sketchup/Modo/Cinema4d

Jananton
Posts: 66
Joined: Sun Dec 31, 2006 12:56 pm
Location: Amsterdam, The Netherlands

Post by Jananton » Mon Jan 08, 2007 3:05 am

afecelis wrote:Unchecking "def" to save the xml file to a specific location is working fine in Linux; it's only in windows that it seems to not work.
Ok I have done some rearranging of some code in the buttonEvt function and now it works it seems. Probably has to do with the way python defines true and false.. 8)

Code: Select all

def buttonEvt(evt):  # function that handles button events
	
	global Screen, EnvFile
	
	if evt == evtExport:
		if DefaultExport == 1:
			datadir=Blender.Get("datadir")
			f = open(datadir + '/IndigoWrapper.conf', 'r+')
			ic=f.readline()
			f.close()
			filename = ic + "\default.xml"
			save_still(filename)
		else:
			Blender.Window.FileSelector(save_still, "Export", newFName('xml'))
	
	if evt == evtExportAnim:
		Blender.Window.FileSelector(save_anim, "Export Animation", newFName('xml'))
	#if there was an event, redraw the window   
	if evt:
		Draw.Redraw()
		
	if evt == evtNoEvt:
		Draw.Redraw()
		update_Registry()
Now the 'def' key works at least including the running of Indigo from blender.
I have made one other addition to the code to update the registry. It seems the values of DefaultExport and ExportGeom wheren't included, so I've added them like thus

Code: Select all

## Registry
def update_Registry():
	#global EnvFile, EnvMapType
	d = {}
## lots of entries ommitted
	d['ExecuteIndigo'] = ExecuteIndigo.val
	d['DefaultExport'] = DefaultExport.val
	d['ExportGeom'] = ExportGeom.val

## and then in the rdict try except block
		ExecuteIndigo.val = rdict['ExecuteIndigo']
		DefaultExport.val = rdict['DefaultExport']
		ExportGeom.val = rdict['ExportGeom']
The only thing that doesn't work still is switching off the 'geo' button, this should ihmo result in all beeing exported to one xml file, but that is not the case it seems. Maybe I'll have a look later... :)

Greetings from cloudy Amsterdam,

Jan

PS Note:
These updates are for the windows version only,,
Also note that in the environment menu the choice for none will crash indigo v. 6 in windows resulting in a request to send a message to uncle Bill... :lol:

User avatar
drBouvierLeduc
Posts: 412
Joined: Wed Oct 11, 2006 2:32 am
Location: france

Post by drBouvierLeduc » Mon Jan 08, 2007 4:33 am

Windows Xp problem :

The last edited version of the exporter (cf. first post) does not work for me.
But if I apply phil's modification it works perfect.
Just wanted to share the info.

Edit :
If I put "sep materials", it doesn't work anymore.
And uv textures don't seem to work anymore but maybe I do something wrong.

I put phil's modification here again in case someone has the same problem as me :

Code: Select all

#########################################################################
###    LAUNCH INDIGO AND RENDER CURRENT SCENE (WINDOWS ONLY)         ###
###  psor's first steps to Python(executing Indigo per shell script)  ###
###  Modif by Phil to work with with space in path
#########################################################################

def launchIndigo(filename):
   filename = os.path.basename (filename)
   datadir = Blender.Get("datadir")
   # open 'IndigoWrapper.conf' and read the first line
   f = open(datadir + '/IndigoWrapper.conf', 'r+')
   ic=f.readline()
   f.close()
   # we change the working directory to indigo
   os.chdir(ic)
   #now we start indigo
   goindigo = "Indigo.exe " + filename + "\n"
   os.system(goindigo)

### END OF PSOR ##########################################################
Last edited by drBouvierLeduc on Mon Jan 08, 2007 6:11 am, edited 1 time in total.

Jananton
Posts: 66
Joined: Sun Dec 31, 2006 12:56 pm
Location: Amsterdam, The Netherlands

Post by Jananton » Mon Jan 08, 2007 4:49 am

afecelis wrote:OOPs!! I hadn't checked the console. This is the error I'm getting (yet the files were exported properly)so probably not a / \ issue anymore but:
Hmm, I'm not that proficient with Linux, but the variable ic is left over from the windows launch function. Its assignment is commented out in the Linux version of the script. You could try and see if removing all of its occurences in the code would help to launch indigo from blender.
Try something like this:

Code: Select all

def launchIndigo(filename):
	f = open("/IndigoWrapper.sh", 'w')
	f.write("cd / \n")
	f.write("wine indigo.exe " + filename + " -t " + str(Threads.val))
	f.close()
	os.system("chmod +x /IndigoWrapper.sh")
	
	# call external shell script to start Indigo
	cmd= "./IndigoWrapper.sh"
	print cmd
	os.system(cmd)
As mentioned, completely untested, it fully depends on how indigo gets installed on a Linux box.... Something I have no idea of.. :wink:

Good luck

Greetings from cloudy Amsterdam,

Jan

User avatar
u3dreal
Posts: 346
Joined: Sun Jul 02, 2006 10:36 am

Post by u3dreal » Mon Jan 08, 2007 5:09 am

Ok well it seems there are differences in the OS ...

I'll have a look at that ..

cheers

u3dreal ;)

User avatar
afecelis
Posts: 749
Joined: Tue Aug 01, 2006 4:14 am
Location: Colombia
3D Software: Blender
Contact:

Post by afecelis » Mon Jan 08, 2007 8:33 am

great! Thanks Jananton and U3dreal. This will ensure compatibility on both systems and performance at 100% :wink:
AMD Ryzen 7 1800 @3.6ghz, 32GB ddr4 3200 mhz Ram, Nvidia RTX 3060 12GB, Win10, Blender/Sketchup/Modo/Cinema4d

Jananton
Posts: 66
Joined: Sun Dec 31, 2006 12:56 pm
Location: Amsterdam, The Netherlands

Post by Jananton » Tue Jan 09, 2007 5:02 am

u3dreal wrote:Ok well it seems there are differences in the OS ...

I'll have a look at that ..
Hmm, if it's only the launch function then you could always do something like:

Code: Select all

if sys.platform[:3] == 'win':
  # do windows stuff here
elif sys.platform[:5] == 'linux':
  # do linux stuff here
else:
  # some not supported yet message maybe
Also today I noticed someone had commented out the SizeX#.val and SizeY#.val values in the update_Registry() function. This should not be, since it breakes the persistance of values set in the script during a blender session and closing and restarting the script.

On another note I noticed that in the bpsdata/config subfolder indeed a file BlenderIndigo.cfg is written, but it's completely empty. I'm still puzzled by that... :?

Greetings from rainy Amsterdam,

Jan

Post Reply
113 posts

Who is online

Users browsing this forum: No registered users and 19 guests