Page MenuHome

Bake-API: allow custom UV to be baked and improvement on UV check
ClosedPublic

Authored by Dalai Felinto (dfelinto) on May 24 2014, 4:06 PM.

Details

Summary

Note: the custom UV option is only available when calling the operator
via a script. It's currently not exposed in the UI since it's intended
to be used by scripters

To test it:
bpy.ops.object.bake(type='UV', use_clear=True, uv_layer='MyNewUV')

Diff Detail

Branch
bake-custom-uv

Event Timeline

Dalai Felinto (dfelinto) updated this revision to Unknown Object (????).Jun 10 2014, 10:15 PM

rebased to recent master

This doesn't work so well for baking many objects,
Note: We could have an active 'bake' layer, like we do for render & clone, but thats a much larger change.

And this option you only use when automating bakes anyway... so think its fine.
+1

source/blender/editors/object/object_bake_api.c
562

I think only this check is needed?

  • Source mesh needs CD_MLOOPUV
  • Tessellated mesh needs CD_MTFACE
  • We assume tessellating the mesh will give us an CD_MTFACE
1297

think this is more clear?

"UV layer to override active"

source/blender/render/intern/source/bake_api.c
522

*picky*, preference for braces around both cases.

Dalai Felinto (dfelinto) updated this revision to Unknown Object (????).Jun 11 2014, 1:35 AM
  • small changes from Campbell Barton

Note: I didn't change the CD_MTFACE test. At that point (object_bake_api.c:562) we don't know if the mesh is tesslated, thus we cover all basis.

By the way, do we you think we should wait for after 2.71? or to push it to master before the RC (aka now).
Thanks for the review by the way

Dalai Felinto (dfelinto) updated this revision to Unknown Object (????).Jun 11 2014, 1:53 AM
  • no need for extra UV checks, as suggested by Campbell Barton
  • Merge remote-tracking branch 'upstream/master' into bake-custom-uv
Dalai Felinto (dfelinto) updated this revision to Unknown Object (????).Jun 11 2014, 1:54 AM

I forgot to update my origin/master (aka github) before last arc diff, so other commits made their way in. Re arc diff'ing

Dalai Felinto (dfelinto) updated this revision to Unknown Object (????).Jun 11 2014, 8:17 AM
  • Merge remote-tracking branch 'upstream/master' into bake-custom-uv

Adjustments after the bake-cage commit
(and fix a building warning)