Isotropix Forums

Alembic camera problems (C4D)

You think you may have found a bug? Please post it here.

Alembic camera problems (C4D)

Unread postby David_A » Sun Jul 31, 2016 6:23 pm

Hello!

I need some help. May be it is a bug, because I used to do it with 2.0 and worked ok, but now in 3.0 this is driving me mad.I just prepared a scene file to demo the problem.

I have a scene in C4D, with static and animated cameras. The scene is exported to Clarisse using Alembic.
When the scene is loaded into Clarisse and the imported camera/s are selected for the 3dLayer, there is a mismatch in camera coordinates or properties that turn the imported scene unusable as for matching purposes (specially for Camera Maps).

*Fit mode Horizontal: The scene is rendered with the camera at 0,0,0 (very likely)
*Fit mode Vertical: There is a mismatch in Focal Length/H or V Apertures/H or V Fields or view, even coordinates that makes the scene unusable
*Fit mode Remap: Big render glitch, not sure how to describe it. You can see it in the attached image below.
*Fit mode Fill: The scene is also rendered with the camera at 0,0,0 (very likely)

This is happening for both static and animated cameras. I've tried every possible combination of export settings, lots of different configurations for cameras (parented to a null, object, parent of / child of / baked properties and/or transformations... to no avail)
Please help! If this is not a bug, could you point me in the right direction? I do not know what I am missing.

FitMode_Remap.jpg
Fit mode: Remap.

FitMode_Vertical.jpg
Fit mode: Vertical. See the mismatch with the rendered C4D scene in the layer below


And here is the compressed directory with the Clarisse file, C4D file, and Alembic export

C4D_Clarisse_Alembic_Troubles.zip
Scene File (Clarisse + C4D + Alembic + attached images and renders)
(694.09 KiB) Downloaded 204 times
David_A
 
Posts: 148
Joined: Wed Apr 06, 2016 10:24 am

Re: Alembic camera problems (C4D)

Unread postby fjutel » Tue Aug 02, 2016 3:54 pm

Hi David,

Thanks for the feedback. We had a look at your problem and it appears that your camera from C4D has a custom lens ration (0.1). We have changed this value to 1 and rendered looks ok then you can check if your camera setup is correct ?

Regards,
Florent Jutel
Isotropix
Clarisse QA
fjutel
 
Posts: 266
Joined: Tue Jan 13, 2015 12:21 pm

Re: Alembic camera problems (C4D)

Unread postby David_A » Tue Aug 02, 2016 4:06 pm

fjutel wrote:Hi David,

Thanks for the feedback. We had a look at your problem and it appears that your camera from C4D has a custom lens ration (0.1). We have changed this value to 1 and rendered looks ok then you can check if your camera setup is correct ?

Regards,


Thank you very much Florent! You guys rock.
I'll give it a try later this afternoon, catch that funny value, and get back to you.
:)
David_A
 
Posts: 148
Joined: Wed Apr 06, 2016 10:24 am

Re: Alembic camera problems (C4D)

Unread postby David_A » Tue Aug 02, 2016 5:41 pm

fjutel wrote:Hi David,

Thanks for the feedback. We had a look at your problem and it appears that your camera from C4D has a custom lens ration (0.1). We have changed this value to 1 and rendered looks ok then you can check if your camera setup is correct ?

Regards,


Indeed, the problem was that "0.1" value (that is nowhere to be clearly found within C4D). After lots of tweaks I matched the two cameras.
Clearly there is something wrong in my pipe, and might be C4D exporting the file.
As I cannot modify the value of a imported camera, typing the same values with a newly created advanced camera in Clarisse solves the problem for a static camera.

Thanks Florent!
David_A
 
Posts: 148
Joined: Wed Apr 06, 2016 10:24 am

Re: Alembic camera problems (C4D)

Unread postby Stuffguy » Tue Aug 09, 2016 6:52 pm

It seems to be something with the information in the C4D exporter. I"ll contact Maxon and report the issue.

@Florent, is there a way yet yo be able to override these specific greyed out values from alembics? That'd be my preference rather than a duplicate camera, but for David, I'll have some scripts soon with several camera utilities particularly one for duplicating the alembic export camera.
Stuffguy
 
Posts: 4
Joined: Sat Nov 01, 2014 6:43 am

Re: Alembic camera problems (C4D)

Unread postby fjutel » Wed Aug 10, 2016 10:12 am

Hi,

No, it's not possible to override the greyed out values. The greyed values are "read only" because they are read from the alembic file. In order to change these values you can re-export your alembic file with the good values or duplicate your object with a script.

Cheers,
Florent Jutel
Isotropix
Clarisse QA
fjutel
 
Posts: 266
Joined: Tue Jan 13, 2015 12:21 pm

Re: Alembic camera problems (C4D)

Unread postby David_A » Sat Aug 27, 2016 10:27 am

