Jump to content
Sign in to follow this  
poetic

C4D Plugin/Scripter Searched (Paid)

Recommended Posts

Hello,

 

I'd like to hire a coder to help me write a custom script for me for Cinema 4D R20+. I'm using the Ornatrix plugin https://ephere.com/plugins/MAXON/c4d/ornatrix/, and

I'd like the script to go trough each frame of the scene and "press" the 'Export Spline' button (execute the corresponding command) found in the 'CurvesFromStrands' Ornatrix modifier, and save out the each resulting Spline into a separate c4d scene.

 

(Context: I can then load the resulting sequence of c4d scenes into a xref object and bake them into 1 animated spline with Point Level Animation. The stepping trough frames, and saving out scenes with 1 separated spline and the baking I already got covered. What I'm struggling with is how to interact with the Ornatrix plugin)

 

Thank you,
Andrej

Share this post


Link to post

Hello

There are some moments which matter - is the command you want to call listed in Shift+C Commander list/menu? Does it leave some trace in script listener?
If neither of this is true, I doubt it's accessible from outside of the plugin, at least I'm uncertain if there is a way to reach it.
Than, is there a way to save the file without Save As... dialog? If not, there might be a problem.

Seems there's no documented ways to interact with the plugin (SDK has only guide editing functionality for custom brushes) so only tricks will work I guess..

Share this post


Link to post
Author of the topic Posted

Hi,

thank you for your fast reply. Regarding your questions:

1) Shift+C does not have the 'Export Spline' command listed. Only a 'CurvesFromStrands' command adding the modifier.

2) How can I verify if "it leaves a trace in script listener"? What is a script listener? Do you mean the Script > Console (Shift + F10)? Is so, no, there is nothing new in the console, when I click on the 'Export Spline' button.

The saving of the generated spline is not a problem, I have a similar script using the 'Edge To Spline' command, it creates a newdoc = c4d.documents.IsolateObjects( doc, [temp] ), saves it, kills it and sets the original one back as active, advances a frame, generates a new spline, isolates it etc..

 

If I understand the point 2) correctly, I agree there are only tricks left: Is there not a way how to simulate a UI button click?

The plugin has the UI definitions in the res forlder: there is a oCurvesFromStrandsModifier.res with GROUPS and SEPARATORS definitions, including a 

 

GROUP
        {
            COLUMNS 2;
            
            BUTTON cfs_Button_Rebuild {}
            BUTTON cfs_Button_Export {}
        }

 

defintiion.

and oCurvesFromStrandsModifier.h has an enum defintiion with

...

cfs_Button_Rebuild = 3000,
    cfs_Button_Export,

...

 

Can we somehow simulate a button click in the UI? Selecting the CurvesFromStrands object in Object Manager, and open/select/make active the Attribute Manager and activate/press/click button UI #2? Or take over mouse control, set it to a screen pixel coordinate (I would use a fixed layout) and trigger a Left Button Event? I don't need a bullet proof solution, a hack is good enough.

 

Thank you.

Share this post


Link to post

.res file contains interface descriptions/layout/UI elements ids, but all of this is used internally by the code which we don't have access to and can't, as far as I know, interact with it.

Simulating clicks might be possible, uncertain, but there are too many problems with such approach even if it can be done from C4D (I hugely doubt modal dialogs can be handled this way, I think no).

Maybe in-built feature "bake as alembic" would help you? It should work with splines well. If so, that's all you need

Share this post


Link to post

Hi,
I should be able to help. PM me, if you like.

Cheers

Share this post


Link to post
Author of the topic Posted

@Intenditore: Thank you for your reply. Yes, I checked the File > Export > Orantrix Alembic (.abc) option before even posting here, but the trouble was, when I reopened the generated .abc Cinema reinterpreted it as an Ornatrix object (which makes sense). But your comment gave me another reason to try, and I imported it into Blender and yes! it brings over animated curves!

 

I just now have to figure out what format to use, to export the animated curves from blender and import them back into Cinema so that they are imported as Splines. I tried to export from Blender as alembic and import in Cinema, but the scene seems empty. But I'll keep trying. If anyone has experience with Blender and can advice me on export options, it's highly appreciated.

 

@MighT: Thank you for your offer, I'll see how this pans out.

Share this post


Link to post
Author of the topic Posted

Ok, so I found the workaround, if anyone is interested:

1) export scene with File > Export > Ortantrix Alembic (I used Cinema R20)

2) open the exported file, with ANOTHER installation of Cinema 4D, that does not have Orantrix plugin installed (I used Cinema R21)

It opens the spline as an alembic object:

- you have to click on 'Make Editable'

- then add a Point Cache tag, and Store and Calculate the animation

- then you can right click the object and use Show Tracks, (I use View > Automode and drag and drop the object into the Track View), Function > Bake objects and make sure PLA is checked

- this produces a Spline animated at PLA level, that can be used to drive a Hair object (drag and drop into Guides Link, select Spline Guides and make sure to uncheck Hair Dynamics)

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...