Page 1 of 1

Broken Cameras

PostPosted: Wed Mar 05, 2008 9:18 pm
by Robert The Rebuilder
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?

Re: Broken Cameras

PostPosted: Wed Mar 05, 2008 9:23 pm
by Nadnerb
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?

Re: Broken Cameras

PostPosted: Wed Mar 05, 2008 10:14 pm
by Paradox
alctype should be set to object if none is specified, regardless of Blender data type.

Re: Broken Cameras

PostPosted: Thu Mar 06, 2008 4:48 am
by Robert The Rebuilder
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.