"ValueError: invalid literal for int() with base 10: '' ?

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

"ValueError: invalid literal for int() with base 10: '' ?

Postby Aloys » Sun May 01, 2011 10:40 am

I just got this very foreign error message; and I am totally clueless as to what is triggering it..
Traceback (most recent call last):
File "C:\Users\Blouc blouc\AppData\Roaming\Blender Foundation\Blender\.blender
\scripts\PyPRP\prp_Export.py", line 174, in open_file
export_age(agename,basepath,selection,merge)
File "C:\Users\Blouc blouc\AppData\Roaming\Blender Foundation\Blender\.blender
\scripts\PyPRP\prp_Export.py", line 85, in export_age
page.export_all(selection)
File "C:\Users\Blouc blouc\AppData\Roaming\Blender Foundation\Blender\.blender
\scripts\PyPRP\prp_ResManager.py", line 279, in export_all
pagenum = getStrIntPropertyOrDefault(obj,"page_num",0)
File "C:\Users\Blouc blouc\AppData\Roaming\Blender Foundation\Blender\.blender
\scripts\PyPRP\prp_Functions.py", line 285, in getStrIntPropertyOrDefault
var=int(p.getData())
ValueError: invalid literal for int() with base 10: ''

I have never seen that error before.
The Age exported just fine a couple minutes ago, and I haven't done anything unusual since. It appears at the very beginning of the export, right after exporting the textures page, I it appears no object is being exported at this point. I checked the usual suspects and I can't see anything..
Would anybody know what could be wrong?
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: "ValueError: invalid literal for int() with base 10: ''

Postby Sirius » Sun May 01, 2011 11:03 am

Have you got an object with a string property ? Some kind of thing like this: string | page_num | 34 (page_num, or rc, or el, or whatever else, and 34 is a number). It might be that you set a <"> instead of a <3> (didn't pressed enough the SHIFT key).
User avatar
Sirius
 
Posts: 1508
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: "ValueError: invalid literal for int() with base 10: ''

Postby D'Lanor » Sun May 01, 2011 11:38 am

An empty page_num value will do that. Those are two single quotes.
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: "ValueError: invalid literal for int() with base 10: ''

Postby Aloys » Sun May 01, 2011 12:47 pm

It was indeed an empty string property field.. Thanks for the heads up. I'll go add that error msg on the wiki.
I feared it was something like that according to the log, but since no specific object was mentionned this was problematic to track it down: this scene has over 800 objects. :/

How come no object was mentionned btw? Usually when the export fails you know what was the last object exported that caused the issue; not here. That would be worth fixing. (if possible)

[edit] I've added that to the wiki. Unfortunately the wiki engine interprets the single quotes character as an italic tag. :P Since I can't be bothered to lookup the html code for those right now that'll stay like that. That's readable enough anyway.
User avatar
Aloys
 
Posts: 1968
Joined: Sun Oct 21, 2007 7:57 pm
Location: France (GMT +1)

Re: "ValueError: invalid literal for int() with base 10: ''

Postby Sirius » Mon May 02, 2011 10:36 am

D'Lanor wrote:Those are two single quotes

Ah, yes. I thought it was quite strange as Python usually prints string variables in quotes, but I thought it was one symbol.

I sometime think it isn't a good idea to put a page_num property on each object... when you use the rc or el for kickables, that's not a problem, but when you have so much objects it is quite annoying.
I think I saw a tool in PyPRP that copies an object's property to other selected objects (in the script window somewhere).

...
As we're currently in PyPRP upgrades, what about an option to enable the use of layers instead of the page_num option ? It makes more meaning to my mind. Also it might be better when you want to see each objects you have in a page without having the other Age parts (especially for big Ages).
Just my idea...
User avatar
Sirius
 
Posts: 1508
Joined: Mon Jul 26, 2010 4:46 am
Location: France

Re: "ValueError: invalid literal for int() with base 10: ''

Postby tachzusamm » Mon May 02, 2011 11:18 am

Sirius wrote:I sometime think it isn't a good idea to put a page_num property on each object... when you use the rc or el for kickables, that's not a problem, but when you have so much objects it is quite annoying.
I think I saw a tool in PyPRP that copies an object's property to other selected objects (in the script window somewhere).

In Blender simply select all objects (hold Shift key after clicking the first) you want to set to a page_num (apply the page_num string property, that is), then add this property (or change it) - this sets the "active" object to the desired page_num.
Then, press Ctrl+C (with mouse over 3D view window), which opens a "Copy Attributes" option dialog. Select "Properties".
Another option dialog "Property" opens, allowing you to select what to copy; select "page_num", and you're done.
;)

Unfortunately this is still missing in 2.57 :( , together with much other useful stuff.


As for Layers: They are limited to 20, and too useful for other things in my opinion (like moving objects quickly to another layer for editing them, or keeping colliders on a different layer, and so on).
Maybe using different scenes as pages could work - this would have the advantage that you already realize that objects in different pages in URU don't interact with other pages (a lamp on page 0 will not lit objects on page 1 for example).
User avatar
tachzusamm
 
Posts: 575
Joined: Thu May 29, 2008 2:03 am
Location: Germany

Re: "ValueError: invalid literal for int() with base 10: ''

Postby Tsar Hoikas » Mon May 02, 2011 10:23 pm

This thread has been moved. Learn why here.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia


Return to Building

Who is online

Users browsing this forum: No registered users and 6 guests