Skip to content

Latest commit

 

History

History
254 lines (187 loc) · 8.18 KB

dev.md

File metadata and controls

254 lines (187 loc) · 8.18 KB

Random dev notes

https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#src-layout

source /opt/mambaforge/etc/profile.d/conda.sh

https://github.com/DanielSWolf/rhubarb-lip-sync

Diagrams

Some diagrams

Preview Click to View
Capture svg
Mapping svg

License

# SPDX-License-Identifier: MIT

Conda

Create

Create blank env with only python/pip.

mamba create -n rhubarb -c conda-forge python=3.10 pip~=22.2 

Then Activate and Update the env (see below) Note it seems it has to be done in two steps. Since the base(system) python and pip would have been used to install the dependencies instead.

Activate

conda activate rhubarb
which python # Verify it points somewhere like `.conda/envs`. Not to the system python.

Update

Activate the env first. The --prune is only needed if deps. were removed/renamed. Note the -f environment.yml is used implicitly.

mamba env update --prune

Win

Install: https://mamba.readthedocs.io/en/latest/installation.html#windows

set MAMBA_ROOT_PREFIX=r:\mm

micromamba shell init -s cmd.exe -p R:\mambaPrefix
micromamba shell hook --shell=cmd.exe
micromamba env list
micromamba create -f environment.yaml
micromamba activate rhubarb

r:\mambaPrefix\Scripts\activate

Release

  • Verify the rhubarb binary versions+hashes are the latest version available
  • cd scripts
  • python rhubarb_bin.py to download rhubar binaries and verify the checksums. It would also deploy the correct binary to the /bin folder based on the current platform (linux/mac/win).
  • python package.py to create zipped distributions for each platform.

Vs Code

Probably the easiest is to run the code or code-oss from within the activated conda env. Then run Python: Select Interpreter and select the one from conda env.

Pylance

    "python.analysis.diagnosticSeverityOverrides": {
        "reportOptionalMemberAccess": "none",
    }

Already in project.toml. To add to the settings.json manually:

 "python.formatting.provider": "black",
 "python.formatting.blackArgs": ["--line-length", "160", "--skip-string-normalization"],
 "python.formatting.blackPath": "/bin/black",

bpy modules

Fake bpy modules (seems more complete)

    "python.autoComplete.extraPaths": [
        "/data/src/fake_bpy_modules_3.4-20230117"
    ],
    "python.analysis.extraPaths": [
        "/data/src/fake_bpy_modules_3.4-20230117"
    ],

Official bpy from pip:

"python.autoComplete.extraPaths": [
        "/home/premik/.conda/envs/rhubarb/lib/python3.10/site-packages/bpy/3.4/scripts/modules/"
    ],
    "python.analysis.extraPaths": [
        "/home/premik/.conda/envs/rhubarb/lib/python3.10/site-packages/bpy/3.4/scripts/modules/"
    ],

Debug: https://github.com/JacquesLucke/blender_vscode https://marketplace.visualstudio.com/items?itemName=JacquesLucke.blender-development

Blender

For operator bl_idname, the same naming conventions as in 2.7x remain Registration: Menu, Panel, Header, UIList, Operator UPPER_CASE_{SEPARATOR}_mixed_case The separator for each identifier is listed below:

  • Header -> HT
  • Menu -> MT
  • Operator -> OT
  • Panel -> PT
  • UIList -> UL

Valid Examples:

  • class OBJECT_OT_fancy_tool (and bl_idname = "object.fancy_tool")
  • class MyFancyTool (and bl_idname = "MYADDON_MT_MyFancyTool")
  • class SOME_HEADER_HT_my_header
  • class PANEL123_PT_myPanel (lower case is preferred but mixed case is supported).

https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Addons#Registration

bpy.ops.sound.open(filepath='/tmp/work/1.ogg')

