boip is an abbreviation for Boiler Plate.
A library that generates code from code templates based on the answers to some questions.
I am a technical artist.
Therefore, the template to be added has a lot of code generation such as Maya related.
python -m pip install boip
python -m boip
cd "Folder path where you want to place the template."
It is copied under cd with the last selected folder name.
Since I chose "Maya Qt-MVC" this time, a template of Maya + Qt + MVC pattern is generated.
Prepare a code template (BoipSet) in advance. Then specify the folder path where BoipSet is located with the -s flag.
python -m boip -s "Target folder path."
The following two are set as a Boip Set.
- After asking a question, a folder named "template" to use for replacement.
- Configuration file named boip.yaml.
title: MayaQt-MVC # template name
convertExtensions: # distExtension srcExtension(The same extension is okay.)
py: py
ui: ui
question: # question list
- name: tool_name # Name to use for replacement. Use with {Name} for stationery.
message: "Tool name?" # Question.
default: sampleWindow # Default Value.
- name: maya_version
message: "What version of Maya are you using?"
default: 2020
The folders under template will be copied. After that, the inside of {name} is converted by the answer to the question.
It is expected that automatic generation will be included in the future, but currently it is manual.
Example)In the case of "MayaQt-MVC" above.
I have two questions, {tool_name} and {maya_version}.
- template
import sys
print("{tool_name}")
print("{maya_version}")
- answer the questions.
Tool name? > sampleWindow
What version of Maya are you using? > 2020
- After generation. The answer to the question will be converted to the following.
import sys
print("sampleWindow")
print("2020")
If you have a nice template, Please make a merge request!