Broken Cameras

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!

Broken Cameras

Postby Robert The Rebuilder » Wed Mar 05, 2008 9:18 pm

In the latest SVN version, cameras are not exported. They are just skipped over during export. I traced this to line 617 in alcresmanager.py:

Code: Select all
            elif obj_type=="Camera":
 >>>            if (alctype == 'camera') or (alctype == 'object'):
                    ...


The problem is, alctype is only set in the case where obj_type is "Mesh". So, the only time this works is if the previous exported object happened to be of alctype "object".

I removed this line and un-indented the next few lines in my version (restoring to how it was back in revision 58) and consequently the cameras work again. I attempted to upload this to the contrib folder, but SVN is down at the moment. Would someone please make this modification for me?
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US

Re: Broken Cameras

Postby Nadnerb » Wed Mar 05, 2008 9:23 pm

Uhm.. I've been successfully exporting cameras with the newest release for a while. (In my "flipTest" age, and they very clearly work) What's up?
Image
Live KI: 34914 MOULa KI: 23247 Gehn KI: 11588 Available Ages: TunnelDemo3, BoxAge, Odema
Nadnerb
 
Posts: 1057
Joined: Fri Sep 28, 2007 8:01 pm
Location: US (Eastern Time)

Re: Broken Cameras

Postby Paradox » Wed Mar 05, 2008 10:14 pm

alctype should be set to object if none is specified, regardless of Blender data type.
Paradox
 
Posts: 1295
Joined: Fri Sep 28, 2007 6:48 pm
Location: Canada

Re: Broken Cameras

Postby Robert The Rebuilder » Thu Mar 06, 2008 4:48 am

Nadnerb: you are lucky - you happen to have an object preceding your camera that sets alctype to "object". I am not lucky - I have 10 cameras, and only one is exporting. Other people may not be lucky, either.

Paradox: the code you mention is only in the obj_type == "mesh" case. It does not execute for obj_type == "camera". Here's the current code:

Code: Select all
            if obj_type=="Mesh":
                # Get the "type" property, first from the alcscript, and next from the 'alctype' proprty
                # (which overrides alsccript)
                try:
                    alctype = objscript['type']
                except:
                    alctype = 'object'
                alctype = getTextPropertyOrDefault(obj,"type",alctype)


Perhaps a better fix would be to place this code above the check for obj_type, like this:

Code: Select all
            # Get the "type" property, first from the alcscript, and next from the 'alctype' proprty
            # (which overrides alsccript)
            try:
                alctype = objscript['type']
            except:
                alctype = 'object'
            alctype = getTextPropertyOrDefault(obj,"type",alctype)

            if obj_type=="Mesh":


That way, it applies to both meshes and cameras. Also, if you have a camera that you don't want to be exported (e.g. for rendering), you can set its AlcScript type to something other than camera or object (e.g. "notacamera").

I've checked in the modified alcresmanager.py file into contrib for review.
Can we rebuild it? Yes, we can - here's how.

MOULagain KI# 1299

Myst Movie coming soon - spread the word!
User avatar
Robert The Rebuilder
 
Posts: 1383
Joined: Sat Sep 29, 2007 7:24 am
Location: Virginia, US


Return to Building

Who is online

Users browsing this forum: No registered users and 2 guests

cron