Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
tychedelia committed Nov 17, 2024
1 parent fcf7cb3 commit d5d070c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
28 changes: 0 additions & 28 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
# Ensure that we are using powershell and not `sh` distributed by git on windows
set windows-powershell := true

# The local TouchDesigner Python distribution
touchdesigner_python := if os() == "windows" {
"C:/Program Files/Derivative/TouchDesigner/bin/python.exe"
} else {
"/Applications/TouchDesigner.app/Contents/Frameworks/Python.framework/Versions/3.11/bin/python3.11"
}


[windows]
venv-init:
Start-Process -NoNewWindow -Wait -FilePath {{ touchdesigner_python }} -ArgumentList "-m venv venv"
[macos]
venv-init:
{{ touchdesigner_python }} -m venv venv

[macos]
venv-activate:
source venv/bin/activate
ln -sf $PWD/lib/_stubs $PWD/venv/lib/python3.11/site-packages/_stubs
[windows]
venv-activate:
. venv/Scripts/Activate.ps1

venv: venv-init venv-activate

build PLUGIN:
cargo xtask build {{PLUGIN}}

Expand Down
1 change: 0 additions & 1 deletion plugins/chop/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ crate-type = ["staticlib"]

[dependencies]
pyo3 = { git = "https://github.com/tychedelia/pyo3", branch = "td-rs", features = ["abi3-py311"] }
pyo3-ffi = { git = "https://github.com/tychedelia/pyo3", branch = "td-rs", features = ["abi3-py311"] }
td-rs-chop = { path = "../../../td-rs-chop", features = ["python"] }
td-rs-derive = { path = "../../../td-rs-derive" }
td-rs-derive-py = { path = "../../../td-rs-derive-py" }
16 changes: 5 additions & 11 deletions plugins/chop/python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,8 @@ pub struct PythonChop {

#[pymethods]
impl PythonChop {
pub fn hello_world(&self, a: i32, b: i32, absTime: Bound<'_, PyAny>) -> PyResult<i32> {
let field_value = absTime.getattr("frame")?;
// print the pointer to the execute_count field
println!("execute_count: {:?}", &self.execute_count as *const u32);
let frames: i32 = field_value.extract()?;
println!(
"Hello, world! execute={} frames={}",
self.execute_count, frames
);
Ok(a + b)
pub fn reset(&mut self) {
self.offset = 0.0;
}
}

Expand Down Expand Up @@ -99,7 +91,9 @@ impl Op for PythonChop {
}

fn pulse_pressed(&mut self, name: &str) {
if name == "Reset" {}
if name == "Reset" {
self.reset();
}
}
}

Expand Down

0 comments on commit d5d070c

Please sign in to comment.