mirror of
https://github.com/Cian-H/simple_blender_server.git
synced 2025-12-22 21:41:56 +00:00
Added more libraries for better model generation
This commit is contained in:
@@ -7,7 +7,10 @@ RUN CGO_ENABLED=0 GOOS=linux go build -o server ./main.go
|
|||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
RUN apk update
|
RUN apk update
|
||||||
RUN apk add blender
|
RUN apk add blender py3-pip
|
||||||
|
RUN pip install numpy scipy trimesh
|
||||||
|
RUN del py3-pip
|
||||||
|
|
||||||
WORKDIR /root/
|
WORKDIR /root/
|
||||||
COPY --from=builder /app/server .
|
COPY --from=builder /app/server .
|
||||||
COPY main.py.tmpl .
|
COPY main.py.tmpl .
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
import bpy # type: ignore
|
import bmesh
|
||||||
|
import bpy
|
||||||
|
import mathutils
|
||||||
|
import numpy
|
||||||
|
import scipy
|
||||||
|
import trimesh
|
||||||
|
|
||||||
|
|
||||||
{{.ModelCode}}
|
{{.ModelCode}}
|
||||||
@@ -6,7 +11,7 @@ import bpy # type: ignore
|
|||||||
|
|
||||||
def guarded_model() -> bpy.types.Object:
|
def guarded_model() -> bpy.types.Object:
|
||||||
try:
|
try:
|
||||||
out = model() # type: ignore
|
out = model()
|
||||||
if out is None:
|
if out is None:
|
||||||
raise TypeError("Function `model` cannot return type `None`.")
|
raise TypeError("Function `model` cannot return type `None`.")
|
||||||
return out
|
return out
|
||||||
|
|||||||
Reference in New Issue
Block a user