Implement context archive handling and metadata extraction for render jobs. Add functionality to check for Blender availability, create context archives, and extract metadata from .blend files. Update job creation and retrieval processes to support new metadata structure and context file management. Enhance client-side components to display context files and integrate new API endpoints for context handling.
This commit is contained in:
@@ -27,15 +27,14 @@ const (
|
||||
type JobType string
|
||||
|
||||
const (
|
||||
JobTypeMetadata JobType = "metadata" // Metadata extraction job - only needs blend file
|
||||
JobTypeRender JobType = "render" // Render job - needs frame range, format, etc.
|
||||
JobTypeRender JobType = "render" // Render job - needs frame range, format, etc.
|
||||
)
|
||||
|
||||
// Job represents a job (metadata extraction or render)
|
||||
// Job represents a render job
|
||||
type Job struct {
|
||||
ID int64 `json:"id"`
|
||||
UserID int64 `json:"user_id"`
|
||||
JobType JobType `json:"job_type"` // "metadata" or "render"
|
||||
JobType JobType `json:"job_type"` // "render"
|
||||
Name string `json:"name"`
|
||||
Status JobStatus `json:"status"`
|
||||
Progress float64 `json:"progress"` // 0.0 to 100.0
|
||||
@@ -133,13 +132,14 @@ type JobFile struct {
|
||||
|
||||
// CreateJobRequest represents a request to create a new job
|
||||
type CreateJobRequest struct {
|
||||
JobType JobType `json:"job_type"` // "metadata" or "render"
|
||||
Name string `json:"name"`
|
||||
FrameStart *int `json:"frame_start,omitempty"` // Required for render jobs
|
||||
FrameEnd *int `json:"frame_end,omitempty"` // Required for render jobs
|
||||
OutputFormat *string `json:"output_format,omitempty"` // Required for render jobs
|
||||
AllowParallelRunners *bool `json:"allow_parallel_runners,omitempty"` // Optional for render jobs, defaults to true
|
||||
MetadataJobID *int64 `json:"metadata_job_id,omitempty"` // Optional: ID of metadata job to copy input files from
|
||||
JobType JobType `json:"job_type"` // "render"
|
||||
Name string `json:"name"`
|
||||
FrameStart *int `json:"frame_start,omitempty"` // Required for render jobs
|
||||
FrameEnd *int `json:"frame_end,omitempty"` // Required for render jobs
|
||||
OutputFormat *string `json:"output_format,omitempty"` // Required for render jobs
|
||||
AllowParallelRunners *bool `json:"allow_parallel_runners,omitempty"` // Optional for render jobs, defaults to true
|
||||
RenderSettings *RenderSettings `json:"render_settings,omitempty"` // Optional: Override blend file render settings
|
||||
UploadSessionID *string `json:"upload_session_id,omitempty"` // Optional: Session ID from file upload
|
||||
}
|
||||
|
||||
// UpdateJobProgressRequest represents a request to update job progress
|
||||
@@ -225,19 +225,30 @@ type TaskLogEntry struct {
|
||||
|
||||
// BlendMetadata represents extracted metadata from a blend file
|
||||
type BlendMetadata struct {
|
||||
FrameStart int `json:"frame_start"`
|
||||
FrameEnd int `json:"frame_end"`
|
||||
RenderSettings RenderSettings `json:"render_settings"`
|
||||
SceneInfo SceneInfo `json:"scene_info"`
|
||||
FrameStart int `json:"frame_start"`
|
||||
FrameEnd int `json:"frame_end"`
|
||||
RenderSettings RenderSettings `json:"render_settings"`
|
||||
SceneInfo SceneInfo `json:"scene_info"`
|
||||
MissingFilesInfo *MissingFilesInfo `json:"missing_files_info,omitempty"`
|
||||
}
|
||||
|
||||
// MissingFilesInfo represents information about missing files/addons
|
||||
type MissingFilesInfo struct {
|
||||
Checked bool `json:"checked"`
|
||||
HasMissing bool `json:"has_missing"`
|
||||
MissingFiles []string `json:"missing_files,omitempty"`
|
||||
MissingAddons []string `json:"missing_addons,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// RenderSettings represents render settings from a blend file
|
||||
type RenderSettings struct {
|
||||
ResolutionX int `json:"resolution_x"`
|
||||
ResolutionY int `json:"resolution_y"`
|
||||
Samples int `json:"samples"`
|
||||
OutputFormat string `json:"output_format"`
|
||||
Engine string `json:"engine"`
|
||||
ResolutionX int `json:"resolution_x"`
|
||||
ResolutionY int `json:"resolution_y"`
|
||||
Samples int `json:"samples,omitempty"` // Deprecated, use EngineSettings
|
||||
OutputFormat string `json:"output_format"`
|
||||
Engine string `json:"engine"`
|
||||
EngineSettings map[string]interface{} `json:"engine_settings,omitempty"`
|
||||
}
|
||||
|
||||
// SceneInfo represents scene information from a blend file
|
||||
|
||||
Reference in New Issue
Block a user