Giter VIP home page Giter VIP logo

Comments (3)

justint avatar justint commented on May 30, 2024

Stringless can't work out-of-the-box with Blender, but you could develop a script, Blender Add-on, or feature within the Blender binary to read from the shared memory that the Stringless server writes to, similar to how the Reader class functions.

The Stringless code right now writes its captured facial data to the /stringless shared memory name (see Stringless.cc, lines 145 & 280), so any reader you implement can read from that name, as long as you're properly using the Mutex class (example) to ensure you don't run into the readers-writers problem.

from stringless.

royaljain avatar royaljain commented on May 30, 2024

@Enigman2011 were you able to write it for Blender?

from stringless.

justint avatar justint commented on May 30, 2024

Revisiting this now, I figure having a clear outline of how the Stringless Reader works would be helpful:


https://github.com/justint/stringless/blob/master/stringless-maya/src/StringlessMayaDevice.cc#L92

Above is the Maya plug-in code to read the data written out by the Stringless server.

An implementation of Stringless in another application (Blender, etc) could be done by following the steps outlined in the function linked above (StringlessMayaDevice::threadHandler()):

  1. Construct a Stringless::MemoryManager and point it to the shared memory address the server is writing to (by default: "/stringless"):
const std::string shared_memory_name = "/stringless";
// Set shared memory size to two frames
const size_t shared_memory_size = sizeof(struct Stringless::FrameData) * 2;

 memoryManager = Stringless::MemoryManager(shared_memory_name,
                                           shared_memory_size,
                                           Stringless::MemoryManager::read);
  1. Construct a Stringless::Reader to read from the MemoryManager's address:
reader = Stringless::Reader((Stringless::FrameData*)memoryManager.address());
  1. Read the FrameData from the Reader:
curFrameData = reader.read();

And there you have it!

from stringless.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.