Locator for Maya

70 views
Skip to first unread message

Daniel Rivas Perpén

unread,
Jan 21, 2024, 8:30:36 PM1/21/24
to alembic-discussion
Hi,
I am trying to export from my app an Alembic file which only member is interpreted as a Locator by Maya. So far I can export the animation with no issues, but in Maya don;t take it as a locator (it appears as a invisible generic shape node in outliner) What is the proper way to set the property? This is what I have now:

```
# Alembic
frame_rate = 24.0
time_sampling = TimeSampling(
    float(1.0 / frame_rate), float(start_frame) * float(1.0 / frame_rate)
)

# Create Alembic archive with the defined time sampling
out_path_abc = os.path.join(path, "locator_alembic.abc")
archive = OArchive(out_path_abc)#, asOgawa=False)
xform = OXform(archive.getTop(), "locator1")

xform_schema = xform.getSchema()
xform_schema.setTimeSampling(time_sampling)

user_props = xform_schema.getUserProperties()
box_property = OBox3dProperty(user_props, "locator")
bbox = Box3d(V3d(1.,2.,3.), V3d(4.,5.,6.))
box_property.setValue(bbox)

for frame in range(start_frame, last_frame + 1):
    transform = get_transform()
    xform_sample = XformSample()
    xform_sample.setMatrix(M44d(*transform.T.flatten()))
    xform.getSchema().set(xform_sample)

// Warning: Unsupported attr, skipping: locator float64_t[6] //
```

Pawel Olas

unread,
Jan 22, 2024, 1:37:25 AM1/22/24
to alembic-d...@googlegroups.com
This is what I have in my exporter: 
      
        cp = xform2.getProperties()
        d_type = alembic.AbcCoreAbstract.DataType(alembic.Util.POD.kFloat64POD, 6)
        m_sp = alembic.Abc.OScalarProperty(cp, 'locator', d_type, self.time_sampling_id)
        tt = setArrayList(alembic.Abc.Float64TPTraits, [0, 0, 0, 1, 1, 1])
        m_sp.setValue(tt)

hope this helps :-)




--
fin
Pawel Olas
CG Supervisor
 
t:   +61 2 9331 8733   m:  +61 433 463 290   e:  pa...@findesign.com.au
a:  1a Marshall Street, Surry Hills, Sydney NSW 2010 Australia    w:  www.findesign.com.au

Daniel Rivas Perpén

unread,
Jan 22, 2024, 7:07:11 AM1/22/24
to alembic-d...@googlegroups.com

Thank you so much!


--
You received this message because you are subscribed to the Google Groups "alembic-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alembic-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/alembic-discussion/CAAahpsW6ve3_uw_jp856upBW0tC%3D3tOdc8nJCsuo5Sd193hFRg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages