Coder Social home page Coder Social logo

Comments (3)

Elektordi avatar Elektordi commented on May 30, 2024

Hello,

Could you explain your problem?
And please include real python code to highlight the bug.

After checking, everything seems good:

class SetCurrentScene(base_classes.BaseRequest):
    def __init__(self, scene_name):
        base_classes.BaseRequest.__init__(self)
        self.name = "SetCurrentScene"
        self.datain["scene-name"] = scene_name

and original doc:

"SetCurrentScene"

Switch to the scene specified in "scene-name".

Request fields :

  • "scene-name" (string) : name of the scene to switch to.

Response : always OK if scene exists, error if it doesn't. No additional fields

And this is one the functions I use in my samples, and seen no problem so far.

Regards,

Guillaume

from obs-websocket-py.

rolandf avatar rolandf commented on May 30, 2024

I was not able to set current scene using that version.

My code was:

`#!/usr/bin/env python

-- coding: utf-8 --

import sys
import time

import logging
logging.basicConfig(level=logging.INFO)

sys.path.append('../')
from obswebsocket import obsws, requests

print requests.file

host = "192.168.1.11"
port = 4444
password = "1234"

ws = obsws(host, port, password)
ws.connect()

try:
print ws.call(requests.GetVersion())
scenes = ws.call(requests.GetSceneList())
for s in scenes.getScenes():
print s
name = s['name']
print "Switching to %s"%(name)
print ws.call(requests.SetCurrentScene(name))
time.sleep(2)
print ws.call(requests.SetSourceRender(source='TXT1', render=True, scene_name='Scene2'))
print ws.call(requests.SetSourceRender(source='TXT2', render=True, scene_name="Scene2"))
time.sleep(2)
print ws.call(requests.SetSourceRender(source='TXT1', render=False, scene_name='Scene2'))
print ws.call(requests.SetSourceRender(source='TXT2', render=False, scene_name="Scene2"))
print "End of list"

except KeyboardInterrupt:
pass

ws.disconnect()
`

I had to change datain to dataout as here:

class SetCurrentScene(base_classes.BaseRequest):
def init(self, scene_name):
base_classes.BaseRequest.init(self)
self.name = "SetCurrentScene"
self.dataout["scene-name"] = scene_name

Same for SetSourceRender, there is a mismatch of datain/out too.

from obs-websocket-py.

Elektordi avatar Elektordi commented on May 30, 2024

Thanks for your help. I just have resolved the issue in master.

from obs-websocket-py.

Related Issues (20)

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.