Page 1 of 1

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

PostPosted: Sun May 01, 2011 10:40 am
by Aloys
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?

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

PostPosted: Sun May 01, 2011 11:03 am
by Sirius
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).

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

PostPosted: Sun May 01, 2011 11:38 am
by D'Lanor
An empty page_num value will do that. Those are two single quotes.

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

PostPosted: Sun May 01, 2011 12:47 pm
by Aloys
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.

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

PostPosted: Mon May 02, 2011 10:36 am
by Sirius
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...

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

PostPosted: Mon May 02, 2011 11:18 am
by tachzusamm
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).

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

PostPosted: Mon May 02, 2011 10:23 pm
by Tsar Hoikas
This thread has been moved. Learn why here.