Create Maya Object

Create Maya Object

Christoph_Schaedl
Mentor Mentor
2,500 Views
15 Replies
Message 1 of 16

Create Maya Object

Christoph_Schaedl
Mentor
Mentor

Is there an other way to create a Maya Object from Bifrost than using an existing Shapenode and reconnect it?

 

biftoM.JPG

----------------------------------------------------------------
https://linktr.ee/cg_oglu
0 Likes
Accepted solutions (1)
2,501 Views
15 Replies
Replies (15)
Message 2 of 16

labbejason
Advocate
Advocate

You can hit tab in the Node Editor and type in `mesh` to create an empty mesh at which point you can connect to that, as oppose to creating a temporary torus. Is that what you meant?

0 Likes
Message 3 of 16

Christoph_Schaedl
Mentor
Mentor

Thats still to complicated.

Users here in the Studio want a single click solution.

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 4 of 16

marcus.nordenstam
Alumni
Alumni

Why does it need to be a Maya object specifically?  Why not just a bifShape?

 

You can of course make a one-click solution by packaging up the MEL/Python commands to make a board, add whatever compounds you need inside it, and hook it up to the DG - and wrap it as a button on the shelf - same as you would with any other MEL or Python script.

0 Likes
Message 5 of 16

Christoph_Schaedl
Mentor
Mentor

BifShapes do not render outside the Arnold world.

And i need todo some extra modeling work on this objects.

 

And we dont have any TDs here to get such tools working.

 

I agree i could do it myself but there is no time during production.

Small Studios have different demands.

----------------------------------------------------------------
https://linktr.ee/cg_oglu
0 Likes
Message 6 of 16

labbejason
Advocate
Advocate

That's already as simple as it gets, so the only other option is like Marcus said, and that's to script it. Afterwards you can place it on a shelf, or do it old school guerrilla style and execute from the Script Editor.

 

Here's a quick script snippet that will loop through all selected bif shapes and create new Maya meshes from them. It won't work for Bifrost instances, but as long as the output is an Amino object it *should* be ok.

Message 7 of 16

Christoph_Schaedl
Mentor
Mentor

It does work. Thanks.

 

But i get in this case a strange result. It does only convert one of the cubes.

Im not sure if thats the expected behavior.

 

bif_one.JPG

----------------------------------------------------------------
https://linktr.ee/cg_oglu
0 Likes
Message 8 of 16

Christoph_Schaedl
Mentor
Mentor

Here is the scene.

 

 

----------------------------------------------------------------
https://linktr.ee/cg_oglu
0 Likes
Message 9 of 16

mjcg91
Collaborator
Collaborator

That's because Jason's pretty script doesn't take into account object array. It only creates a mesh per bifShape.

 

You can modify the script to query the size of the .mayaMesh array of bifrostGeoToMaya, and then add a loop on it. It's a bit annoying though as you need to force pull some data first in order to query the array size. What I do is plug mayaMesh[0] to a temporary mesh, use cmds.refresh(), and finally I can pull the size of the array, and then create my meshes inside a loop. 

Maxime Jeanmougin - Technical Artist
https://maximejeanmougin.com

Join the Bifrost Addicts community on Discord:
https://discord.gg/bifrost-addicts
0 Likes
Message 10 of 16

labbejason
Advocate
Advocate
Accepted solution

Yes Max is correct, it wasn't taking into account Amino arrays.

 

Here's an updated version that will support arrays. Kind of annoying to get it working since `bifrostGeoToMaya` doesn't expose the length of its output until after it's connected to a mesh, so at first it does a temporary connection to an empty mesh to expose that length, then generates the meshes. Edit: Just noticed Max came across the same thing here! *curses Maya*

 

Here's a test with your scene with 3 bifs at the same time that have mixed single/array outputs:

bif_to_mesh.gif

Message 11 of 16

Christoph_Schaedl
Mentor
Mentor

Thats great! Many Thanks.

----------------------------------------------------------------
https://linktr.ee/cg_oglu
0 Likes
Message 12 of 16

Anonymous
Not applicable

.

0 Likes
Message 13 of 16

labbejason
Advocate
Advocate

No worries, you can send my beer in the mail 🙂

 

 

0 Likes
Message 14 of 16

Christoph_Schaedl
Mentor
Mentor

This script deserves a Shelf Icon!

Thanks!

 

biftomaya.jpg

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 15 of 16

Christoph_Schaedl
Mentor
Mentor

New version to convert a GraphShape into Maya Geo.

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 16 of 16

Anonymous
Not applicable

thanks

0 Likes