Skip to content

Instantly share code, notes, and snippets.

View Cdaprod's full-sized avatar
🫠
Learn something new everyday!

David Cdaprod

🫠
Learn something new everyday!
View GitHub Profile
@Cdaprod
Cdaprod / my_autometadata.py
Last active June 4, 2025 17:12
Goes with my xqd smb gist and this one is attempting to automate all metadata
import os
import cv2
import xml.etree.ElementTree as ET
def get_video_technical_info(path):
cap = cv2.VideoCapture(path)
fps = cap.get(cv2.CAP_PROP_FPS)
frame_count = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
@Cdaprod
Cdaprod / my_xqd_smb_share.md
Last active June 4, 2025 15:15
Automating XQD Via Network Share Using SMB

TL;DR β€’ It’s fine that both XQD cards individually mount as D:. β€’ Differentiate them by VolumeLabel, not by drive letter. β€’ Modify your script so the SMB share name = VolumeLabel (e.g. XQD_Card1, XQD_Card2). β€’ Register your task once via PowerShellβ€”after that, β€œhot-plug” automatically shares whichever card you inserted under the correct name.

Feel free to reach out if you want help auto-removing the share on eject, adding logging to see exactly when each card fires, or any other fine-tuning!

Explanation of Key Changes

@Cdaprod
Cdaprod / camera_rig_and_ios_polycam.py
Last active May 28, 2025 22:28
Blender BPY β€” Here’s how to extract a frame and map it onto a traced 3D object:​​​​​​​​​​​​​​​​
"""
Nikon + Polycam iOS - Camera Rig
"""
#!/usr/bin/env python3
"""
Camera Rig + iPhone Polycam Automation System
Monitors for new Polycam scans and camera footage, then processes automatically
"""
import os
@Cdaprod
Cdaprod / bpy_video_and_image_texture_mapping_demonstration.py
Created May 28, 2025 21:26
Blender BPY β€” Texture Mapping & Raycasting With iPhone Screenshots and Recordings
import bpy
import bmesh
import os
from mathutils import Vector
from bpy_extras.object_utils import world_to_camera_view
# ============ MEDIA LOADING & VALIDATION ============
def validate_media_file(file_path):
"""Validate if file exists and get media type"""
@Cdaprod
Cdaprod / terminal_3d_scene_setup_v1.py
Last active May 28, 2025 21:20
Blender BPY β€” Terminal 3D Layered Scene Setup
import bpy
import bmesh
from mathutils import Vector
# Clear existing mesh objects
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
# Scene setup
scene = bpy.context.scene
@Cdaprod
Cdaprod / terminal_dive.py
Created May 28, 2025 01:32
Blender Shellfish iOS Terminal Drive BPY Script
import bpy
import os
# 1. β€”β€”β€” CONFIGURE these paths & data β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
FONT_PATH = "/path/to/JetBrainsMono Nerd Font.ttf" # ← point to your local Nerd Font
LINES = [
"cd ~/Projects/Cdaprod",
"git status",
"exa -lh --color=always",
"ssh [email protected]",
@Cdaprod
Cdaprod / tunnel_and_camera.py
Last active May 26, 2025 21:55
Blender Multi-Video Panels β€” left/right walls of four screens each, the 2Γ—2 grid at the end, plus the big back‐wall screen.
## /3D_design/tunnel_scene/tunnel_and_cam.py
import bpy, math
# ── CLEANUP & PARAMETERS ─────────────────────────────────────────────────────────
for obj in list(bpy.data.objects):
if obj.type=='MESH' and obj.name.startswith(("L","R","Grid","Back")):
bpy.data.objects.remove(obj, do_unlink=True)
plane_w, plane_h = 1.6, 0.9
@Cdaprod
Cdaprod / extension_aware_indexer.py
Last active May 24, 2025 16:30
This makes Weaviate your search/semantic engine, with Filebrowser as the source-of-truth file system.
import os
import hashlib
import json
import gzip
import io
from pathlib import Path
from collections import Counter
from concurrent.futures import ThreadPoolExecutor, as_completed
import weaviate
@Cdaprod
Cdaprod / Cinematic_Monitor_Dive_and_Return.py
Created May 10, 2025 22:14
Blender Python - Cinematic Monitor Dive & Return
import bpy
import math
# Clean up
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete(use_global=False)
# Frame settings
scene = bpy.context.scene
scene.frame_start = 1
@Cdaprod
Cdaprod / bpy_stinger_cdaprod_sudo_tee_file.sh
Last active April 23, 2025 18:58
β€’ Ultra-Resolution Ready: Defaults to 4K 16:9 (3840Γ—2160) β€’ Customizable Grid: grid_size, spacing, glow color and intensity β€’ Volumetric Atmosphere: for infinite feel + depth β€’ Reflective Ground Plane: mirror-style dark reflection Backlight: simulates orange glow horizon
sudo tee ~/cdaprod_stinger.py > /dev/null << 'EOF'
import bpy, math
# -------------------- Configurable Parameters --------------------
CONFIG = {
"output_filepath": "/mnt/data/cdaprod_stinger.mp4",
"use_cycles": True,
"samples": 128,
"resolution_x": 3840,
"resolution_y": 2160,