Blender2indigo 0.62beta1

Announcements, requests and support regarding the Blender Indigo export script
Jananton
Posts: 66
Joined: Sun Dec 31, 2006 12:56 pm
Location: Amsterdam, The Netherlands

Post by Jananton » Sat Jan 13, 2007 7:35 am

afecelis wrote:great, Hans and Jan! :wink:
Jan, could you upload your mod file as well?
I'll see what I can do tomorrow. :wink:

Btw, did that little piece of untested code I wipped up some five days ago work on your Linux installation? If so, we can test if it's possible to make the one script work on both OS's... 8)
( for now my tinkering is based on WinXP pro only )

Greetings from nighttime Amsterdam,

Jan

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

Post by u3dreal » Sat Jan 13, 2007 11:18 am

yes we defnetly have to go with a two OS version exporter..

when i find time

cheers

u3dreal ;)

User avatar
Hans
Posts: 14
Joined: Thu Jan 11, 2007 3:58 am
Location: Japan
Contact:

Post by Hans » Sat Jan 13, 2007 2:35 pm

Hello, Jananton.
Yours might be better than mine. Mine depends on WinNT deeply.

afecelis, thanks.

Hello, u3dreal. The exporter is quite nice. Thank you.

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

Re: Solution for the problem

Post by u3dreal » Sat Jan 13, 2007 3:05 pm

Jananton wrote:Hello Hans,
Hans wrote:Hi, I'm Hans. This exporter is nice, and I know it doesn't work well with " " in the path. So I changed the code...
Yup, that's the way to go. One point though, to make it all as OS undependant as possible I've rearranged the launch function as follows:

Code: Select all

def launchIndigo(filename):
	# get blenders 'bpydata' directory
	datadir=Blender.Get("datadir")
	
	# open 'IndigoWrapper.conf' and read the first line
	f = open(os.path.join(datadir, 'IndigoWrapper.conf'), 'r+')
	ic=f.readline()
	f.close()
	
	# create 'IndigoWrapper.cmd' and write two lines of code into it
	f = open(os.path.join(datadir, 'IndigoWrapper.cmd'), 'w')
	f.write("cd /d " + ic + "\n")
	f.write("start /b /belownormal Indigo.exe "%1" -t " + str(Threads.val) + "\n")
	f.close()
	
	# call external shell script to start Indigo
	cmd = os.path.join(datadir, 'IndigoWrapper.cmd') + ' "' + filename + '"'
	print cmd
	os.system(cmd)
One little other thing I found is that when ToneMapping is set to none or in other words linear, the line in the export script for writing the exposure value should read: <scale>%.6f</scale> instead of %.3f, so it should look like:

Code: Select all

		file.write("\t<tonemapping>\n")
		file.write("\t\t<linear>\n")
		file.write("\t\t\t<scale>%.6f</scale>\n" %exposure)
		file.write("\t\t</linear>\n")
		file.write("\t</tonemapping>\n\n")
Greetings from overcast Amsterdam,

Jan
Done and added support for both OS !

cheers

u3dreal ;)

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

Post by u3dreal » Sat Jan 13, 2007 3:16 pm

Jananton wrote:
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:
when unchecking def NO geometry will be exporter this comes very handy as
you can change materials,camera and so on withou reexporting !!!

added and fixed..

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

Post by afecelis » Sat Jan 13, 2007 4:41 pm

awwwwwwwhhhh! U3dreal, you've just made my sleepy 12:04 am a better and happier instant! :wink:

Same link as in the 1st post or not published yet?
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 » Sat Jan 13, 2007 8:54 pm

u3dreal wrote:when unchecking def NO geometry will be exporter this comes very handy as you can change materials,camera and so on without reexporting !!!

added and fixed..
Ok, I can understand that thought, but mayby the user should have a choice when unchecking the geo button to either ommit or include the geometric data in the exported file.

I noticed I've introduced a bug in the export event, the correct code should read including independancy fixes:

Code: Select all

	if evt == evtExport:
		if DefaultExport.val == 1:
			datadir=Blender.Get("datadir")
			f = open(os.path.join(datadir, 'IndigoWrapper.conf'), 'r+')
			ic=f.readline()
			f.close()
			filename = os.path.join(ic, 'default.xml')
			save_still(filename)
		else:
			Blender.Window.FileSelector(save_still, "Export", newFName('xml'))
