Generate CBPC Collision Values

Generate CBPC Collision Values

Description

A bunch of scripts & files to automate the process of getting the correct values for the CBPC collisions any skinned mesh.

It does not write the collision file for you.

Requires a little bit of blender knowledge (how to install addons, where's the script tab...)

 

Installation

Unzip in any folder. Preferably one that's not full of files. Not in your mod directory...

 

Use

2 versions are available, pick the one that's the most convenient for you.

- Basic script version

Requires Blender and the pynifly addon, a skinned mesh (aka a body mesh, with arms, feet and head...) and a collision file with the correct bones names in it.

- Open a new blender project, open the "cbpc spheres blender" text file and copy paste it's content in blender's script tab.

- Use the pynifly addon to import your skinned mesh(es) (untick the 3 middle options).

- Run the script.

You'll get a file named "sphere_adjustments" that'll contain the values to use for the spheres to fit your mesh for each bone the mesh was skinned to.

You'll just need to copy-paste these values in your own collision file, to the correct bones.

You can build your mesh(es) in bodyslide beforehand with the sliders you want and import those output nifs in blender, the script will match the shape of the skinned mesh.

This version does not support double collisions spheres or weights differences.

An example blender & collision files are included, for the draugr replacer by psboss. 

 

- Advanced version

Same process as the basic one, but with tweaks. Requires python.

This version has sliders support, which means you can also import the tri file used by your mesh (generated with bodyslide when building the mesh...) using pynifly.

You can edit the script (directly in blender) to make use of several options :

2 blacklists and a whitelist are available for edit.

The blacklists are used to tell the script to ignore certain bones or certain sliders (keyshapes in blender).

The whitelist is used to tell the script which bone needs 2 spheres instead of 1.

Just write the correct names in each list according to your needs.

Running the script will generate text files for each non-blacklisted keyshape as well as one for the base shape. 

I advise to open blender's console window to see the script's progress, depending on the number of keyshapes, it can be a bit long.

You can then grab an xml preset file (or several), and paste them in the same folder as the new text file, then run the "SplitScriptInterpolationAIO" script in that folder (drop it in the folder...).

The script will run and output a new folder (2 actually, but 1 can be ignored) named "FinalOutputs". In there, you'll find the text files containing the values to be used for each xml preset the script processed, in the same format as the other text files. You can then just copy paste etc...

It supports weights differences, and should also handle 2 spheres situations (although that last one wasn't tested extensively...).

And don't forget to delete the log file it makes, you don't need that.

 

That's all for now, unless I forgot something.

Comments

Popular posts from this blog

Devious Desires

Hentai Creatures SE (Fixed)

Sexlab Unfiltered (Official)