Skip to content

transfer_material: transfer per-face assignments to topology-matching targets - #8

Open
hazelp343 wants to merge 2 commits into
ruxinliang-dev:mainfrom
hazelp343:fix/transfer-per-face
Open

transfer_material: transfer per-face assignments to topology-matching targets#8
hazelp343 wants to merge 2 commits into
ruxinliang-dev:mainfrom
hazelp343:fix/transfer-per-face

Conversation

@hazelp343

Copy link
Copy Markdown

Completes the remaining item from #6 (and stacks on #7 — this branch includes those commits; happy to rebase if #7 lands first).

When the source object carries multiple materials (per-face assignment), transfer_material now reads each shading engine's face-set membership on the source and re-applies it on every target whose face count matches the source's, via cmds.sets(..., edit=True, forceElement=engine) — the proper fix #6 sketched. Targets with different topology fall back to the whole-object assignment of the first material, and the status message says exactly which path each target took instead of printing an unqualified success.

Single-material sources keep the simple path: one select + one hyperShade call, selection restored in a finally, long names throughout (all carried over from #7).

I have already installed it in Maya and tested it in my scenario — per-face transfer on duplicated meshes with two materials, and the whole-object fallback on a differently-subdivided target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

transfer_material destroys the user's selection and can't transfer per-face assignments

2 participants