MCPcopy Create free account
hub / github.com/coldtype/coldtype / setup

Function setup

examples/blender/direct_objects.py:12–88  ·  view source on GitHub ↗
(blw:BpyWorld)

Source from the content-addressed store, hash-verified

10
11@b3d_runnable()
12def setup(blw:BpyWorld):
13 (blw.delete_previous("Coldtype"
14 , materials=True)
15 .delete_previous("Cubes"
16 , materials=True)
17 .timeline(Timeline(120)
18 , resetFrame=0
19 , output=setup.output_folder / "do1_"
20 , version=1))
21
22 blw.rigidbody(1.5, 120)
23
24 (BpyObj.Empty("Empty1"))
25
26 (BpyObj.Curve("ObviGlyph")
27 .draw(StSt("TYPE", Font.ColdObvi(), 5)
28 .centerZero())
29 .extrude(0.2)
30 .locate(z=7.5)
31 .rotate(x=90)
32 .convert_to_mesh()
33 .rigidbody("active", bounce=0.5)
34 .material("coldtype_material")
35 .shade_flat())
36
37 (BpyGroup.Curves(
38 StSt("COLD", Font.MuSan(), 3
39 , wght=1, wdth=1)
40 .centerZero()
41 , collection="/Glyphs")
42 .map(lambda bp: bp
43 .parent("Empty1")
44 .extrude(0.25)
45 .locate(z=15)
46 .convertToMesh()
47 .rigidbody("active", bounce=0.5)
48 .material("coldtype_material")))
49
50 BpyObj.Find("Empty1").locate(z=-2)
51
52 (BpyMaterial.Find("monkey_material")
53 .f(hsl(0.3, 1))
54 .roughness(1)
55 .specular(0))
56
57 monkey = (BpyObj.Monkey()
58 .locate(z=11)
59 .rotate(z=45)
60 .scale(1,1,1)
61 .rigidbody("active", bounce=0.3)
62 .material("monkey_material")
63 .subsurface()
64 .shade_smooth())
65
66 monkey.copy().locate(x=6)
67 monkey.copy().locate(x=-6)
68
69 (BpyMaterial.Find("monkey_material")

Callers

nothing calls this directly

Calls 15

TimelineClass · 0.85
StStFunction · 0.85
hslFunction · 0.85
timelineMethod · 0.80
delete_previousMethod · 0.80
EmptyMethod · 0.80
shade_flatMethod · 0.80
materialMethod · 0.80
locateMethod · 0.80
CurveMethod · 0.80
CurvesMethod · 0.80
shade_smoothMethod · 0.80

Tested by

no test coverage detected