Post #655: and my first newby question — trying to make macros, but lightmap section simple

📋 Metadata

  • Author: chombor
  • Date: 2017-05-17 22:01:16
  • Type: question
  • Quality Score: 6/10
  • Replies (1): post_00660

🏷️ Tags

macro beginner solved python-scripting

  • Macro Editor
  • Python Scripting

💬 Content

and my first newby question — trying to make macros, but lightmap section simple invisible(and cannot to be added in menu) in the info window, how to parametrise that?

bpy.ops.object.editmode_toggle()
bpy.ops.uv.smart_project()
bpy.ops.mesh.uv_texture_add()
bpy.context.object.data.active_index = 1
bpy.context.object.data.uv_textures[“UVLight”].name = “UVLight”
bpy.data.window_managers[“WinMan”].(null) = False
bpy.ops.object.editmode_toggle()

ok, I found some working solution, but windows steel pop-up, and answer for conform, and Lightmap packed into UV0 instead UV1

bpy.ops.uv.lightmap_pack(PREF_CONTEXT=‘SEL_FACES’, PREF_PACK_IN_ONE=True, PREF_NEW_UVLAYER=False, PREF_APPLY_IMAGE=False, PREF_IMG_PX_SIZE=512, PREF_BOX_DIV=12, PREF_MARGIN_DIV=0.1)

Finally! Got macro recorder from dairin0d and it works! but does not rename it

import bpy
from mathutils import Vector, Matrix, Quaternion, Euler, Color

context = bpy.context

bpy.ops.object.editmode_toggle()
bpy.ops.uv.smart_project(use_aspect=True, angle_limit=66.0, island_margin=0.029999999329447746, stretch_to_bounds=False, user_area_weight=0.0)
bpy.ops.mesh.uv_texture_add()
bpy.ops.uv.lightmap_pack(PREF_CONTEXT=‘SEL_FACES’, PREF_APPLY_IMAGE=False, PREF_BOX_DIV=12, PREF_IMG_PX_SIZE=512, PREF_PACK_IN_ONE=True, PREF_NEW_UVLAYER=False, PREF_MARGIN_DIV=0.10000000149011612)
bpy.ops.object.editmode_toggle()

nah, just a thought

works —__—


🔗 View on Blender Artists