fjutel wrote:Hi,

No, it's not possible to override the greyed out values. The greyed values are "read only" because they are read from the alembic file. In order to change these values you can re-export your alembic file with the good values or duplicate your object with a script.

Cheers,


Florent,

Could you post an example script on how to correctly duplicate an animated alembic object? Thanks in advance!
David_A
 
Posts: 148
Joined: Wed Apr 06, 2016 10:24 am

Re: Alembic camera problems (C4D)

Unread postby fjutel » Fri Sep 02, 2016 2:19 pm

Hi,

Of course, here 's a simple example script to duplicate an alembic camera with its animation.

Code: Select all
ix.begin_command_batch("Script_copy_camera_animated")

if ix.selection.is_empty() == True:

     ix.log_warning("No selection")

elif ix.selection[0].get_class_info_name() == "OfContext":

     ix.log_warning("It's not an alembic camera")

else:

    camera_abc = ix.selection[0]

    if camera_abc.get_class_name() == "CameraAlembic":

        ix.cmds.CopyItemsTo([camera_abc.get_full_name()], "project:/")

        camera_temp = ix.get_item("project://" + camera_abc.get_name())

        new_camera = ix.cmds.CreateObject("perspective_advanced", "CameraPerspectiveAdvanced","project:/")

        translat = ix.api.GMathVec3d()
        rot = ix.api.GMathVec3d()
        shear = ix.api.GMathVec3d()
        sca = ix.api.GMathVec3d()
        fps = ix.application.get_factory().get_time().get_fps()

        for i in range(camera_abc.attrs.anim_frame_count[0]):

            ix.application.check_for_events()
            ix.cmds.SetCurrentFrame(i)


            cam = camera_abc.get_module().get_global_matrix()
            cam.extract_translation(translat)
            cam.compute_euler_angles(rot)
            cam.extract_scaling(sca)
            cam.extract_shearing(shear)

            for index in range(0,3):

                ix.cmds.SetKey([new_camera.get_full_name()+".translate["+str(index)+"]"], (i/fps),[(translat[index])],0)
                ix.cmds.SetKey([new_camera.get_full_name()+".shear["+str(index)+"]"], (i/fps),[(shear[index])],0)
                ix.cmds.SetKey([new_camera.get_full_name()+".rotate["+str(index)+"]"],(i/fps), [(rot[index])],0)
                ix.cmds.SetKey([new_camera.get_full_name()+".scale["+str(index)+"]"],(i/fps), [(sca[index])],0)

        ix.cmds.SetValue(new_camera.get_full_name()+".horizontal_aperture", [str(camera_temp.attrs.horizontal_aperture[0])])
        ix.cmds.SetValue(new_camera.get_full_name()+".vertical_aperture", [str(camera_temp.attrs.vertical_aperture[0])])
        ix.cmds.SetValue(new_camera.get_full_name()+".focal_length", [str(camera_temp.attrs.focal_length[0])])
        ix.cmds.SetValue(new_camera.get_full_name()+".horizontal_field_of_view", [str(camera_temp.attrs.horizontal_field_of_view[0])])
        ix.cmds.SetValue(new_camera.get_full_name()+".vertical_field_of_view", [str(camera_temp.attrs.vertical_field_of_view[0])])
        ix.cmds.SetValue(new_camera.get_full_name()+".film_offset[0]", [str(camera_temp.attrs.film_offset[0])])
        ix.cmds.SetValue(new_camera.get_full_name()+".fit_mode", [str(camera_temp.attrs.fit_mode[0])])
        ix.cmds.SetValue(new_camera.get_full_name()+".lens_ratio", [str(camera_temp.attrs.lens_ratio[0])])

        if camera_temp.attrs.enable_dof.attr.get_bool() == True:
            ix.cmds.SetValue(new_camera.get_full_name()+".enable_dof", [str(int(camera_temp.attrs.enable_dof.attr.get_bool()))])
            ix.cmds.SetValue(new_camera.get_full_name()+".f_stop", [str(camera_temp.attrs.f_stop[0])])
            ix.cmds.SetValue(new_camera.get_full_name()+".focus_distance", [str(camera_temp.attrs.focus_distance[0])])

        ix.delete_item(camera_temp.get_full_name())

    else:
        ix.log_warning("No alembic camera selected")

ix.end_command_batch()


Cheers,
Florent Jutel
Isotropix
Clarisse QA
fjutel
 
Posts: 266
Joined: Tue Jan 13, 2015 12:21 pm

Re: Alembic camera problems (C4D)

Unread postby David_A » Sat Sep 03, 2016 10:52 am

fjutel wrote:Hi,

Of course, here 's a simple example script to duplicate an alembic camera with its animation.

:
:
:

Cheers,


Thank you very very much!!!
David_A
 
Posts: 148
Joined: Wed Apr 06, 2016 10:24 am


Return to Bugs Archive