How to convert an Xpresso Object Rig into a downloadable Plugin?
-
Hi Everyone,
I've managed to build a complex Xpresso rig which I'd like to turn into a plugin,
I have no scripting knowledge besides copying and pasting or finding where the files should go so bare with me.
I would like to:
Hide my user data or transfer it to a script? it's currently on a null object and connected to an Xpresso tag
Add an Icon
convert my object plugin into a script or one file that people can download.
Sorry if I'm not specific but I'm having trouble figuring out what files should be in my folder structure and whats important or not.
Thanks!
-
Hi shir, thanks for reaching us.
With regard to your question, given that it's not in our mission to deliver finalized script or plugin to our community members, we are indeed committed to help our members to grow-up and become independent in coding in Cinema.
That said, there are a few points to clarify:
- what kind of conversion do you have in mind?
- do you want to leave the Xpresso Rig to exist and simply have the script being responsible to hook it into the object in the scene?
- do you want to replace completely the Xpresso Tag with a script/plugin delivering the full functionality of your tag?
- do you want the script/plugin to recreate the Xpresso Tag on the fly and the structure of the rig you've created?
- what's the final intent of the migration to script/plugin?
- could a python tag be a plausible approach?
That said, I warmly suggest to start with our Python Documentaion and more specifically with:
- Language Overview where slivers of Python are provided
- BaseDocument where the classes responsible to hold Cinema 4D scene is described
- GraphView Module where Xpresso classes are exposed via the Python API
- Examples: the Python API example set provided.
Looking forward your additional notes, give best.
Riccardo - what kind of conversion do you have in mind?
-
Hi Ricardo,
Thanks for your speedy reply!
at a most basic level I would like to have the Xpresso rig exist as a file which can be loaded
and then have my user data controls available for people to use, but I'm interested to know how I could completely replace the tag and user data with a script as wellI essentially just want to hide my Xpresso and user data so that people have the functionality of my rig without being able to edit the input fields.
The final intention of my rig is a downloadable object creator which contains custom controls.
Thanks,
Shir -
Hi shir, thanks for providing such additional information.
I essentially just want to hide my Xpresso and user data so that people have the functionality of my rig without being able to edit the input fields.
Considering the statement quoted you could consider to use Constant nodes in your Xpresso rig to get rid of the UserData and drive your xpresso from the inside.
Then you could group your Xpresso schema in an Xgroup and lock it so that the inner logic is hidden to the final user.
Finally you can consider to password protect your Xgroup in order to avoid other users to look into it.Beside this "basic" approach, a second one would be to recreate your Xpresso rig from directly in a Python script responsible for creating the Xpresso tag, its nodes, port and connections and finally add it to your object.
Last but not least, with your development skill getting better and better you can consider to developer a Python (or C++) plugin implementing an ObjectData plugin class.
Best, Riccardo
-
Thanks Ricardo,
So I came across the solution of locking my Xpresso set up, protecting it and hiding it with layers but the last part of hiding user data may have been explained the wrong way,
Here is a screenshot of what I would like to hide from the "users" side:
On the right hand side is the User Data menu accesable from the Attributes manager with my whole interface built in there, what I would like to do is hide all of that data from the "user"I understand that this might need to be re-built in python using the correct string layout.
also from my research I would need to write some python to be able to add an Icon to my Null object in place of the C4D Icons: I would like to know if its possible to change the icons which appear on the left so that my object rig will appear with its own custom icon in the object manager.
Are there any step by step tutorials on here which can give me a basic tutorial on writing a plugin that has similar properties? for example a "hello world" script which include a few lines of user data in the attributes manager with buttons and sliders as well as basic folder structure and must haves for a c4d plugin?
Thanks, Shir
-
Hi Shir, thanks for following up and providing your additional info.
Showing parameter in the Attribute Manager or a custom icon in the Object Manager is not such a big issue: you can start looking at Py-RoundedTube which is an ObjectData derived plugin where all such a stuff (and more) is shown.
That said, the real question is instead to understand what your rig is actually doing and see if it's reasonable to implement the Xpresso functionality from a set of "primitive" functions you implement in your plugin or if would be instead easier to programmatically recreate the Xpresso rig in an XpressoTag then attached to the object generated by your plugin.Actually this assessment can't be done from here where the final functionality and the complexity of your Xpresso network is unknown.
So far I do see three approches:
- start on your own, step-by-step, dissect the code from the example I mentioned above and try to move your steps alone
- outsource the task to some paid developer
or - call for volunteers in our very helpful PluginCafe community.
I'm sorry not be more helpful but, as said in the first post, we can't deliver turn-key plugins or scripts but rather help our customer to learn from our resources.
Best, Riccardo