Uilist: https://blender.stackexchange.com/questions/30444/create-an-interface-which-is-similar-to-the-material-list-box/30446#30446 https://blender.stackexchange.com/questions/8699/what-ui-would-work-for-choosing-from-a-long-long-list https://blender.stackexchange.com/questions/717/is-it-possible-to-print-to-the-report-window-in-the-info-view

https://blender.stackexchange.com/questions/44356/fighting-split-col-and-aligning-row-content https://sinestesia.co/blog/tutorials/using-uilists-in-blender/

Icons: https://wilkinson.graphics/blender-icons/

Best practice: https://docs.blender.org/api/current/info_best_practice.html

Properties https://docs.blender.org/api/blender_python_api_master/bpy.props.html?highlight=floatproperty#get-set-example

Todo

High

  • Migrate to new extension api
  • Images/Icons not loaded (location changed)
  • defaul executable path is incorrect (location changed)
  • Pref. are blank after startup. Enable/disable addon brings them up but they are not persisted.
  • Mapping wizards
    • Clear - will remove the mapping (delete from the object completly?)
    • Face-it - From Test rig - Normal actions+shape-key corrections? 2) From shape-key test action 3) The final control rig (doesn't need a wizard)
    • By name - More instances (alow user defined) - will map action by matching name patterns (should provide some placeholder/expansions in the expression for objectName, etc)

Normal

  • In prefs, when executable doesn't exist make the control red
  • Add warning (in the baking validation popup?) when any selected object has an active Action (seems to be confusing for NLA newbies when the rig doesn't animate after bake because of that)
  • Integrate with: https://mecabricks.com/en/shop/product/6
  • Add "auto-remove" checkbox on the Bake confirmation dialog (so one doesn'thave to press "remove cues")
  • When tracks are already selected and new NLA track is added sometimes this disturbs the track selection and wrong tracks get used.
  • Make a Capture operation dialog (now only confirmation), put the dialog-file, recognizer and start frame there?
  • Bring some of the old baking method back with fixed lengths

Low

  • Create aur package
  • Add speaker as an alternative to Sequencer audio clip
  • The scaled down icons (32x32) still hard to see. Pre-scale different set icons?
  • Verify the Dialog file is working
  • Changel all labels cases to follow Blender style "Foo in Bar"
  • Add some simple blender sample file
  • There are still some ogg unsupported format - could have been an user error (ogg file was not really an ogg?)
  • Workflow from Sequencer - Paste sound_strip first, create captures of them and render to NLA,
  • Integrate with Parrot lipsync backend (when already installed)
  • When dialog file is specified but file doesn;t exists rhubar_cli ends with error-code but not much clue. Add check for dialog file.

Check

https://github.com/Hunanbean/Papagayo-NGLipsyncImporterForBlender https://blendermarket.com/products/syncnix https://blendermarket.com/products/parrot-lipsync

NLA

NLA object tracks:

[t.name for t in C.object.animation_data.nla_tracks]

NLA shape-key tracks:

[t.name for t in C.object.data.shape_keys.animation_data.nla_tracks]

https://docs.blender.org/manual/en/latest/files/data_blocks.html https://blenderartists.org/t/how-to-fix-blender-error-disabled-cant-edit-this-property-from-linked-data-block/1239469/3

Windows system console: https://blender.stackexchange.com/questions/145890/where-is-the-system-console

https://download.blender.org/release/

class FaceitExpressions(PropertyGroup):
    '''Properties stored in each expression item'''
    name: StringProperty(
        options=set(),
    )
    side: StringProperty(
        options=set(),
    )
    frame: IntProperty(
        options=set(),
    )
    index: IntProperty(
        options=set(),
    )
    mirror_name: StringProperty(
        options=set(),
    )
    corr_shape_key: BoolProperty(
        name='Shape Key',
        description='Corrective Shape Key active on this expression',
        default=False
    )
    procedural: EnumProperty(
        name='Procedural Expression',
        items=PROCEDURAL_EXPRESSION_ITEMS,
    )