Well, that's it for now, I'll see if I can put up a link to what I have now later today... 8)

Greetings from cloudy Amsterdam,

Jan

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

Post by Jananton » Sat Jan 13, 2007 11:16 pm

Hello All,

As asked by afecelis, the following link should help you at the current state of my revised version of the export script for indigo v. 6

revised export script v. 63beta1

Read the readme.txt file included for installation instructions and if you want to try this on Linux, note that the file Indigowrapper.conf is not nescessairy.

Greetings from overcast Amsterdam,

Jan

Phil
Posts: 154
Joined: Mon Nov 06, 2006 2:22 am
Location: St. Wendel, Germany

Post by Phil » Sat Jan 13, 2007 11:52 pm

:evil:

0.63beta1

Image

Regards, Phil

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

Post by u3dreal » Sun Jan 14, 2007 12:50 am

Cool Jananton. :D :D

do me a favour and update the old version until i have 0.7 ready... 8)

thats cool ... thanks for helping me fixing bugs thats great so i can
concentrate on implementing the new stuff...;)

cheers

u3dreal ;)

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

Post by u3dreal » Sun Jan 14, 2007 12:58 am

Phil wrote::evil:

0.63beta1

Image

Regards, Phil
That seems to be a nasty bug... somehow i got that working
with the radium exporter .. so i'll have a look once again.

cheers

u3dreal ;)

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

Post by Jananton » Sun Jan 14, 2007 1:23 am

Phil wrote::evil:

0.63beta1

Image

Regards, Phil
Hmm, so exporting the file does happen, it's the launch again....

I can only think of two solutions now.

The first is to change the content of the created cmd file, if this doesn't help at least we know which part is the culprit. So go to launchWinIndigo() and change to the following:

Code: Select all

	# create 'IndigoWrapper.cmd' and write two lines of code into it
	f = open(os.path.join(datadir, 'IndigoWrapper.cmd'), 'w')
	f.write("echo 'Change to indigo root folder'\n")
	f.write("cd /d "" + ic + ""\n")
	f.write("echo 'Now start indigo with file on commandline'\n")
	f.write("start /b /belownormal Indigo.exe %1 -t " + str(Threads.val) + "\n")
	f.close()
When an error occurs and no echoed text is visible then the error is in calling this cmd file itself. If this is the case try the following, otherwise take another screenshot to see which line is faulty

Code: Select all

	# call external shell script to start Indigo
	os.chdir(datadir)
	cmd = 'IndigoWrapper.cmd "' + filename + """
	print cmd
	os.system(cmd)
As said in the readme.txt file it's very hard for me to test this since blender is installed on another partition than the default windows c: one. I did however put indigo there, since installing is just unzipping to a folder, and that's probably why exporting the file is no problem.. :wink:

Please try the above and let me know the results so I can update the script accordingly.

As for the missing function makename, this is the animation part, as with rendering times of 24 hours and up for good results I haven't looked at that part of the script at all...

Greetings from overcast Amsterdam,

Jan

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

Post by drBouvierLeduc » Sun Jan 14, 2007 1:44 am

Problem with UV textures :

My projects are located in "c:\program files\indigo\scenes\xxx\...", with .blend files and textures.
But the exporter looks for the textures in "c:\program files\indigo\...", so it can't find them.

Is there a way to make it look in the directory where the .blend file is ?

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

Post by afecelis » Sun Jan 14, 2007 2:02 am

I agree with drBouvierLeduc, relative paths are much better than hard-coded absolute paths :wink:

Jan, can you please look into it?
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 » Sun Jan 14, 2007 2:25 am

SIDE NOTE: well, I just remembered that U3dreal recommended me to use a blender version installed (unzipped) at C:\
This way the path wouldn't get lost in "Program Files" (long name-spaces), so I tried Jan's beta3 exporter in this one instead, and it works great!!!
@Jan: One question though: U3dreal's exporter has a "none" option among the environment options to choose; yours uses the usual 3 (texture map, physical sky, background color). Is "none" interpreted as bkg color? Hence getting rid of it your version?

regards, and thanks for all the help. :D
AMD Ryzen 7 1800 @3.6ghz, 32GB ddr4 3200 mhz Ram, Nvidia RTX 3060 12GB, Win10, Blender/Sketchup/Modo/Cinema4d

Post Reply
113 posts

Who is online

Users browsing this forum: No registered users and 4 guests