Rigify Dev Tools "Encode Metarig" question

Hi I really hope to understand how to use these two options.
“Encode Metarig to Python” and “Encode Sample to Python”

I read git hub meta-rig read me. then I thought it work to save my modfied meta-rig as new sample
to choose in rigfy Buttons. is not it ? @@:wink:

Now I cstomize simple meta-rig, composed by two “basic.copy chain”
then hope to use it as new “sample” name as “two chain coy” for future use.

in edit mode, I select my meta-rig sets. I click “Encode metarig to Python”.
I thoght it may auto generate “metarig_sample.py” file in somewhere of my PC, but I can not find it,

or I need to use Python console, to wrok “metarig_smple.py” ?

And I hope to know clear about " Encode sample to Python" too, (I hope if sample window auto add new-sample which I generate,)

Actually I seldom use python code in blender, but if I can manage customize meta-rig as new sample,I want to learn the way. if someone know well, please teach me how to use the dev tools of rigfy clear :eek:

I poked around rigify some time ago, here’s what I can remember…

First, those two dev buttons - “Encode Metarig to Python” and “Encode Sample to Python”, generate a bit of python code that can be found in the text editor. Basically, I’m thinking, one generates a bit of code for the sample rig that you first create with rigify, and the other one generates the code that creates the full on rig that is ready to animate.

I spent some time looking through the code to rigify and basically it’s like it is described, it’s building blocks to create a rig. The full biped rig it creates is actually a collection of smaller rigs. A finger rig, a hand rig, an arm rig, a torso rig, etc, etc,… It’s a bit complex, to understand it, you’ll need to know python.

You’ll have to spend time looking thru the python scripts that make up rigify. There’s a lot of them. I looked at the finger rig code, found the part that is generated by the buttons you mention, and that’s only a small portion of the script. So I created my own finger rig, used the buttons you mention (forget which one) and created the python code for my finger rig. I copied and pasted some code together that I thought would allow me to generate my own finger sample rig, saved it to the rigify scripts folder and it didn’t work. I don’t remember what went wrong, it has been over a year since I played with it.

I know my sample finger rig showed up in the list of rigs that can be created in the armature properties panel, but the code I had rigify generate and copy/pasted into a copy of rigify’s finger script and saved wouldn’t execute. I couldn’t figure out why it wasn’t executing, and gave up.

I really think if someone wrote a tool to create rigs for rigify, and a way to share rigs amongst users, then rigify would be truly powerful.

Good luck!
Randy

@revot_randy
thanks a lot to take a time for my biginner question. your advice is really useful for me.

Actually I have not checked text-editor, (I remember, blender execute python code, on text editor @@; I perfectly forget it these days,) I must check it.

I can not write python code, for customize my rig-fy, but I may learn basic . then if I use generate code easy,it should be useful.
(I now try to read, sample meta-rigs. py files, rig-fy dicrectory, then hope gradually learning,)

And yes, if other users who make original meta-rig and save it as new sample (or type too?) hope to teach us
how to use these dev tools to customize and save user-meta-rig easy @@;

i bumped into your question. I actually made an addon which uses that “Encode function”. I found that this was hidden and not that easy to work with. So i made an addon which saves your metarig in the metarig folder. On blender restart that metarig will show in the “Add menu”.

The addon can also save Rigify Rig settings, so it saves a preset how you setup the rigfy layers and bonegroups with colors

You can find my addon here