diff options
Diffstat (limited to 'doc/python_api')
118 files changed, 124 insertions, 12833 deletions
diff --git a/doc/python_api/blender-org/layout.html b/doc/python_api/blender-org/layout.html deleted file mode 100644 index 88db31e1586..00000000000 --- a/doc/python_api/blender-org/layout.html +++ /dev/null @@ -1,201 +0,0 @@ -{%- block doctype -%} -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -{%- endblock %} -{%- set script_files = script_files + [pathto("_static/jquery.sidebar.js", 1)] %} -{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} -{%- set reldelim2 = reldelim2 is not defined and ' •' or reldelim2 %} - -{%- macro relbar() %} - <div class="subnav boxheader"> - <ul class="noprint"><li><a href="http://wiki.blender.org/index.php/Dev:Contents">Documentation</a></li><li>•</li><li><a href="http://www.blender.org/development/report-a-bug/">Report a Bug</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Doc/Process/Patches">Submit a Patch</a></li><li>•</li><li><a href="http://www.blender.org/development/release-logs/">Release Logs</a></li><li>•</li><li><a href="http://www.blender.org/development/building-blender/">Building Blender</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Doc/Projects">Current Projects</a></li><li>•</li><li><a href="http://wiki.blender.org/index.php/Dev:Source/Architecture">Architecture</a></li><li>•</li><li><a href="http://www.blender.org/documentation/250PythonDoc/contents.html">Python API</a></li><li>•</li><li><a href="http://wiki.blender.org">Wiki</a></li></ul> - </div> - <div class="related subnav"> - <h3>{{ _('Navigation') }}</h3> - <ul> - {%- for rellink in rellinks %} - <li class="right"> - <a href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags }}" - {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> - {%- if not loop.first %}{{ reldelim2 }}{% endif %}</li> - {%- endfor %} - {%- block rootrellink %} - <li><a href="{{ pathto(master_doc) }}">{{ shorttitle|e }}</a>{{ reldelim1 }}</li> - {%- endblock %} - {%- for parent in parents %} - <li><a href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }}</a>{{ reldelim1 }}</li> - {%- endfor %} - {%- block relbaritems %} {% endblock %} - </ul> - </div> -{%- endmacro %} - -{%- macro sidebar() %} - {%- if not embedded %}{% if not theme_nosidebar|tobool %} - <div class="sphinxsidebar"> - <div class="sphinxsidebarwrapper"> - {%- block sidebarlogo %} - {%- if logo %} - <p class="logo"><a href="{{ pathto(master_doc) }}"> - <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> - </a></p> - {%- endif %} - {%- endblock %} - {%- block sidebartoc %} - {%- if display_toc %} - <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> - {{ toc }} - {%- endif %} - {%- endblock %} - {%- block sidebarrel %} - {%- if prev %} - <h4>{{ _('Previous topic') }}</h4> - <p class="topless"><a href="{{ prev.link|e }}" - title="{{ _('previous chapter') }}">{{ prev.title }}</a></p> - {%- endif %} - {%- if next %} - <h4>{{ _('Next topic') }}</h4> - <p class="topless"><a href="{{ next.link|e }}" - title="{{ _('next chapter') }}">{{ next.title }}</a></p> - {%- endif %} - {%- endblock %} - {%- block sidebarsourcelink %} - {%- if show_source and has_source and sourcename %} - <h3>{{ _('This Page') }}</h3> - <ul class="this-page-menu"> - <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" - rel="nofollow">{{ _('Show Source') }}</a></li> - </ul> - {%- endif %} - {%- endblock %} - {%- if customsidebar %} - {% include customsidebar %} - {%- endif %} - {%- block sidebarsearch %} - {%- if pagename != "search" %} - <div id="searchbox" style="display: none"> - <h3>{{ _('Quick search') }}</h3> - <form class="search" action="{{ pathto('search') }}" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="{{ _('Go') }}" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip"> - {{ _('Enter search terms or a module, class or function name.') }} - </p> - </div> - <script type="text/javascript">$('#searchbox').show(0);</script> - {%- endif %} - {%- endblock %} - </div> - </div> - {%- endif %}{% endif %} -{%- endmacro %} - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> - {{ metatags }} - {%- if not embedded and docstitle %} - {%- set titlesuffix = " — "|safe + docstitle|e %} - {%- else %} - {%- set titlesuffix = "" %} - {%- endif %} - <title>{{ title|striptags }}{{ titlesuffix }}</title> - <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> - <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> - {%- if not embedded %} - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '{{ pathto("", 1) }}', - VERSION: '{{ release|e }}', - COLLAPSE_MODINDEX: false, - FILE_SUFFIX: '{{ file_suffix }}', - HAS_SOURCE: {{ has_source|lower }} - }; - </script> - {%- for scriptfile in script_files %} - <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> - {%- endfor %} - {%- if use_opensearch %} - <link rel="search" type="application/opensearchdescription+xml" - title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" - href="{{ pathto('_static/opensearch.xml', 1) }}"/> - {%- endif %} - {%- if favicon %} - <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> - {%- endif %} - {%- endif %} -{%- block linktags %} - {%- if hasdoc('about') %} - <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> - {%- endif %} - {%- if hasdoc('genindex') %} - <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" /> - {%- endif %} - {%- if hasdoc('search') %} - <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" /> - {%- endif %} - {%- if hasdoc('copyright') %} - <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" /> - {%- endif %} - <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" /> - {%- if parents %} - <link rel="up" title="{{ parents[-1].title|striptags }}" href="{{ parents[-1].link|e }}" /> - {%- endif %} - {%- if next %} - <link rel="next" title="{{ next.title|striptags }}" href="{{ next.link|e }}" /> - {%- endif %} - {%- if prev %} - <link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}" /> - {%- endif %} -{%- endblock %} -{%- block extrahead %} {% endblock %} - </head> - <body> -{%- block header %} -<div class="noprint" id="navcontainer"><a href="http://www.blender.org/"><img width="140" height="50" title="blender.org home page" alt="blender.org home page" src="http://www.blender.org/fileadmin/site/_gfx/nav-home.png"></a><a href="http://www.blender.org/features-gallery/"><img width="140" height="50" title="Features & Gallery" alt="Features & Gallery" src="http://www.blender.org/fileadmin/site/_gfx/nav-features.png"></a><a href="http://www.blender.org/download/get-blender/"><img width="140" height="50" title="Download" alt="Download" src="http://www.blender.org/fileadmin/site/_gfx/nav-download.png"></a><a href="http://www.blender.org/education-help/"><img width="140" height="50" title="Tutorials & Help" alt="Tutorials & Help" src="http://www.blender.org/fileadmin/site/_gfx/nav-help.png"></a><a href="http://www.blender.org/community/user-community/"><img width="140" height="50" title="Community" alt="Community" src="http://www.blender.org/fileadmin/site/_gfx/nav-community.png"></a><a href="http://www.blender.org/development/"><img width="140" height="50" title="Development" alt="Development" src="http://www.blender.org/fileadmin/site/_gfx/nav-development-on.png"></a><a href="http://www.blender.org/e-shop/"><img width="140" height="50" title="e-Shop" alt="e-Shop" src="http://www.blender.org/fileadmin/site/_gfx/nav-eshop.png"></a></div> -{% endblock %} - - <div class="document"> - <div id="pageheader"></div> -{%- block relbar1 %}{{ relbar() }}{% endblock %} - -{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} - -{%- block document %} - <div class="documentwrapper"> - {%- if not embedded %}{% if not theme_nosidebar|tobool %} - <div class="bodywrapper"> - {%- endif %}{% endif %} - <div class="body"> - {% block body %} {% endblock %} - </div> - {%- if not embedded %}{% if not theme_nosidebar|tobool %} - </div> - {%- endif %}{% endif %} - </div> -{%- endblock %} - -{%- block sidebar2 %}{{ sidebar() }}{% endblock %} - <div class="clearer"></div> - -{%- block footer %} - <div class="footer"> - {%- if hasdoc('copyright') %} - {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} - {%- else %} - {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} - {%- endif %} - {%- if last_updated %} - {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} - {%- endif %} - {%- if show_sphinx %} - {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} - {%- endif %} - </div><b class="round"><b id="r1"></b><b id="r2"></b><b id="r3"></b><b id="r4"></b></b> -{%- endblock %} - </div> - </body> -</html> diff --git a/doc/python_api/blender-org/page.html b/doc/python_api/blender-org/page.html deleted file mode 100644 index 17a93016533..00000000000 --- a/doc/python_api/blender-org/page.html +++ /dev/null @@ -1,4 +0,0 @@ -{% extends "layout.html" %} -{% block body %} - {{ body }} -{% endblock %} diff --git a/doc/python_api/blender-org/static/bg.png b/doc/python_api/blender-org/static/bg.png Binary files differdeleted file mode 100644 index 5393d4aa58f..00000000000 --- a/doc/python_api/blender-org/static/bg.png +++ /dev/null diff --git a/doc/python_api/blender-org/static/default.css_t b/doc/python_api/blender-org/static/default.css_t deleted file mode 100644 index e6fe922e3af..00000000000 --- a/doc/python_api/blender-org/static/default.css_t +++ /dev/null @@ -1,654 +0,0 @@ -/** - * Sphinx stylesheet -- default theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -#navcontainer { - height: 50px; - margin: 0 auto; - position: relative; - width: 980px; -} - -#navcontainer img { - width: 140px; - height: 50px; -} - -#pageheader { - background-image:url("bg.png"); - height:80px; - position:relative; -} - -body { - font-family: {{ theme_bodyfont }}; - font-size: 12px; - line-height: 145%; - background-color: {{ theme_footerbgcolor }}; - color: {{ theme_textcolor }}; - min-width: 980px; - margin: 0; - padding: 0; -} - -div.document { - margin:20px auto 0; - position:relative; - text-align:left; - width:980px; -/* background-color: {{ theme_sidebarbgcolor }};*/ -} - -div.documentwrapper { - float: left; - width: 100%; - background-color: {{ theme_bgcolor }}; - border-color: {{ theme_bordercolor }}; - border-style:solid; - border-width:0 1px; - margin:0 auto; - min-height:30em; - padding:35px; -/* position:relative;*/ - text-align:left; - width:908px; - -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -div.body { - background-color: {{ theme_bgcolor }}; - color: {{ theme_textcolor }}; - padding: 0; - width: 640px; -} - -{%- if theme_rightsidebar|tobool %} -div.bodywrapper { - margin: 0 230px 0 0; -} -{%- endif %} - -div.footer { - background: #292929; - border-left: 1px solid #363636; - border-right: 1px solid #363636; - color: #ffffff; -/* width: 100%;*/ - margin: 0 auto; - padding: 20px 20px 15px 35px; - text-align: center; - font-size: 75%; -} - -div.footer+.round b { - display: block; - background: #292929; - width: auto; -} - -div.footer+.round #r1 { - border-left: 1px solid #363636; - border-right: 1px solid #363636; - height: 2px; - margin: 0 1px; -} - -div.footer+.round #r2 { - border-left: 1px solid #363636; - border-right: 1px solid #363636; - height: 1px; - margin: 0 2px; -} - -div.footer+.round #r3 { - border-left: 1px solid #363636; - border-right: 1px solid #363636; - height: 1px; - margin: 0 3px; -} - -div.footer+.round #r4 { - border-bottom: 1px solid #363636; - height: 0px; - margin: 0 5px; -} - -div.footer a { - color: {{ theme_footertextcolor }}; - text-decoration: underline; -} - -.boxheader { - background-color:#3E4D5E; -} - -.subnav { - height:auto !important; - min-height:15px; - padding:9px 0px 9px 37px; - position:relative; -} - -div.related { - width:auto; - font-size:100%; - font-weight:400; - background-color: {{ theme_relbarbgcolor }}; - line-height: 145%; - color: {{ theme_relbartextcolor }}; -} - -div.related li { - font-size:0.9em; -} - -div.related li.right { - margin: 0; - word-spacing: 3px; -} - -div.subnav li { - display:inline; - list-style-type:none; - margin:0; - padding:0 7px 0 0; -} - -div.subnav ul { - display:inline; - margin:0; - padding:0; -} - -.subnav a { - font-weight: bold; - color: #fff; -} - -.subnav li.subnav-active a { - color:#F39410; -} - -div.related a { - color: {{ theme_relbarlinkcolor }}; -} - -div.related a:active { - color: {{ theme_relbaractlinkcolor }}; -} - -div.sphinxsidebar { - width: 280px; - font-size: 100%; - {%- if theme_stickysidebar|tobool %} -/* top: 30px;*/ - margin: 0; - position: absolute; - overflow: auto; - height: 100%; - {%- endif %} - {%- if theme_rightsidebar|tobool %} - float: right; - {%- if theme_stickysidebar|tobool %} - right: 0; - {%- endif %} - {%- endif %} -} - -div.sphinxsidebarwrapper { - width: inherit; - padding: 0; - position: absolute; - margin-top: 35px; - font-size: 8pt; -} - -div.sphinxsidebarwrapper.fixed { - position:fixed; - top:10px; - margin-top: 0; -} - -{%- if theme_stickysidebar|tobool %} -/* this is nice, but it leads to hidden headings when jumping - to an anchor */ -/* -div.related { - position: fixed; -} - -div.documentwrapper { - margin-top: 30px; -} -*/ -{%- endif %} - -div.sphinxsidebar h3 { - font-family: {{ theme_headfont }}; - color: {{ theme_sidebartextcolor }}; - font-size: 12px; - font-weight: bold; - background: #3E4D5E url("rnd.png") no-repeat top left; - height: 16px; - margin: 0; - padding: 10px 5px 10px 18px; -} - -div.sphinxsidebar h3 a { - color: {{ theme_sidebartextcolor }}; -} - -div.sphinxsidebar h4 { - font-family: {{ theme_headfont }}; - color: {{ theme_sidebartextcolor }}; - background: #3E4D5E url("rnd.png") no-repeat top left; - height: 16px; - font-size: 12px; - font-weight: bold; - margin: 0; - padding: 10px 5px 10px 18px; -} - -div.sphinxsidebar form { - margin: 0; - padding: 10px; - background-color: #292929; - {%- if theme_rightsidebar|tobool %} - border-right: 1px solid {{ theme_bordercolor }}; - {%- endif %} -} - -div.sphinxsidebar p { - background-color: #292929; - padding: 5px 10px 10px 10px; - color: {{ theme_sidebartextcolor }}; - {%- if theme_rightsidebar|tobool %} - border-right: 1px solid {{ theme_bordercolor }}; - {%- endif %} - margin-top: 0; -} - -div.sphinxsidebar p.topless { - margin-bottom: 25px; -} - -div.sphinxsidebar ul { - background-color: #292929; - margin: 0; - padding: 0; - color: {{ theme_sidebartextcolor }}; -} - -div.sphinxsidebar > div > ul { - margin-bottom: 25px; - padding:10px; -} - -div.sphinxsidebar a { - color: {{ theme_sidebarlinkcolor }}; -} - -div.sphinxsidebar input { - border: 1px solid {{ theme_sidebarlinkcolor }}; - font-family: sans-serif; - font-size: 1em; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: {{ theme_linkcolor }}; - text-decoration: none; -} - -a:hover { - text-decoration: underline; -} - -/*div.body h1,*/ -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: {{ theme_headfont }}; - background-color: {{ theme_headbgcolor }}; - font-weight: bold; - color: {{ theme_headtextcolor }}; -/* border-bottom: 1px solid #ccc;*/ - margin: 20px -20px 10px -20px; - padding: 3px 0 3px 10px; -} - -div.body h1 { margin-top: 0; font-size: 200%; - color:#FFFAE0; - font-family:"Helvetica","Arial",sans-serif; - font-size:34px; - font-weight:normal; - left:32px; - line-height:26px; - margin-top:0; - position:absolute; - top:36px; -} -div.body h2 { font-size: 160%; } -div.body h3 { font-size: 140%; } -div.body h4 { font-size: 120%; } -div.body h5 { font-size: 110%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: {{ theme_headlinkcolor }}; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -h1:hover > a.headerlink { - display:none; -} - -a.headerlink:hover { - background-color: {{ theme_headlinkcolor }}; - color: white; -} - -div.body p, div.body dd, div.body li { - text-align: justify; - line-height: 130%; -} - -div.note, div.seealso, div.topic, div.warning { - color:white; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.note { - background-color: #555; - border: 1px solid #ddd; -} - -div.seealso { - background-color: #525241; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #B64444; - border: 1px solid #990606; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -dl div.admonition { - border:medium none; - margin:0; - padding:2px 5px 2px 0; -} - -dl.class > dd > div.warning p.admonition-title, -dl.class > dd > div.note p.admonition-title { - display:none; -} - -dl.class > dd > div.admonition.warning p, -dl.class > dd > div.admonition.note p { - margin:0; -} - -dl.class > dd > div.admonition.warning, -dl.class > dd > div.admonition.note { - margin-bottom:12px; -} - -dl div.admonition.note p.admonition-title, dl div.admonition.warning p.admonition-title { - color:inherit; -} - -dl div.admonition.warning p { - font-weight:bold; - line-height:150%; -} - -dl div.admonition.warning p * { - font-weight:normal; -} - -dl div.admonition p.admonition-title { - color:#555555; - display:block; - float:left; - margin:0; - padding-right:12px; - text-align:right; - width:90px; -} - -dl div.admonition p.admonition-title+p, dl div.admonition p { - display:block; - margin:0 0 0 102px; -} - -dl div.note { - background:none; - color:#E8E481; -} - -dl div.warning { - background:none; - color:#FC3030; -} - -dl div.seealso { - background:none; -} - -dl div.admonition.seealso p+p { - color:#222; -} - -dl div.seealso a { - margin-left:-1.3ex; -} - -div.admonition.warning pre { - background: #0F0704; - color: #fc3030; -} - -div.admonition pre { - margin: 6px 0; - overflow: visible; - white-space: pre-wrap; -} - -pre { - padding: 10px; - background-color: #000; - color: #fff; - line-height: normal; - border: 0 solid white; -} - -dl.function>dt, dl.method>dt { - text-indent:-118px; - padding-left: 118px; -} - -dl.function>dt em, dl.method>dt em { - color: #97b9cf; -} - -dl.function>dd em, dl.method>dd em { - color: #97b9cf; - font-weight:bold; -} - -dl.function table.field-list tr:first-child td.field-body, dl.method table.field-list tr:first-child td.field-body { - color: #728c96; -} - -dl.function>dt em:before, dl.method>dt em:before { - content: " "; - display: block; -} - -dl.function>dd>p,dl.method>dd>p,dl.attribute>dd>p, -dl[class]>dd>ol,dl[class]>dd>ul { - color: #999; -} - -dl.data>dt { - color:#08C659; -} - -dl.data>dd>p { - color:#069643; -} - -dl.class>dt { - color: #82a3c7; -} - -dl.class>dd>p,dl.class>dd>ol,dl.class>dd>ul { - color: #637b96; -} - -dl.function>dt,dl.method>dt,dl.attribute>dt { - color: #fcb100; -} - -dl.function>dd>p,dl.method>dd>p,dl.attribute>dd>p, -dl.function>dd>p+ol,dl.method>dd>p+ol,dl.attribute>dd>p+ol, -dl.function>dd>p+ul,dl.method>dd>p+ul,dl.attribute>dd>p+ul { - color: #cb8f00; -} - -dl.function>dd>p, dl.method>dd>p, dl.attribute>dd>p { - margin: 0 0 3px 102px; -} - -dl.function>dd>p:first-child:before, dl.method>dd>p:first-child:before, dl.attribute>dd>p:first-child:before { - content:"Description:"; - color:#555; - font-weight:bold; - font-style:normal; - width:90px; - display:inline-block; - margin-left:-102px; - text-align:right; - padding-right:12px; -} - -dt:target, .highlight { - color: #444; - background: #333; -} - -.highlight { - background: #E2C788; -} - -h1 .highlight { - color:inherit; - background:inherit; -} - -dl { - margin-bottom: 25px; -} - -dd { - margin: 3px 0 10px 15px; -} - -.field-body tt.literal { - font-weight: normal; -} - -tt { - background-color: #444; - padding: 0 1px 0 1px; - font-size: 0.95em; -} - -.warning tt { - background: #cc6262; -} - -.note tt { - background: #444; -} - -dl .warning tt { - background:#0F0704; - display:block; -} - -dl .note tt { - background:#2C2A1B; -} - -table.indextable tr.cap { - background-color: transparent; -} - -col.field-name { - width:90px; -} - -dd table { - margin-bottom: 0; -} - -table.field-list th { - color:#555; - padding:0; - text-align:right; -} - -table.field-list td.field-body { - color:#999999; - padding-left:12px; -} - -table.field-list td.field-body ul.first { - padding-left:0; - list-style:none; - margin-left:0; -} - -dl.function>dd>ol, dl.method>dd>ol, dl.attribute>dd>ol, -dl.function>dd>ul, dl.method>dd>ul, dl.attribute>dd>ul, -dl.function>dd>div[class|="highlight"], dl.method>dd>div[class|="highlight"], -dl.attribute>dd>div[class|="highlight"] { - margin-left:102px; -} - -dl.function>dd>ol, dl.method>dd>ol, dl.attribute>dd>ol, -dl.function>dd>ul, dl.method>dd>ul, dl.attribute>dd>ul, -dl.class>dd>ol, dl.class>dd>ul { - padding-left:20px; -} diff --git a/doc/python_api/blender-org/static/jquery.sidebar.js b/doc/python_api/blender-org/static/jquery.sidebar.js deleted file mode 100644 index c22c61f2409..00000000000 --- a/doc/python_api/blender-org/static/jquery.sidebar.js +++ /dev/null @@ -1,26 +0,0 @@ -$(document).ready(function () { - var top = $('.sphinxsidebarwrapper').offset().top - parseFloat($('.sphinxsidebarwrapper').css ('marginTop').replace(/auto/, 0)); - var colheight = parseFloat($('.sphinxsidebarwrapper').css('height').replace(/auto/, 0)); - - -$(window).scroll(function (event) { - // what the y position of the scroll is - var y = $(this).scrollTop(); - - // whether that's below the form - if (y >= top) { - //colheight is checked and according to its vaule the scrolling - //is triggered or not - if (colheight <= window.innerHeight) { - // if so, ad the fixed class - $('.sphinxsidebarwrapper').addClass('fixed'); - } else { - // otherwise remove it - $('.sphinxsidebarwrapper').removeClass('fixed'); - } - } else { - // otherwise remove it - $('.sphinxsidebarwrapper').removeClass('fixed'); - } -}); -}); diff --git a/doc/python_api/blender-org/static/pygments.css b/doc/python_api/blender-org/static/pygments.css deleted file mode 100644 index d67231e84ab..00000000000 --- a/doc/python_api/blender-org/static/pygments.css +++ /dev/null @@ -1,61 +0,0 @@ -.hll { background-color: #ffffcc } -.c { color: #7f7f7f; font-style: italic } /* Comment */ -.err { border: 1px solid #FF0000 } /* Error */ -.k { color: #0088ff; font-weight: bold } /* Keyword */ -.o { color: #993399 } /* Operator */ -.cm { color: #7f7f7f; font-style: italic } /* Comment.Multiline */ -.cp { color: #007020 } /* Comment.Preproc */ -.c1 { color: #408090; font-style: italic } /* Comment.Single */ -.cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */ -.gd { color: #A00000 } /* Generic.Deleted */ -.ge { font-style: italic } /* Generic.Emph */ -.gr { color: #FF0000 } /* Generic.Error */ -.gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.gi { color: #00A000 } /* Generic.Inserted */ -.go { color: #303030 } /* Generic.Output */ -.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ -.gs { font-weight: bold } /* Generic.Strong */ -.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.gt { color: #0040D0 } /* Generic.Traceback */ -.kc { color: #007020; font-weight: bold } /* Keyword.Constant */ -.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ -.kn { color: #FFFF32; font-weight: bold } /* Keyword.Namespace */ -.kp { color: #007020 } /* Keyword.Pseudo */ -.kr { color: #FFFF32; font-weight: bold } /* Keyword.Reserved */ -.kt { color: #902000 } /* Keyword.Type */ -.m { color: #00BAFF } /* Literal.Number */ -.s { color: #B7C274 } /* Literal.String */ -.na { color: #4070a0 } /* Name.Attribute */ -.nb { color: #007020 } /* Name.Builtin */ -.nc { color: #0e84b5; font-weight: bold } /* Name.Class */ -.no { color: #60add5 } /* Name.Constant */ -.nd { color: #555555; font-weight: bold } /* Name.Decorator */ -.ni { color: #d55537; font-weight: bold } /* Name.Entity */ -.ne { color: #007020 } /* Name.Exception */ -.nf { color: #06287e } /* Name.Function */ -.nl { color: #002070; font-weight: bold } /* Name.Label */ -.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ -.nt { color: #062873; font-weight: bold } /* Name.Tag */ -.nv { color: #bb60d5 } /* Name.Variable */ -.ow { color: #007020; font-weight: bold } /* Operator.Word */ -.w { color: #bbbbbb } /* Text.Whitespace */ -.mf { color: #00BAFF } /* Literal.Number.Float */ -.mh { color: #00BAFF } /* Literal.Number.Hex */ -.mi { color: #00BAFF } /* Literal.Number.Integer */ -.mo { color: #00BAFF } /* Literal.Number.Oct */ -.sb { color: #B7C274 } /* Literal.String.Backtick */ -.sc { color: #B7C274 } /* Literal.String.Char */ -.sd { color: #B7C274; font-style: italic } /* Literal.String.Doc */ -.s2 { color: #B7C274 } /* Literal.String.Double */ -.se { color: #B7C274; font-weight: bold } /* Literal.String.Escape */ -.sh { color: #B7C274 } /* Literal.String.Heredoc */ -.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ -.sx { color: #c65d09 } /* Literal.String.Other */ -.sr { color: #235388 } /* Literal.String.Regex */ -.s1 { color: #4070a0 } /* Literal.String.Single */ -.ss { color: #517918 } /* Literal.String.Symbol */ -.bp { color: #007020 } /* Name.Builtin.Pseudo */ -.vc { color: #bb60d5 } /* Name.Variable.Class */ -.vg { color: #bb60d5 } /* Name.Variable.Global */ -.vi { color: #bb60d5 } /* Name.Variable.Instance */ -.il { color: #00BAFF } /* Literal.Number.Integer.Long */ diff --git a/doc/python_api/blender-org/static/rnd.png b/doc/python_api/blender-org/static/rnd.png Binary files differdeleted file mode 100644 index 95bc613c731..00000000000 --- a/doc/python_api/blender-org/static/rnd.png +++ /dev/null diff --git a/doc/python_api/blender-org/static/rndbl.png b/doc/python_api/blender-org/static/rndbl.png Binary files differdeleted file mode 100644 index 976161642fd..00000000000 --- a/doc/python_api/blender-org/static/rndbl.png +++ /dev/null diff --git a/doc/python_api/blender-org/static/rndbr.png b/doc/python_api/blender-org/static/rndbr.png Binary files differdeleted file mode 100644 index de94512ccc6..00000000000 --- a/doc/python_api/blender-org/static/rndbr.png +++ /dev/null diff --git a/doc/python_api/blender-org/theme.conf b/doc/python_api/blender-org/theme.conf deleted file mode 100644 index a4356fd2690..00000000000 --- a/doc/python_api/blender-org/theme.conf +++ /dev/null @@ -1,30 +0,0 @@ -[theme] -inherit = basic -stylesheet = default.css -pygments_style = sphinx - -[options] -rightsidebar = true -stickysidebar = true - -footerbgcolor = #000000 -footertextcolor = #ffffff -sidebarbgcolor = #1c4e63 -sidebartextcolor = #ffffff -sidebarlinkcolor = #97b9cf -relbarbgcolor = #2C3845 -relbartextcolor = #D3E0E9 -relbarlinkcolor = #D3E0E9 -relbaractlinkcolor = #f39410 -bgcolor = #232323 -bordercolor = #363636 -textcolor = #ffffff -headbgcolor = #232323 -headtextcolor = #ffffff -headlinkcolor = #97b9cf -linkcolor = #97b9cf -codebgcolor = #eeffcc -codetextcolor = #333333 - -bodyfont = "Lucida Grande","Lucida Sans Unicode","Lucida Sans","Lucida",Verdana,sans-serif -headfont = "Lucida Grande","Lucida Sans Unicode","Lucida Sans","Lucida",Verdana,sans-serif diff --git a/doc/python_api/examples/bge.constraints.py b/doc/python_api/examples/bge.constraints.py deleted file mode 100644 index c617ac0622b..00000000000 --- a/doc/python_api/examples/bge.constraints.py +++ /dev/null @@ -1,37 +0,0 @@ -""" -Basic Physics Constraint -++++++++++++++++++++++++ -Example of how to create a hinge Physics Constraint between two objects. -""" -from bge import logic -from bge import constraints - -# get object list -objects = logic.getCurrentScene().objects - -# get object named Object1 and Object 2 -object_1 = objects["Object1"] -object_2 = objects["Object2"] - -# want to use Edge constraint type -constraint_type = 2 - -# get Object1 and Object2 physics IDs -physics_id_1 = object_1.getPhysicsId() -physics_id_2 = object_2.getPhysicsId() - -# use bottom right edge of Object1 for hinge position -edge_position_x = 1.0 -edge_position_y = 0.0 -edge_position_z = -1.0 - -# rotate the pivot z axis about 90 degrees -edge_angle_x = 0.0 -edge_angle_y = 0.0 -edge_angle_z = 90.0 - -# create an edge constraint -constraints.createConstraint(physics_id_1, physics_id_2, - constraint_type, - edge_position_x, edge_position_y, edge_position_z, - edge_angle_x, edge_angle_y, edge_angle_z) diff --git a/doc/python_api/examples/bge.texture.1.py b/doc/python_api/examples/bge.texture.1.py deleted file mode 100644 index 732c786c667..00000000000 --- a/doc/python_api/examples/bge.texture.1.py +++ /dev/null @@ -1,40 +0,0 @@ -""" -Texture Replacement -+++++++++++++++++++ - -Example of how to replace a texture in game with an external image. -``createTexture()`` and ``removeTexture()`` are to be called from a -module Python Controller. -""" -from bge import logic -from bge import texture - - -def createTexture(cont): - """Create a new Dynamic Texture""" - obj = cont.owner - - # get the reference pointer (ID) of the internal texture - ID = texture.materialID(obj, 'IMoriginal.png') - - # create a texture object - object_texture = texture.Texture(obj, ID) - - # create a new source with an external image - url = logic.expandPath("//newtexture.jpg") - new_source = texture.ImageFFmpeg(url) - - # the texture has to be stored in a permanent Python object - logic.texture = object_texture - - # update/replace the texture - logic.texture.source = new_source - logic.texture.refresh(False) - - -def removeTexture(cont): - """Delete the Dynamic Texture, reversing back the final to its original state.""" - try: - del logic.texture - except: - pass diff --git a/doc/python_api/examples/bge.texture.2.py b/doc/python_api/examples/bge.texture.2.py deleted file mode 100644 index 5125c3d1957..00000000000 --- a/doc/python_api/examples/bge.texture.2.py +++ /dev/null @@ -1,239 +0,0 @@ -""" -Video Capture with DeckLink -+++++++++++++++++++++++++++ -Video frames captured with DeckLink cards have pixel formats that are generally not directly -usable by OpenGL, they must be processed by a shader. The three shaders presented here should -cover all common video capture cases. - -This file reflects the current video transfer method implemented in the Decklink module: -whenever possible the video images are transferred as float texture because this is more -compatible with GPUs. Of course, only the pixel formats that have a correspondant GL format -can be transferred as float. Look for fg_shaders in this file for an exhaustive list. - -Other pixel formats will be transferred as 32 bits integer red-channel texture but this -won't work with certain GPU (Intel GMA); the corresponding shaders are not shown here. -However, it should not be necessary to use any of them as the list below covers all practical -cases of video capture with all types of Decklink product. - -In other words, only use one of the pixel format below and you will be fine. Note that depending -on the video stream, only certain pixel formats will be allowed (others will throw an exception). -For example, to capture a PAL video stream, you must use one of the YUV formats. - -To find which pixel format is suitable for a particular video stream, use the 'Media Express' -utility that comes with the Decklink software : if you see the video in the 'Log and Capture' -Window, you have selected the right pixel format and you can use the same in Blender. - -Notes: * these shaders only decode the RGB channel and set the alpha channel to a fixed -value (look for color.a = ). It's up to you to add postprocessing to the color. - * these shaders are compatible with 2D and 3D video stream -""" -import bge -from bge import logic -from bge import texture as vt - -# The default vertex shader, because we need one -# -VertexShader = """ -#version 130 - void main() - { - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_TexCoord[0] = gl_MultiTexCoord0; - } - -""" - -# For use with RGB video stream: the pixel is directly usable -# -FragmentShader_R10l = """ - #version 130 - uniform sampler2D tex; - // stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above) - uniform float stereo; - // eye = 0.0 for the left eye, 0.5 for the right eye - uniform float eye; - - void main(void) - { - vec4 color; - float tx, ty; - tx = gl_TexCoord[0].x; - ty = eye+gl_TexCoord[0].y*stereo; - color = texture(tex, vec2(tx,ty)); - color.a = 0.7; - gl_FragColor = color; - } -""" - -# For use with YUV video stream -# -FragmentShader_2vuy = """ - #version 130 - uniform sampler2D tex; - // stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above) - uniform float stereo; - // eye = 0.0 for the left eye, 0.5 for the right eye - uniform float eye; - - void main(void) - { - vec4 color; - float tx, ty, width, Y, Cb, Cr; - int px; - tx = gl_TexCoord[0].x; - ty = eye+gl_TexCoord[0].y*stereo; - width = float(textureSize(tex, 0).x); - color = texture(tex, vec2(tx, ty)); - px = int(floor(fract(tx*width)*2.0)); - switch (px) { - case 0: - Y = color.g; - break; - case 1: - Y = color.a; - break; - } - Y = (Y - 0.0625) * 1.168949772; - Cb = (color.b - 0.0625) * 1.142857143 - 0.5; - Cr = (color.r - 0.0625) * 1.142857143 - 0.5; - color.r = Y + 1.5748 * Cr; - color.g = Y - 0.1873 * Cb - 0.4681 * Cr; - color.b = Y + 1.8556 * Cb; - color.a = 0.7; - gl_FragColor = color; - } -""" - -# For use with high resolution YUV -# -FragmentShader_v210 = """ - #version 130 - uniform sampler2D tex; - // stereo = 1.0 if 2D image, =0.5 if 3D (left eye below, right eye above) - uniform float stereo; - // eye = 0.0 for the left eye, 0.5 for the right eye - uniform float eye; - - void main(void) - { - vec4 color, color1, color2, color3; - int px; - float tx, ty, width, sx, dx, bx, Y, Cb, Cr; - tx = gl_TexCoord[0].x; - ty = eye+gl_TexCoord[0].y*stereo; - width = float(textureSize(tex, 0).x); - // to sample macro pixels (6 pixels in 4 words) - sx = tx*width*0.25+0.01; - // index of display pixel in the macro pixel 0..5 - px = int(floor(fract(sx)*6.0)); - // increment as we sample the macro pixel - dx = 1.0/width; - // base x coord of macro pixel - bx = (floor(sx)+0.01)*dx*4.0; - color = texture(tex, vec2(bx, ty)); - color1 = texture(tex, vec2(bx+dx, ty)); - color2 = texture(tex, vec2(bx+dx*2.0, ty)); - color3 = texture(tex, vec2(bx+dx*3.0, ty)); - switch (px) { - case 0: - case 1: - Cb = color.b; - Cr = color.r; - break; - case 2: - case 3: - Cb = color1.g; - Cr = color2.b; - break; - default: - Cb = color2.r; - Cr = color3.g; - break; - } - switch (px) { - case 0: - Y = color.g; - break; - case 1: - Y = color1.b; - break; - case 2: - Y = color1.r; - break; - case 3: - Y = color2.g; - break; - case 4: - Y = color3.b; - break; - default: - Y = color3.r; - break; - } - Y = (Y - 0.0625) * 1.168949772; - Cb = (Cb - 0.0625) * 1.142857143 - 0.5; - Cr = (Cr - 0.0625) * 1.142857143 - 0.5; - color.r = Y + 1.5748 * Cr; - color.g = Y - 0.1873 * Cb - 0.4681 * Cr; - color.b = Y + 1.8556 * Cb; - color.a = 0.7; - gl_FragColor = color; - } -""" - -# The exhausitve list of pixel formats that are transferred as float texture -# Only use those for greater efficiency and compatiblity. -# -fg_shaders = { - '2vuy': FragmentShader_2vuy, - '8BitYUV': FragmentShader_2vuy, - 'v210': FragmentShader_v210, - '10BitYUV': FragmentShader_v210, - '8BitBGRA': FragmentShader_R10l, - 'BGRA': FragmentShader_R10l, - '8BitARGB': FragmentShader_R10l, - '10BitRGBXLE': FragmentShader_R10l, - 'R10l': FragmentShader_R10l -} - - -# -# Helper function to attach a pixel shader to the material that receives the video frame. -# - -def config_video(obj, format, pixel, is3D=False, mat=0, card=0): - if pixel not in fg_shaders: - raise('Unsuported shader') - shader = obj.meshes[0].materials[mat].getShader() - if shader is not None and not shader.isValid(): - shader.setSource(VertexShader, fg_shaders[pixel], True) - shader.setSampler('tex', 0) - shader.setUniformEyef("eye") - shader.setUniform1f("stereo", 0.5 if is3D else 1.0) - tex = vt.Texture(obj, mat) - tex.source = vt.VideoDeckLink(format + "/" + pixel + ("/3D" if is3D else ""), card) - print("frame rate: ", tex.source.framerate) - tex.source.play() - obj["video"] = tex - -# -# Attach this function to an object that has a material with texture -# and call it once to initialize the object -# - - -def init(cont): - # config_video(cont.owner, 'HD720p5994', '8BitBGRA') - # config_video(cont.owner, 'HD720p5994', '8BitYUV') - # config_video(cont.owner, 'pal ', '10BitYUV') - config_video(cont.owner, 'pal ', '8BitYUV') - - -# -# To be called on every frame -# -def play(cont): - obj = cont.owner - video = obj.get("video") - if video is not None: - video.refresh(True) diff --git a/doc/python_api/examples/bge.texture.py b/doc/python_api/examples/bge.texture.py deleted file mode 100644 index 510736805a2..00000000000 --- a/doc/python_api/examples/bge.texture.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -Basic Video Playback -++++++++++++++++++++ -Example of how to replace a texture in game with a video. -It needs to run everyframe. -To avoid any confusion with the location of the file, -we will use ``GameLogic.expandPath()`` to build an absolute file name, -assuming the video file is in the same directory as the blend-file. -""" -import bge -from bge import texture -from bge import logic - -cont = logic.getCurrentController() -obj = cont.owner - -# the creation of the texture must be done once: save the -# texture object in an attribute of bge.logic module makes it persistent -if not hasattr(logic, 'video'): - - # identify a static texture by name - matID = texture.materialID(obj, 'IMvideo.png') - - # create a dynamic texture that will replace the static texture - logic.video = texture.Texture(obj, matID) - - # define a source of image for the texture, here a movie - movie = logic.expandPath('//trailer_400p.ogg') - logic.video.source = texture.VideoFFmpeg(movie) - logic.video.source.scale = True - - # Note that we can change the ``Texture`` source at any time. - # Suppose we want to switch between two movies during the game: - logic.mySources[0] = texture.VideoFFmpeg('movie1.avi') - logic.mySources[1] = texture.VideoFFmpeg('movie2.avi') - - # And then assign (and reassign) the source during the game - logic.video.source = logic.mySources[movieSel] - - # quick off the movie, but it wont play in the background - logic.video.source.play() - - -# Video playback is not a background process: it happens only when we refresh the texture. -# So you need to call this function every frame to ensure update of the texture. -logic.video.refresh(True) diff --git a/doc/python_api/examples/bpy.app.translations.py b/doc/python_api/examples/bpy.app.translations.py index d18344f43be..866ad3234ff 100644 --- a/doc/python_api/examples/bpy.app.translations.py +++ b/doc/python_api/examples/bpy.app.translations.py @@ -24,8 +24,8 @@ Then, call ``bpy.app.translations.register(__name__, your_dict)`` in your ``regi The ``Manage UI translations`` add-on has several functions to help you collect strings to translate, and generate the needed python code (the translation dictionary), as well as optional intermediary po files if you want some... See -`How to Translate Blender <https://wiki.blender.org/index.php/Dev:Doc/Process/Translate_Blender>`_ and -`Using i18n in Blender Code <https://wiki.blender.org/index.php/Dev:Source/Interface/Internationalization>`_ +`How to Translate Blender <https://wiki.blender.org/wiki/Process/Translate_Blender>`_ and +`Using i18n in Blender Code <https://wiki.blender.org/wiki/Source/Interface/Internationalization>`_ for more info. Module References @@ -36,7 +36,7 @@ Module References import bpy # This block can be automatically generated by UI translations addon, which also handles conversion with PO format. -# See also https://wiki.blender.org/index.php/Dev:Doc/Process/Translate_Blender#Translating_non-official_addons +# See also https://wiki.blender.org/wiki/Process/Translate_Blender#Translating_non-official_addons # It can (should) also be put in a different, specific py file. # ##### BEGIN AUTOGENERATED I18N SECTION ##### diff --git a/doc/python_api/examples/bpy.ops.2.py b/doc/python_api/examples/bpy.ops.2.py index dd88c73d5e9..5f98c8a6656 100644 --- a/doc/python_api/examples/bpy.ops.2.py +++ b/doc/python_api/examples/bpy.ops.2.py @@ -20,6 +20,6 @@ The execution context is one of: 'EXEC_SCREEN') """ -# group add popup +# collection add popup import bpy -bpy.ops.object.group_instance_add('INVOKE_DEFAULT') +bpy.ops.object.collection_instance_add('INVOKE_DEFAULT') diff --git a/doc/python_api/examples/bpy.types.Menu.2.py b/doc/python_api/examples/bpy.types.Menu.2.py index a1cce0c3ce2..fbdf747d472 100644 --- a/doc/python_api/examples/bpy.types.Menu.2.py +++ b/doc/python_api/examples/bpy.types.Menu.2.py @@ -15,4 +15,4 @@ def menu_draw(self, context): self.layout.operator("wm.save_homefile") -bpy.types.INFO_MT_file.append(menu_draw) +bpy.types.TOPBAR_MT_file.append(menu_draw) diff --git a/doc/python_api/examples/bpy.types.Menu.3.py b/doc/python_api/examples/bpy.types.Menu.3.py index 9fe39535bbf..285052f2e20 100644 --- a/doc/python_api/examples/bpy.types.Menu.3.py +++ b/doc/python_api/examples/bpy.types.Menu.3.py @@ -7,7 +7,7 @@ to perform the common task of managing presets. This example shows how you can add a preset menu. -This example uses the object draw options, +This example uses the object display options, however you can use properties defined by your own scripts too. """ @@ -16,18 +16,18 @@ from bpy.types import Operator, Menu from bl_operators.presets import AddPresetBase -class OBJECT_MT_draw_presets(Menu): - bl_label = "Object Draw Presets" - preset_subdir = "object/draw" +class OBJECT_MT_display_presets(Menu): + bl_label = "Object Display Presets" + preset_subdir = "object/display" preset_operator = "script.execute_preset" - draw = Menu.draw_preset + display = Menu.display_preset -class AddPresetObjectDraw(AddPresetBase, Operator): - '''Add a Object Draw Preset''' - bl_idname = "camera.object_draw_preset_add" - bl_label = "Add Object Draw Preset" - preset_menu = "OBJECT_MT_draw_presets" +class AddPresetObjectDisplay(AddPresetBase, Operator): + '''Add a Object Display Preset''' + bl_idname = "camera.object_display_preset_add" + bl_label = "Add Object Display Preset" + preset_menu = "OBJECT_MT_display_presets" # variable used for all preset values preset_defines = [ @@ -36,31 +36,31 @@ class AddPresetObjectDraw(AddPresetBase, Operator): # properties to store in the preset preset_values = [ - "obj.draw_type", + "obj.display_type", "obj.show_bounds", - "obj.draw_bounds_type", + "obj.display_bounds_type", "obj.show_name", "obj.show_axis", "obj.show_wire", ] # where to store the preset - preset_subdir = "object/draw" + preset_subdir = "object/display" -# Draw into an existing panel +# Display into an existing panel def panel_func(self, context): layout = self.layout row = layout.row(align=True) - row.menu(OBJECT_MT_draw_presets.__name__, text=OBJECT_MT_draw_presets.bl_label) - row.operator(AddPresetObjectDraw.bl_idname, text="", icon='ZOOMIN') - row.operator(AddPresetObjectDraw.bl_idname, text="", icon='ZOOMOUT').remove_active = True + row.menu(OBJECT_MT_display_presets.__name__, text=OBJECT_MT_display_presets.bl_label) + row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOMIN') + row.operator(AddPresetObjectDisplay.bl_idname, text="", icon='ZOOMOUT').remove_active = True classes = ( - OBJECT_MT_draw_presets, - AddPresetObjectDraw, + OBJECT_MT_display_presets, + AddPresetObjectDisplay, ) diff --git a/doc/python_api/examples/bpy.types.Operator.2.py b/doc/python_api/examples/bpy.types.Operator.2.py index d1f0edf15aa..901bd7b21f8 100644 --- a/doc/python_api/examples/bpy.types.Operator.2.py +++ b/doc/python_api/examples/bpy.types.Operator.2.py @@ -45,7 +45,7 @@ def menu_func(self, context): # Register and add to the file selector bpy.utils.register_class(ExportSomeData) -bpy.types.INFO_MT_file_export.append(menu_func) +bpy.types.TOPBAR_MT_file_export.append(menu_func) # test call diff --git a/doc/python_api/examples/bpy.types.Panel.1.py b/doc/python_api/examples/bpy.types.Panel.1.py index 13a9f53fa7b..b409f8dadea 100644 --- a/doc/python_api/examples/bpy.types.Panel.1.py +++ b/doc/python_api/examples/bpy.types.Panel.1.py @@ -34,7 +34,7 @@ class ObjectSelectPanel(bpy.types.Panel): row.prop(obj, "hide_render") box = layout.box() - box.label("Selection Tools") + box.label(text="Selection Tools") box.operator("object.select_all").action = 'TOGGLE' row = box.row() row.operator("object.select_all").action = 'INVERT' diff --git a/doc/python_api/examples/bpy.types.Panel.2.py b/doc/python_api/examples/bpy.types.Panel.2.py index 261430f1396..2c860e3e1a7 100644 --- a/doc/python_api/examples/bpy.types.Panel.2.py +++ b/doc/python_api/examples/bpy.types.Panel.2.py @@ -21,7 +21,7 @@ class PanelOne(View3DPanel, bpy.types.Panel): bl_label = "Panel One" def draw(self, context): - self.layout.label("Small Class") + self.layout.label(text="Small Class") class PanelTwo(View3DPanel, bpy.types.Panel): @@ -29,7 +29,7 @@ class PanelTwo(View3DPanel, bpy.types.Panel): bl_label = "Panel Two" def draw(self, context): - self.layout.label("Also Small Class") + self.layout.label(text="Also Small Class") bpy.utils.register_class(PanelOne) diff --git a/doc/python_api/examples/bpy.types.UIList.2.py b/doc/python_api/examples/bpy.types.UIList.2.py index a02a0530a66..81bbec11d9a 100644 --- a/doc/python_api/examples/bpy.types.UIList.2.py +++ b/doc/python_api/examples/bpy.types.UIList.2.py @@ -76,7 +76,7 @@ class MESH_UL_vgroups_slow(bpy.types.UIList): subrow.prop(self, "use_filter_empty_reverse", text="", icon=icon) row = layout.row(align=True) - row.label("Order by:") + row.label(text="Order by:") row.prop(self, "use_order_name", toggle=True) row.prop(self, "use_order_importance", toggle=True) icon = 'TRIA_UP' if self.use_filter_orderby_invert else 'TRIA_DOWN' diff --git a/doc/python_api/examples/bpy.types.WindowManager.popup_menu.py b/doc/python_api/examples/bpy.types.WindowManager.popup_menu.py index e6329f677f7..670444b8283 100644 --- a/doc/python_api/examples/bpy.types.WindowManager.popup_menu.py +++ b/doc/python_api/examples/bpy.types.WindowManager.popup_menu.py @@ -8,7 +8,7 @@ import bpy def draw(self, context): - self.layout.label("Hello World") + self.layout.label(text="Hello World") bpy.context.window_manager.popup_menu(draw, title="Greeting", icon='INFO') diff --git a/doc/python_api/examples/gpu.offscreen.1.py b/doc/python_api/examples/gpu.types.GPUOffScreen.py index b4eb7452ca1..a1b38837278 100644 --- a/doc/python_api/examples/gpu.offscreen.1.py +++ b/doc/python_api/examples/gpu.types.GPUOffScreen.py @@ -42,7 +42,7 @@ class OffScreenDraw(bpy.types.Operator): aspect_ratio = scene.render.resolution_x / scene.render.resolution_y try: - offscreen = gpu.offscreen.new(512, int(512 / aspect_ratio)) + offscreen = gpu.types.GPUOffScreen(512, int(512 / aspect_ratio)) except Exception as e: print(e) offscreen = None @@ -52,6 +52,7 @@ class OffScreenDraw(bpy.types.Operator): @staticmethod def _update_offscreen(context, offscreen): scene = context.scene + view_layer = context.view_layer render = scene.render camera = scene.camera @@ -65,6 +66,7 @@ class OffScreenDraw(bpy.types.Operator): offscreen.draw_view3d( scene, + render_layer, context.space_data, context.region, projection_matrix, diff --git a/doc/python_api/requirements.txt b/doc/python_api/requirements.txt new file mode 100644 index 00000000000..19091a53cda --- /dev/null +++ b/doc/python_api/requirements.txt @@ -0,0 +1,2 @@ +Sphinx==1.7.6 +sphinx_rtd_theme==0.4.1 diff --git a/doc/python_api/rst/bge.app.rst b/doc/python_api/rst/bge.app.rst deleted file mode 100644 index e8b91ffbcaf..00000000000 --- a/doc/python_api/rst/bge.app.rst +++ /dev/null @@ -1,49 +0,0 @@ - -Application Data (bge.app) -========================== - -Module to access application values that remain unchanged during runtime. - -.. module:: bge.app - -.. data:: version - - The Blender/BGE version as a tuple of 3 ints, eg. (2, 75, 1). - - .. note:: - - Version tuples can be compared simply with (in)equality symbols; - for example, ``(2, 74, 5) <= (2, 75, 0)`` returns True (lexical order). - - :type: tuple of three ints - -.. data:: version_string - - The Blender/BGE version formatted as a string, eg. "2.75 (sub 1)". - - :type: str - -.. data:: version_char - - The Blender/BGE version character (for minor releases). - - :type: str - -.. data:: has_texture_ffmpeg - - True if the BGE has been built with FFmpeg support, - enabling use of :class:`~bge.texture.ImageFFmpeg` and :class:`~bge.texture.VideoFFmpeg`. - - :type: bool - -.. data:: has_joystick - - True if the BGE has been built with joystick support. - - :type: bool - -.. data:: has_physics - - True if the BGE has been built with physics support. - - :type: bool diff --git a/doc/python_api/rst/bge.constraints.rst b/doc/python_api/rst/bge.constraints.rst deleted file mode 100644 index 3cca22e9cff..00000000000 --- a/doc/python_api/rst/bge.constraints.rst +++ /dev/null @@ -1,356 +0,0 @@ - -Physics Constraints (bge.constraints) -===================================== - -Bullet Physics provides collision detection -and rigid body dynamics for the Blender Game Engine. - -Features: - -- Vehicle simulation. -- Rigid body constraints: hinge and point to point (ball socket). -- Access to internal physics settings, - like deactivation time, and debugging features - -.. module:: bge.constraints - -.. note:: Note about parameter settings - - Since this API is not well documented, it can be unclear what kind of values to use for setting parameters. - In general, damping settings should be in the range of 0 to 1 and - stiffness settings should not be much higher than about 10. - - -Examples --------- - -.. seealso:: - - For more examples of Bullet physics and how to use them - see the `pybullet forum <https://pybullet.org/Bullet/phpBB3/viewforum.php?f=17>`__. - -.. include:: __/examples/bge.constraints.py - :start-line: 1 - :end-line: 4 - -.. literalinclude:: __/examples/bge.constraints.py - :lines: 6- - - -Functions ---------- - -.. function:: createConstraint( \ - physicsid_1, physicsid_2, constraint_type, \ - pivot_x=0.0, pivot_y=0.0, pivot_z=0.0, \ - axis_x=0.0, axis_y=0.0, axis_z=0.0, flag=0) - - Creates a constraint. - - :arg physicsid_1: The physics id of the first object in constraint. - :type physicsid_1: int - - :arg physicsid_2: The physics id of the second object in constraint. - :type physicsid_2: int - - :arg constraint_type: The type of the constraint, see `Create Constraint Constants`_. - - :type constraint_type: int - - :arg pivot_x: Pivot X position. (optional) - :type pivot_x: float - - :arg pivot_y: Pivot Y position. (optional) - :type pivot_y: float - - :arg pivot_z: Pivot Z position. (optional) - :type pivot_z: float - - :arg axis_x: X axis angle in degrees. (optional) - :type axis_x: float - - :arg axis_y: Y axis angle in degrees. (optional) - :type axis_y: float - - :arg axis_z: Z axis angle in degrees. (optional) - :type axis_z: float - - :arg flag: 128 to disable collision between linked bodies. (optional) - :type flag: int - - :return: A constraint wrapper. - :rtype: :class:`~bge.types.KX_ConstraintWrapper` - -.. function:: exportBulletFile(filename) - - Exports a file representing the dynamics world (usually using ``.bullet`` extension). - - See `Bullet binary serialization <http://bulletphysics.org/mediawiki-1.5.8/index.php/Bullet_binary_serialization>`__. - - :arg filename: File path. - :type filename: str - -.. function:: getAppliedImpulse(constraintId) - - :arg constraintId: The id of the constraint. - :type constraintId: int - - :return: The most recent applied impulse. - :rtype: float - -.. function:: getVehicleConstraint(constraintId) - - :arg constraintId: The id of the vehicle constraint. - :type constraintId: int - - :return: A vehicle constraint object. - :rtype: :class:`~bge.types.KX_VehicleWrapper` - -.. function:: getCharacter(gameobj) - - :arg gameobj: The game object with the character physics. - :type gameobj: :class:`~bge.types.KX_GameObject` - - :return: Character wrapper. - :rtype: :class:`~bge.types.KX_CharacterWrapper` - -.. function:: removeConstraint(constraintId) - - Removes a constraint. - - :arg constraintId: The id of the constraint to be removed. - :type constraintId: int - -.. function:: setCcdMode(ccdMode) - - .. note:: - Very experimental, not recommended - - Sets the CCD (Continous Colision Detection) mode in the Physics Environment. - - :arg ccdMode: The new CCD mode. - :type ccdMode: int - -.. function:: setContactBreakingTreshold(breakingTreshold) - - .. note:: - Reasonable default is 0.02 (if units are meters) - - Sets tresholds to do with contact point management. - - :arg breakingTreshold: The new contact breaking treshold. - :type breakingTreshold: float - -.. function:: setDeactivationAngularTreshold(angularTreshold) - - Sets the angular velocity treshold. - - :arg angularTreshold: New deactivation angular treshold. - :type angularTreshold: float - -.. function:: setDeactivationLinearTreshold(linearTreshold) - - Sets the linear velocity treshold. - - :arg linearTreshold: New deactivation linear treshold. - :type linearTreshold: float - -.. function:: setDeactivationTime(time) - - Sets the time after which a resting rigidbody gets deactived. - - :arg time: The deactivation time. - :type time: float - -.. function:: setDebugMode(mode) - - Sets the debug mode. - - :arg mode: The new debug mode, see `Debug Mode Constants`_. - - :type mode: int - -.. function:: setGravity(x, y, z) - - Sets the gravity force. - - :arg x: Gravity X force. - :type x: float - - :arg y: Gravity Y force. - :type y: float - - :arg z: Gravity Z force. - :type z: float - -.. function:: setLinearAirDamping(damping) - - .. note:: - - Not implemented - - Sets the linear air damping for rigidbodies. - -.. function:: setNumIterations(numiter) - - Sets the number of iterations for an iterative constraint solver. - - :arg numiter: New number of iterations. - :type numiter: int - -.. function:: setNumTimeSubSteps(numsubstep) - - Sets the number of substeps for each physics proceed. Tradeoff quality for performance. - - :arg numsubstep: New number of substeps. - :type numsubstep: int - -.. function:: setSolverDamping(damping) - - .. note:: - Very experimental, not recommended - - Sets the damper constant of a penalty based solver. - - :arg damping: New damping for the solver. - :type damping: float - -.. function:: setSolverTau(tau) - - .. note:: - Very experimental, not recommended - - Sets the spring constant of a penalty based solver. - - :arg tau: New tau for the solver. - :type tau: float - -.. function:: setSolverType(solverType) - - .. note:: - Very experimental, not recommended - - Sets the solver type. - - :arg solverType: The new type of the solver. - :type solverType: int - -.. function:: setSorConstant(sor) - - .. note:: - Very experimental, not recommended - - Sets the successive overrelaxation constant. - - :arg sor: New sor value. - :type sor: float - -.. function:: setUseEpa(epa) - - .. note:: - - Not implemented - - -Constants -+++++++++ - -.. attribute:: error - - Symbolic constant string that indicates error. - - :type: str - - -Debug Mode Constants -^^^^^^^^^^^^^^^^^^^^ - -Debug mode to be used with :func:`setDebugMode`. - - -.. data:: DBG_NODEBUG - - No debug. - -.. data:: DBG_DRAWWIREFRAME - - Draw wireframe in debug. - -.. data:: DBG_DRAWAABB - - Draw Axis Aligned Bounding Box in debug. - -.. data:: DBG_DRAWFREATURESTEXT - - Draw features text in debug. - -.. data:: DBG_DRAWCONTACTPOINTS - - Draw contact points in debug. - -.. data:: DBG_NOHELPTEXT - - Debug without help text. - -.. data:: DBG_DRAWTEXT - - Draw text in debug. - -.. data:: DBG_PROFILETIMINGS - - Draw profile timings in debug. - -.. data:: DBG_ENABLESATCOMPARISION - - Enable sat comparision in debug. - -.. data:: DBG_DISABLEBULLETLCP - - Disable Bullet LCP. - -.. data:: DBG_ENABLECCD - - Enable Continous Collision Detection in debug. - -.. data:: DBG_DRAWCONSTRAINTS - - Draw constraints in debug. - -.. data:: DBG_DRAWCONSTRAINTLIMITS - - Draw constraint limits in debug. - -.. data:: DBG_FASTWIREFRAME - - Draw a fast wireframe in debug. - - -Create Constraint Constants -^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Constraint type to be used with :func:`createConstraint`. - - -.. data:: POINTTOPOINT_CONSTRAINT - - .. to do - -.. data:: LINEHINGE_CONSTRAINT - - .. to do - -.. data:: ANGULAR_CONSTRAINT - - .. to do - -.. data:: CONETWIST_CONSTRAINT - - .. to do - -.. data:: VEHICLE_CONSTRAINT - - .. to do - -.. data:: GENERIC_6DOF_CONSTRAINT - - .. to do diff --git a/doc/python_api/rst/bge.events.rst b/doc/python_api/rst/bge.events.rst deleted file mode 100644 index 42135926fda..00000000000 --- a/doc/python_api/rst/bge.events.rst +++ /dev/null @@ -1,250 +0,0 @@ - -Game Keys (bge.events) -====================== - -***** -Intro -***** - -This module holds key constants for the SCA_KeyboardSensor. - -.. module:: bge.events - -.. code-block:: python - - # Set a connected keyboard sensor to accept F1 - import bge - - co = bge.logic.getCurrentController() - # 'Keyboard' is a keyboard sensor - sensor = co.sensors["Keyboard"] - sensor.key = bge.events.F1KEY - - code-block:: python - - # Do the all keys thing - import bge - - co = bge.logic.getCurrentController() - # 'Keyboard' is a keyboard sensor - sensor = co.sensors["Keyboard"] - - for key,status in sensor.events: - # key[0] == bge.events.keycode, key[1] = status - if status == bge.logic.KX_INPUT_JUST_ACTIVATED: - if key == bge.events.WKEY: - # Activate Forward! - if key == bge.events.SKEY: - # Activate Backward! - if key == bge.events.AKEY: - # Activate Left! - if key == bge.events.DKEY: - # Activate Right! - - code-block:: python - - # The all keys thing without a keyboard sensor (but you will - # need an always sensor with pulse mode on) - import bge - - # Just shortening names here - keyboard = bge.logic.keyboard - JUST_ACTIVATED = bge.logic.KX_INPUT_JUST_ACTIVATED - - if keyboard.events[bge.events.WKEY] == JUST_ACTIVATED: - print("Activate Forward!") - if keyboard.events[bge.events.SKEY] == JUST_ACTIVATED: - print("Activate Backward!") - if keyboard.events[bge.events.AKEY] == JUST_ACTIVATED: - print("Activate Left!") - if keyboard.events[bge.events.DKEY] == JUST_ACTIVATED: - print("Activate Right!") - - -********* -Functions -********* - -.. function:: EventToString(event) - - Return the string name of a key event. Will raise a ValueError error if its invalid. - - :arg event: key event constant from :mod:`bge.events` or the keyboard sensor. - :type event: int - :rtype: string - -.. function:: EventToCharacter(event, shift) - - Return the string name of a key event. Returns an empty string if the event cant be represented as a character. - - :type event: int - :arg event: key event constant from :mod:`bge.events` or the keyboard sensor. - :type shift: bool - :arg shift: set to true if shift is held. - :rtype: string - -**************** -Keys (Constants) -**************** - -.. _mouse-keys: - -========== -Mouse Keys -========== - -.. data:: LEFTMOUSE -.. data:: MIDDLEMOUSE -.. data:: RIGHTMOUSE -.. data:: WHEELUPMOUSE -.. data:: WHEELDOWNMOUSE -.. data:: MOUSEX -.. data:: MOUSEY - -.. _keyboard-keys: - -============= -Keyboard Keys -============= - -------------- -Alphabet keys -------------- - -.. data:: AKEY -.. data:: BKEY -.. data:: CKEY -.. data:: DKEY -.. data:: EKEY -.. data:: FKEY -.. data:: GKEY -.. data:: HKEY -.. data:: IKEY -.. data:: JKEY -.. data:: KKEY -.. data:: LKEY -.. data:: MKEY -.. data:: NKEY -.. data:: OKEY -.. data:: PKEY -.. data:: QKEY -.. data:: RKEY -.. data:: SKEY -.. data:: TKEY -.. data:: UKEY -.. data:: VKEY -.. data:: WKEY -.. data:: XKEY -.. data:: YKEY -.. data:: ZKEY - ------------ -Number keys ------------ - -.. data:: ZEROKEY -.. data:: ONEKEY -.. data:: TWOKEY -.. data:: THREEKEY -.. data:: FOURKEY -.. data:: FIVEKEY -.. data:: SIXKEY -.. data:: SEVENKEY -.. data:: EIGHTKEY -.. data:: NINEKEY - --------------- -Modifiers Keys --------------- - -.. data:: CAPSLOCKKEY -.. data:: LEFTCTRLKEY -.. data:: LEFTALTKEY -.. data:: RIGHTALTKEY -.. data:: RIGHTCTRLKEY -.. data:: RIGHTSHIFTKEY -.. data:: LEFTSHIFTKEY - ----------- -Arrow Keys ----------- - -.. data:: LEFTARROWKEY -.. data:: DOWNARROWKEY -.. data:: RIGHTARROWKEY -.. data:: UPARROWKEY - --------------- -Numberpad Keys --------------- - -.. data:: PAD0 -.. data:: PAD1 -.. data:: PAD2 -.. data:: PAD3 -.. data:: PAD4 -.. data:: PAD5 -.. data:: PAD6 -.. data:: PAD7 -.. data:: PAD8 -.. data:: PAD9 -.. data:: PADPERIOD -.. data:: PADSLASHKEY -.. data:: PADASTERKEY -.. data:: PADMINUS -.. data:: PADENTER -.. data:: PADPLUSKEY - -------------- -Function Keys -------------- - -.. data:: F1KEY -.. data:: F2KEY -.. data:: F3KEY -.. data:: F4KEY -.. data:: F5KEY -.. data:: F6KEY -.. data:: F7KEY -.. data:: F8KEY -.. data:: F9KEY -.. data:: F10KEY -.. data:: F11KEY -.. data:: F12KEY -.. data:: F13KEY -.. data:: F14KEY -.. data:: F15KEY -.. data:: F16KEY -.. data:: F17KEY -.. data:: F18KEY -.. data:: F19KEY - ----------- -Other Keys ----------- - -.. data:: ACCENTGRAVEKEY -.. data:: BACKSLASHKEY -.. data:: BACKSPACEKEY -.. data:: COMMAKEY -.. data:: DELKEY -.. data:: ENDKEY -.. data:: EQUALKEY -.. data:: ESCKEY -.. data:: HOMEKEY -.. data:: INSERTKEY -.. data:: LEFTBRACKETKEY -.. data:: LINEFEEDKEY -.. data:: MINUSKEY -.. data:: PAGEDOWNKEY -.. data:: PAGEUPKEY -.. data:: PAUSEKEY -.. data:: PERIODKEY -.. data:: QUOTEKEY -.. data:: RIGHTBRACKETKEY -.. data:: RETKEY (Deprecated: use bge.events.ENTERKEY) -.. data:: ENTERKEY -.. data:: SEMICOLONKEY -.. data:: SLASHKEY -.. data:: SPACEKEY -.. data:: TABKEY diff --git a/doc/python_api/rst/bge.logic.rst b/doc/python_api/rst/bge.logic.rst deleted file mode 100644 index 5cdb8ebfee9..00000000000 --- a/doc/python_api/rst/bge.logic.rst +++ /dev/null @@ -1,1407 +0,0 @@ - -Game Logic (bge.logic) -====================== - -************ -Introduction -************ - -Module to access logic functions, imported automatically into the python controllers namespace. - -.. module:: bge.logic - -.. code-block:: python - - # To get the controller thats running this python script: - cont = bge.logic.getCurrentController() # bge.logic is automatically imported - - # To get the game object this controller is on: - obj = cont.owner - -:class:`~bge.types.KX_GameObject` and :class:`~bge.types.KX_Camera` or :class:`~bge.types.KX_LightObject` methods are available depending on the type of object - -.. code-block:: python - - # To get a sensor linked to this controller. - # "sensorname" is the name of the sensor as defined in the Blender interface. - # +---------------------+ +--------+ - # | Sensor "sensorname" +--+ Python + - # +---------------------+ +--------+ - sens = cont.sensors["sensorname"] - - # To get a sequence of all sensors: - sensors = co.sensors - -See the sensor's reference for available methods: - -.. hlist:: - :columns: 3 - - * :class:`~bge.types.KX_MouseFocusSensor` - * :class:`~bge.types.KX_NearSensor` - * :class:`~bge.types.KX_NetworkMessageSensor` - * :class:`~bge.types.KX_RadarSensor` - * :class:`~bge.types.KX_RaySensor` - * :class:`~bge.types.KX_TouchSensor` - * :class:`~bge.types.SCA_DelaySensor` - * :class:`~bge.types.SCA_JoystickSensor` - * :class:`~bge.types.SCA_KeyboardSensor` - * :class:`~bge.types.SCA_MouseSensor` - * :class:`~bge.types.SCA_PropertySensor` - * :class:`~bge.types.SCA_RandomSensor` - -You can also access actuators linked to the controller - -.. code-block:: python - - # To get an actuator attached to the controller: - # +--------+ +-------------------------+ - # + Python +--+ Actuator "actuatorname" | - # +--------+ +-------------------------+ - actuator = co.actuators["actuatorname"] - - # Activate an actuator - controller.activate(actuator) - -See the actuator's reference for available methods - -.. hlist:: - :columns: 3 - - * :class:`~bge.types.BL_ActionActuator` - * :class:`~bge.types.KX_CameraActuator` - * :class:`~bge.types.KX_ConstraintActuator` - * :class:`~bge.types.KX_GameActuator` - * :class:`~bge.types.KX_MouseActuator` - * :class:`~bge.types.KX_NetworkMessageActuator` - * :class:`~bge.types.KX_ObjectActuator` - * :class:`~bge.types.KX_ParentActuator` - * :class:`~bge.types.KX_SCA_AddObjectActuator` - * :class:`~bge.types.KX_SCA_DynamicActuator` - * :class:`~bge.types.KX_SCA_EndObjectActuator` - * :class:`~bge.types.KX_SCA_ReplaceMeshActuator` - * :class:`~bge.types.KX_SceneActuator` - * :class:`~bge.types.KX_SoundActuator` - * :class:`~bge.types.KX_StateActuator` - * :class:`~bge.types.KX_TrackToActuator` - * :class:`~bge.types.KX_VisibilityActuator` - * :class:`~bge.types.SCA_2DFilterActuator` - * :class:`~bge.types.SCA_PropertyActuator` - * :class:`~bge.types.SCA_RandomActuator` - -Most logic brick's methods are accessors for the properties available in the logic buttons. -Consult the logic bricks documentation for more information on how each logic brick works. - -There are also methods to access the current :class:`bge.types.KX_Scene` - -.. code-block:: python - - # Get the current scene - scene = bge.logic.getCurrentScene() - - # Get the current camera - cam = scene.active_camera - -Matricies as used by the game engine are **row major** -``matrix[row][col] = float`` - -:class:`bge.types.KX_Camera` has some examples using matrices. - -********* -Variables -********* - -.. data:: globalDict - - A dictionary that is saved between loading blend files so you can use it to store inventory and other variables you want to store between scenes and blend files. - It can also be written to a file and loaded later on with the game load/save actuators. - - .. note:: only python built in types such as int/string/bool/float/tuples/lists can be saved, GameObjects, Actuators etc will not work as expected. - -.. data:: keyboard - - The current keyboard wrapped in an :class:`~bge.types.SCA_PythonKeyboard` object. - -.. data:: mouse - - The current mouse wrapped in an :class:`~bge.types.SCA_PythonMouse` object. - -.. data:: joysticks - - A list of attached :class:`~bge.types.SCA_PythonJoystick`. - The list size is the maximum number of supported joysticks. - If no joystick is available for a given slot, the slot is set to None. - -***************** -General functions -***************** - -.. function:: getCurrentController() - - Gets the Python controller associated with this Python script. - - :rtype: :class:`bge.types.SCA_PythonController` - -.. function:: getCurrentScene() - - Gets the current Scene. - - :rtype: :class:`bge.types.KX_Scene` - -.. function:: getSceneList() - - Gets a list of the current scenes loaded in the game engine. - - :rtype: list of :class:`bge.types.KX_Scene` - - .. note:: Scenes in your blend file that have not been converted wont be in this list. This list will only contain scenes such as overlays scenes. - -.. function:: loadGlobalDict() - - Loads bge.logic.globalDict from a file. - -.. function:: saveGlobalDict() - - Saves bge.logic.globalDict to a file. - -.. function:: startGame(blend) - - Loads the blend file. - - :arg blend: The name of the blend file - :type blend: string - -.. function:: endGame() - - Ends the current game. - -.. function:: restartGame() - - Restarts the current game by reloading the .blend file (the last saved version, not what is currently running). - -.. function:: LibLoad(blend, type, data, load_actions=False, verbose=False, load_scripts=True, async=False) - - Converts the all of the datablocks of the given type from the given blend. - - :arg blend: The path to the blend file (or the name to use for the library if data is supplied) - :type blend: string - :arg type: The datablock type (currently only "Action", "Mesh" and "Scene" are supported) - :type type: string - :arg data: Binary data from a blend file (optional) - :type data: bytes - :arg load_actions: Search for and load all actions in a given Scene and not just the "active" actions (Scene type only) - :type load_actions: bool - :arg verbose: Whether or not to print debugging information (e.g., "SceneName: Scene") - :type verbose: bool - :arg load_scripts: Whether or not to load text datablocks as well (can be disabled for some extra security) - :type load_scripts: bool - :arg async: Whether or not to do the loading asynchronously (in another thread). Only the "Scene" type is currently supported for this feature. - :type async: bool - - :rtype: :class:`bge.types.KX_LibLoadStatus` - - .. note:: Asynchronously loaded libraries will not be available immediately after LibLoad() returns. Use the returned KX_LibLoadStatus to figure out when the libraries are ready. - -.. function:: LibNew(name, type, data) - - Uses existing datablock data and loads in as a new library. - - :arg name: A unique library name used for removal later - :type name: string - :arg type: The datablock type (currently only "Mesh" is supported) - :type type: string - :arg data: A list of names of the datablocks to load - :type data: list of strings - -.. function:: LibFree(name) - - Frees a library, removing all objects and meshes from the currently active scenes. - - :arg name: The name of the library to free (the name used in LibNew) - :type name: string - -.. function:: LibList() - - Returns a list of currently loaded libraries. - - :rtype: list [str] - -.. function:: addScene(name, overlay=1) - - Loads a scene into the game engine. - - .. note:: - - This function is not effective immediately, the scene is queued - and added on the next logic cycle where it will be available - from `getSceneList` - - :arg name: The name of the scene - :type name: string - :arg overlay: Overlay or underlay (optional) - :type overlay: integer - -.. function:: sendMessage(subject, body="", to="", message_from="") - - Sends a message to sensors in any active scene. - - :arg subject: The subject of the message - :type subject: string - :arg body: The body of the message (optional) - :type body: string - :arg to: The name of the object to send the message to (optional) - :type to: string - :arg message_from: The name of the object that the message is coming from (optional) - :type message_from: string - -.. function:: setGravity(gravity) - - Sets the world gravity. - - :arg gravity: gravity vector - :type gravity: Vector((fx, fy, fz)) - -.. function:: getSpectrum() - - Returns a 512 point list from the sound card. - This only works if the fmod sound driver is being used. - - :rtype: list [float], len(getSpectrum()) == 512 - -.. function:: getMaxLogicFrame() - - Gets the maximum number of logic frames per render frame. - - :return: The maximum number of logic frames per render frame - :rtype: integer - -.. function:: setMaxLogicFrame(maxlogic) - - Sets the maximum number of logic frames that are executed per render frame. - This does not affect the physic system that still runs at full frame rate. - - :arg maxlogic: The new maximum number of logic frames per render frame. Valid values: 1..5 - :type maxlogic: integer - -.. function:: getMaxPhysicsFrame() - - Gets the maximum number of physics frames per render frame. - - :return: The maximum number of physics frames per render frame - :rtype: integer - -.. function:: setMaxPhysicsFrame(maxphysics) - - Sets the maximum number of physics timestep that are executed per render frame. - Higher value allows physics to keep up with realtime even if graphics slows down the game. - Physics timestep is fixed and equal to 1/tickrate (see setLogicTicRate) - maxphysics/ticrate is the maximum delay of the renderer that physics can compensate. - - :arg maxphysics: The new maximum number of physics timestep per render frame. Valid values: 1..5. - :type maxphysics: integer - -.. function:: getLogicTicRate() - - Gets the logic update frequency. - - :return: The logic frequency in Hz - :rtype: float - -.. function:: setLogicTicRate(ticrate) - - Sets the logic update frequency. - - The logic update frequency is the number of times logic bricks are executed every second. - The default is 60 Hz. - - :arg ticrate: The new logic update frequency (in Hz). - :type ticrate: float - -.. function:: getPhysicsTicRate() - - Gets the physics update frequency - - :return: The physics update frequency in Hz - :rtype: float - - .. warning: Not implimented yet - -.. function:: setPhysicsTicRate(ticrate) - - Sets the physics update frequency - - The physics update frequency is the number of times the physics system is executed every second. - The default is 60 Hz. - - :arg ticrate: The new update frequency (in Hz). - :type ticrate: float - - .. warning: Not implimented yet - -.. function:: getAnimRecordFrame() - - Gets the current frame number used for recording animations. This - number is incremented automatically by Blender when the "Record - animation" feature is turned on. - - :rtype: int - -.. function:: setAnimRecordFrame(framenr) - - Sets the current frame number used for recording animations. This - number is automatically incremented by Blender when the "Record - animation" feature is turned on. - - The frame number Must be non-negative, unless Blender has - :attr:`bpy.types.UserPreferencesEdit.use_negative_frames` enabled - in its user preferences. Only use non-negative numbers to be on - the safe side, unless you know what you are doing. - - :arg framenr: The new frame number. - :type framenr: int - -.. function:: getExitKey() - - Gets the key used to exit the game engine - - :return: The key (defaults to :mod:`bge.events.ESCKEY`) - :rtype: int - -.. function:: setExitKey(key) - - Sets the key used to exit the game engine - - :arg key: A key constant from :mod:`bge.events` - :type key: int - -.. function:: NextFrame() - - Render next frame (if Python has control) - -.. function:: setRender(render) - - Sets the global flag that controls the render of the scene. - If True, the render is done after the logic frame. - If False, the render is skipped and another logic frame starts immediately. - - .. note:: - - GPU VSync no longer limits the number of frame per second when render is off, - but the *Use Frame Rate* option still regulates the fps. To run as many frames - as possible, untick this option (Render Properties, System panel). - - :arg render: the render flag - :type render: bool - -.. function:: getRender() - - Get the current value of the global render flag - - :return: The flag value - :rtype: bool - -********************** -Time related functions -********************** - -.. function:: getClockTime() - - Get the current BGE render time, in seconds. The BGE render time is the - simulation time corresponding to the next scene that will be rendered. - - :rtype: double - -.. function:: getFrameTime() - - Get the current BGE frame time, in seconds. The BGE frame time is the - simulation time corresponding to the current call of the logic system. - Generally speaking, it is what the user is interested in. - - :rtype: double - -.. function:: getRealTime() - - Get the number of real (system-clock) seconds elapsed since the beginning - of the simulation. - - :rtype: double - -.. function:: getTimeScale() - - Get the time multiplier between real-time and simulation time. The default - value is 1.0. A value greater than 1.0 means that the simulation is going - faster than real-time, a value lower than 1.0 means that the simulation is - going slower than real-time. - - :rtype: double - -.. function:: setTimeScale(time_scale) - - Set the time multiplier between real-time and simulation time. A value - greater than 1.0 means that the simulation is going faster than real-time, - a value lower than 1.0 means that the simulation is going slower than - real-time. Note that a too large value may lead to some physics - instabilities. - - :arg time_scale: The new time multiplier. - -.. function:: getUseExternalClock() - - Get if the BGE use the inner BGE clock, or rely or on an external - clock. The default is to use the inner BGE clock. - - :rtype: bool - -.. function:: setUseExternalClock(use_external_clock) - - Set if the BGE use the inner BGE clock, or rely or on an external - clock. If the user selects the use of an external clock, he should call - regularly the setClockTime method. - - :arg use_external_clock: the new setting - -.. function:: setClockTime(new_time) - - Set the next value of the simulation clock. It is preferable to use this - method from a custom main function in python, as calling it in the logic - block can easily lead to a blocked system (if the time does not advance - enough to run at least the next logic step). - - :arg new_time: the next value of the BGE clock (in second). - - -***************** -Utility functions -***************** - -.. function:: expandPath(path) - - Converts a blender internal path into a proper file system path. - - Use / as directory separator in path - You can use '//' at the start of the string to define a relative path; - Blender replaces that string by the directory of the current .blend or runtime file - to make a full path name. The function also converts the directory separator to - the local file system format. - - :arg path: The path string to be converted/expanded. - :type path: string - :return: The converted string - :rtype: string - -.. function:: getAverageFrameRate() - - Gets the estimated/average framerate for all the active scenes, not only the current scene. - - :return: The estimated average framerate in frames per second - :rtype: float - -.. function:: getBlendFileList(path = "//") - - Returns a list of blend files in the same directory as the open blend file, or from using the option argument. - - :arg path: Optional directory argument, will be expanded (like expandPath) into the full path. - :type path: string - :return: A list of filenames, with no directory prefix - :rtype: list - -.. function:: getRandomFloat() - - Returns a random floating point value in the range [0 - 1) - -.. function:: PrintGLInfo() - - Prints GL Extension Info into the console - -.. function:: PrintMemInfo() - - Prints engine statistics into the console - -.. function:: getProfileInfo() - - Returns a Python dictionary that contains the same information as the on screen profiler. The keys are the profiler categories and the values are tuples with the first element being time taken (in ms) and the second element being the percentage of total time. - -********* -Constants -********* - -.. data:: KX_TRUE - - True value used by some modules. - -.. data:: KX_FALSE - - False value used by some modules. - -======= -Sensors -======= - -.. _sensor-status: - -------------- -Sensor Status -------------- - -.. data:: KX_SENSOR_INACTIVE -.. data:: KX_SENSOR_JUST_ACTIVATED -.. data:: KX_SENSOR_ACTIVE -.. data:: KX_SENSOR_JUST_DEACTIVATED - ---------------- -Armature Sensor ---------------- - -.. _armaturesensor-type: - -See :class:`bge.types.KX_ArmatureSensor.type` - -.. data:: KX_ARMSENSOR_STATE_CHANGED - - Detect that the constraint is changing state (active/inactive) - - :value: 0 - -.. data:: KX_ARMSENSOR_LIN_ERROR_BELOW - - Detect that the constraint linear error is above a threshold - - :value: 1 - -.. data:: KX_ARMSENSOR_LIN_ERROR_ABOVE - - Detect that the constraint linear error is below a threshold - - :value: 2 - -.. data:: KX_ARMSENSOR_ROT_ERROR_BELOW - - Detect that the constraint rotation error is above a threshold - - :value: 3 - -.. data:: KX_ARMSENSOR_ROT_ERROR_ABOVE - - Detect that the constraint rotation error is below a threshold - - :value: 4 - - -.. _logic-property-sensor: - ---------------- -Property Sensor ---------------- - -.. data:: KX_PROPSENSOR_EQUAL - - Activate when the property is equal to the sensor value. - - :value: 1 - -.. data:: KX_PROPSENSOR_NOTEQUAL - - Activate when the property is not equal to the sensor value. - - :value: 2 - -.. data:: KX_PROPSENSOR_INTERVAL - - Activate when the property is between the specified limits. - - :value: 3 - -.. data:: KX_PROPSENSOR_CHANGED - - Activate when the property changes - - :value: 4 - -.. data:: KX_PROPSENSOR_EXPRESSION - - Activate when the expression matches - - :value: 5 - -.. data:: KX_PROPSENSOR_LESSTHAN - - Activate when the property is less than the sensor value - - :value: 6 - -.. data:: KX_PROPSENSOR_GREATERTHAN - - Activate when the property is greater than the sensor value - - :value: 7 - ------------- -Radar Sensor ------------- - -See :class:`bge.types.KX_RadarSensor` - -.. data:: KX_RADAR_AXIS_POS_X -.. data:: KX_RADAR_AXIS_POS_Y -.. data:: KX_RADAR_AXIS_POS_Z -.. data:: KX_RADAR_AXIS_NEG_X -.. data:: KX_RADAR_AXIS_NEG_Y -.. data:: KX_RADAR_AXIS_NEG_Z - ----------- -Ray Sensor ----------- - -See :class:`bge.types.KX_RaySensor` - -.. data:: KX_RAY_AXIS_POS_X -.. data:: KX_RAY_AXIS_POS_Y -.. data:: KX_RAY_AXIS_POS_Z -.. data:: KX_RAY_AXIS_NEG_X -.. data:: KX_RAY_AXIS_NEG_Y -.. data:: KX_RAY_AXIS_NEG_Z - - -========= -Actuators -========= - -.. _action-actuator: - ---------------- -Action Actuator ---------------- - -See :class:`bge.types.BL_ActionActuator` - -.. data:: KX_ACTIONACT_PLAY -.. data:: KX_ACTIONACT_PINGPONG -.. data:: KX_ACTIONACT_FLIPPER -.. data:: KX_ACTIONACT_LOOPSTOP -.. data:: KX_ACTIONACT_LOOPEND -.. data:: KX_ACTIONACT_PROPERTY - ------------------ -Armature Actuator ------------------ - - .. _armatureactuator-constants-type: - -See :class:`bge.types.BL_ArmatureActuator.type` - -.. data:: KX_ACT_ARMATURE_RUN - - Just make sure the armature will be updated on the next graphic frame. - This is the only persistent mode of the actuator: - it executes automatically once per frame until stopped by a controller - - :value: 0 - -.. data:: KX_ACT_ARMATURE_ENABLE - - Enable the constraint. - - :value: 1 - -.. data:: KX_ACT_ARMATURE_DISABLE - - Disable the constraint (runtime constraint values are not updated). - - :value: 2 - -.. data:: KX_ACT_ARMATURE_SETTARGET - - Change target and subtarget of constraint. - - :value: 3 - -.. data:: KX_ACT_ARMATURE_SETWEIGHT - - Change weight of constraint (IK only). - - :value: 4 - -.. data:: KX_ACT_ARMATURE_SETINFLUENCE - - Change influence of constraint. - - :value: 5 - -------------------- -Constraint Actuator -------------------- - -.. _constraint-actuator-option: - -See :class:`bge.types.KX_ConstraintActuator.option` - -* Applicable to Distance constraint: - -.. data:: KX_CONSTRAINTACT_NORMAL - - Activate alignment to surface - -.. data:: KX_CONSTRAINTACT_DISTANCE - - Activate distance control - -.. data:: KX_CONSTRAINTACT_LOCAL - - Direction of the ray is along the local axis - -* Applicable to Force field constraint: - -.. data:: KX_CONSTRAINTACT_DOROTFH - - Force field act on rotation as well - -* Applicable to both: - -.. data:: KX_CONSTRAINTACT_MATERIAL - - Detect material rather than property - -.. data:: KX_CONSTRAINTACT_PERMANENT - - No deactivation if ray does not hit target - -.. _constraint-actuator-limit: - -See :class:`bge.types.KX_ConstraintActuator.limit` - -.. data:: KX_CONSTRAINTACT_LOCX - - Limit X coord. - -.. data:: KX_CONSTRAINTACT_LOCY - - Limit Y coord - -.. data:: KX_CONSTRAINTACT_LOCZ - - Limit Z coord - -.. data:: KX_CONSTRAINTACT_ROTX - - Limit X rotation - -.. data:: KX_CONSTRAINTACT_ROTY - - Limit Y rotation - -.. data:: KX_CONSTRAINTACT_ROTZ - - Limit Z rotation - -.. data:: KX_CONSTRAINTACT_DIRNX - - Set distance along negative X axis - -.. data:: KX_CONSTRAINTACT_DIRNY - - Set distance along negative Y axis - -.. data:: KX_CONSTRAINTACT_DIRNZ - - Set distance along negative Z axis - -.. data:: KX_CONSTRAINTACT_DIRPX - - Set distance along positive X axis - -.. data:: KX_CONSTRAINTACT_DIRPY - - Set distance along positive Y axis - -.. data:: KX_CONSTRAINTACT_DIRPZ - - Set distance along positive Z axis - -.. data:: KX_CONSTRAINTACT_ORIX - - Set orientation of X axis - -.. data:: KX_CONSTRAINTACT_ORIY - - Set orientation of Y axis - -.. data:: KX_CONSTRAINTACT_ORIZ - - Set orientation of Z axis - -.. data:: KX_CONSTRAINTACT_FHNX - - Set force field along negative X axis - -.. data:: KX_CONSTRAINTACT_FHNY - - Set force field along negative Y axis - -.. data:: KX_CONSTRAINTACT_FHNZ - - Set force field along negative Z axis - -.. data:: KX_CONSTRAINTACT_FHPX - - Set force field along positive X axis - -.. data:: KX_CONSTRAINTACT_FHPY - - Set force field along positive Y axis - -.. data:: KX_CONSTRAINTACT_FHPZ - - Set force field along positive Z axis - ----------------- -Dynamic Actuator ----------------- - -See :class:`bge.types.KX_SCA_DynamicActuator` - -.. data:: KX_DYN_RESTORE_DYNAMICS -.. data:: KX_DYN_DISABLE_DYNAMICS -.. data:: KX_DYN_ENABLE_RIGID_BODY -.. data:: KX_DYN_DISABLE_RIGID_BODY -.. data:: KX_DYN_SET_MASS - -.. _game-actuator: - -------------- -Game Actuator -------------- - -See :class:`bge.types.KX_GameActuator` - -.. data:: KX_GAME_LOAD -.. data:: KX_GAME_START -.. data:: KX_GAME_RESTART -.. data:: KX_GAME_QUIT -.. data:: KX_GAME_SAVECFG -.. data:: KX_GAME_LOADCFG - -.. _mouse-actuator: - ---------------- -Mouse Actuator ---------------- - -.. data:: KX_ACT_MOUSE_OBJECT_AXIS_X -.. data:: KX_ACT_MOUSE_OBJECT_AXIS_Y -.. data:: KX_ACT_MOUSE_OBJECT_AXIS_Z - ---------------- -Parent Actuator ---------------- - -.. data:: KX_PARENT_REMOVE -.. data:: KX_PARENT_SET - -.. _logic-random-distributions: - --------------------- -Random Distributions --------------------- - -See :class:`bge.types.SCA_RandomActuator` - -.. data:: KX_RANDOMACT_BOOL_CONST -.. data:: KX_RANDOMACT_BOOL_UNIFORM -.. data:: KX_RANDOMACT_BOOL_BERNOUILLI -.. data:: KX_RANDOMACT_INT_CONST -.. data:: KX_RANDOMACT_INT_UNIFORM -.. data:: KX_RANDOMACT_INT_POISSON -.. data:: KX_RANDOMACT_FLOAT_CONST -.. data:: KX_RANDOMACT_FLOAT_UNIFORM -.. data:: KX_RANDOMACT_FLOAT_NORMAL -.. data:: KX_RANDOMACT_FLOAT_NEGATIVE_EXPONENTIAL - --------------- -Scene Actuator --------------- - -See :class:`bge.types.KX_SceneActuator` - -.. data:: KX_SCENE_RESTART -.. data:: KX_SCENE_SET_SCENE -.. data:: KX_SCENE_SET_CAMERA -.. data:: KX_SCENE_ADD_FRONT_SCENE -.. data:: KX_SCENE_ADD_BACK_SCENE -.. data:: KX_SCENE_REMOVE_SCENE -.. data:: KX_SCENE_SUSPEND -.. data:: KX_SCENE_RESUME - -.. _logic-sound-actuator: - --------------- -Sound Actuator --------------- - -See :class:`bge.types.KX_SoundActuator` - -.. data:: KX_SOUNDACT_PLAYSTOP - - :value: 1 - -.. data:: KX_SOUNDACT_PLAYEND - - :value: 2 - -.. data:: KX_SOUNDACT_LOOPSTOP - - :value: 3 - -.. data:: KX_SOUNDACT_LOOPEND - - :value: 4 - -.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL - - :value: 5 - -.. data:: KX_SOUNDACT_LOOPBIDIRECTIONAL_STOP - - :value: 6 - ------------------ -Steering Actuator ------------------ - -.. _logic-steering-actuator: - -See :class:`bge.types.KX_SteeringActuator.behavior` - -.. data:: KX_STEERING_SEEK - - :value: 1 - -.. data:: KX_STEERING_FLEE - - :value: 2 - -.. data:: KX_STEERING_PATHFOLLOWING - - :value: 3 - -.. _logic-trackto-actuator: - ------------------ -TrackTo Actuator ------------------ - -See :class:`bge.types.KX_TrackToActuator` - -.. data:: KX_TRACK_UPAXIS_POS_X -.. data:: KX_TRACK_UPAXIS_POS_Y -.. data:: KX_TRACK_UPAXIS_POS_Z -.. data:: KX_TRACK_TRAXIS_POS_X -.. data:: KX_TRACK_TRAXIS_POS_Y -.. data:: KX_TRACK_TRAXIS_POS_Z -.. data:: KX_TRACK_TRAXIS_NEG_X -.. data:: KX_TRACK_TRAXIS_NEG_Y -.. data:: KX_TRACK_TRAXIS_NEG_Z - -======= -Various -======= - ---------- -2D Filter ---------- - -.. _Two-D-FilterActuator-mode: - -.. data:: RAS_2DFILTER_BLUR - - :value: 2 - -.. data:: RAS_2DFILTER_CUSTOMFILTER - - Customer filter, the code code is set via shaderText property. - - :value: 12 - -.. data:: RAS_2DFILTER_DILATION - - :value: 4 - -.. data:: RAS_2DFILTER_DISABLED - - Disable the filter that is currently active - - :value: -1 - -.. data:: RAS_2DFILTER_ENABLED - - Enable the filter that was previously disabled - - :value: -2 - -.. data:: RAS_2DFILTER_EROSION - - :value: 5 - -.. data:: RAS_2DFILTER_GRAYSCALE - - :value: 9 - -.. data:: RAS_2DFILTER_INVERT - - :value: 11 - -.. data:: RAS_2DFILTER_LAPLACIAN - - :value: 6 - -.. data:: RAS_2DFILTER_MOTIONBLUR - - Create and enable preset filters - - :value: 1 - -.. data:: RAS_2DFILTER_NOFILTER - - Disable and destroy the filter that is currently active - - :value: 0 - -.. data:: RAS_2DFILTER_PREWITT - - :value: 8 - -.. data:: RAS_2DFILTER_SEPIA - - :value: 10 - -.. data:: RAS_2DFILTER_SHARPEN - - :value: 3 - -.. data:: RAS_2DFILTER_SOBEL - - :value: 7 - ----------------- -Armature Channel ----------------- -.. _armaturechannel-constants-rotation-mode: - -See :class:`bge.types.BL_ArmatureChannel.rotation_mode` - -.. note: - euler mode are named as in Blender UI but the actual axis order is reversed - -.. data:: ROT_MODE_QUAT - - Use quaternion in rotation attribute to update bone rotation. - - :value: 0 - -.. data:: ROT_MODE_XYZ - - Use euler_rotation and apply angles on bone's Z, Y, X axis successively. - - :value: 1 - -.. data:: ROT_MODE_XZY - - Use euler_rotation and apply angles on bone's Y, Z, X axis successively. - - :value: 2 - -.. data:: ROT_MODE_YXZ - - Use euler_rotation and apply angles on bone's Z, X, Y axis successively. - - :value: 3 - -.. data:: ROT_MODE_YZX - - Use euler_rotation and apply angles on bone's X, Z, Y axis successively. - - :value: 4 - -.. data:: ROT_MODE_ZXY - - Use euler_rotation and apply angles on bone's Y, X, Z axis successively. - - :value: 5 - -.. data:: ROT_MODE_ZYX - - Use euler_rotation and apply angles on bone's X, Y, Z axis successively. - - :value: 6 - - -------------------- -Armature Constraint -------------------- -.. _armatureconstraint-constants-type: - -See :class:`bge.types.BL_ArmatureConstraint.type` - -.. data:: CONSTRAINT_TYPE_TRACKTO -.. data:: CONSTRAINT_TYPE_KINEMATIC -.. data:: CONSTRAINT_TYPE_ROTLIKE -.. data:: CONSTRAINT_TYPE_LOCLIKE -.. data:: CONSTRAINT_TYPE_MINMAX -.. data:: CONSTRAINT_TYPE_SIZELIKE -.. data:: CONSTRAINT_TYPE_LOCKTRACK -.. data:: CONSTRAINT_TYPE_STRETCHTO -.. data:: CONSTRAINT_TYPE_CLAMPTO -.. data:: CONSTRAINT_TYPE_TRANSFORM -.. data:: CONSTRAINT_TYPE_DISTLIMIT - -.. _armatureconstraint-constants-ik-type: - -See :class:`bge.types.BL_ArmatureConstraint.ik_type` - -.. data:: CONSTRAINT_IK_COPYPOSE - - constraint is trying to match the position and eventually the rotation of the target. - - :value: 0 - -.. data:: CONSTRAINT_IK_DISTANCE - - Constraint is maintaining a certain distance to target subject to ik_mode - - :value: 1 - -.. _armatureconstraint-constants-ik-flag: - -See :class:`bge.types.BL_ArmatureConstraint.ik_flag` - -.. data:: CONSTRAINT_IK_FLAG_TIP - - Set when the constraint operates on the head of the bone and not the tail - - :value: 1 - -.. data:: CONSTRAINT_IK_FLAG_ROT - - Set when the constraint tries to match the orientation of the target - - :value: 2 - -.. data:: CONSTRAINT_IK_FLAG_STRETCH - - Set when the armature is allowed to stretch (only the bones with stretch factor > 0.0) - - :value: 16 - -.. data:: CONSTRAINT_IK_FLAG_POS - - Set when the constraint tries to match the position of the target. - - :value: 32 - -.. _armatureconstraint-constants-ik-mode: - -See :class:`bge.types.BL_ArmatureConstraint.ik_mode` - -.. data:: CONSTRAINT_IK_MODE_INSIDE - - The constraint tries to keep the bone within ik_dist of target - - :value: 0 - -.. data:: CONSTRAINT_IK_MODE_OUTSIDE - - The constraint tries to keep the bone outside ik_dist of the target - - :value: 1 - -.. data:: CONSTRAINT_IK_MODE_ONSURFACE - - The constraint tries to keep the bone exactly at ik_dist of the target. - - :value: 2 - -.. _input-status: - ----------------- -Blender Material ----------------- - -.. data:: BL_DST_ALPHA -.. data:: BL_DST_COLOR -.. data:: BL_ONE -.. data:: BL_ONE_MINUS_DST_ALPHA -.. data:: BL_ONE_MINUS_DST_COLOR -.. data:: BL_ONE_MINUS_SRC_ALPHA -.. data:: BL_ONE_MINUS_SRC_COLOR -.. data:: BL_SRC_ALPHA -.. data:: BL_SRC_ALPHA_SATURATE -.. data:: BL_SRC_COLOR -.. data:: BL_ZERO - ------------- -Input Status ------------- - -See :class:`bge.types.SCA_PythonKeyboard`, :class:`bge.types.SCA_PythonMouse`, :class:`bge.types.SCA_MouseSensor`, :class:`bge.types.SCA_KeyboardSensor` - -.. data:: KX_INPUT_NONE -.. data:: KX_INPUT_JUST_ACTIVATED -.. data:: KX_INPUT_ACTIVE -.. data:: KX_INPUT_JUST_RELEASED - -------------- -KX_GameObject -------------- -.. _gameobject-playaction-mode: - -See :class:`bge.types.KX_GameObject.playAction` - -.. data:: KX_ACTION_MODE_PLAY - - Play the action once. - - :value: 0 - -.. data:: KX_ACTION_MODE_LOOP - - Loop the action (repeat it). - - :value: 1 - -.. data:: KX_ACTION_MODE_PING_PONG - - Play the action one direct then back the other way when it has completed. - - :value: 2 - -.. _gameobject-playaction-blend: - -.. data:: KX_ACTION_BLEND_BLEND - - Blend layers using linear interpolation - - :value: 0 - -.. data:: KX_ACTION_BLEND_ADD - - Adds the layers together - - :value: 1 - -------------- -Mouse Buttons -------------- - -See :class:`bge.types.SCA_MouseSensor` - -.. data:: KX_MOUSE_BUT_LEFT -.. data:: KX_MOUSE_BUT_MIDDLE -.. data:: KX_MOUSE_BUT_RIGHT - --------------------------- -Navigation Mesh Draw Modes --------------------------- - -.. _navmesh-draw-mode: - -.. data:: RM_WALLS - - Draw only the walls. - -.. data:: RM_POLYS - - Draw only polygons. - -.. data:: RM_TRIS - - Draw triangle mesh. - ------- -Shader ------- - -.. data:: VIEWMATRIX -.. data:: VIEWMATRIX_INVERSE -.. data:: VIEWMATRIX_INVERSETRANSPOSE -.. data:: VIEWMATRIX_TRANSPOSE -.. data:: MODELMATRIX -.. data:: MODELMATRIX_INVERSE -.. data:: MODELMATRIX_INVERSETRANSPOSE -.. data:: MODELMATRIX_TRANSPOSE -.. data:: MODELVIEWMATRIX -.. data:: MODELVIEWMATRIX_INVERSE -.. data:: MODELVIEWMATRIX_INVERSETRANSPOSE -.. data:: MODELVIEWMATRIX_TRANSPOSE -.. data:: CAM_POS - - Current camera position - -.. data:: CONSTANT_TIMER - - User a timer for the uniform value. - -.. data:: SHD_TANGENT - ------- -States ------- - -See :class:`bge.types.KX_StateActuator` - -.. data:: KX_STATE1 -.. data:: KX_STATE2 -.. data:: KX_STATE3 -.. data:: KX_STATE4 -.. data:: KX_STATE5 -.. data:: KX_STATE6 -.. data:: KX_STATE7 -.. data:: KX_STATE8 -.. data:: KX_STATE9 -.. data:: KX_STATE10 -.. data:: KX_STATE11 -.. data:: KX_STATE12 -.. data:: KX_STATE13 -.. data:: KX_STATE14 -.. data:: KX_STATE15 -.. data:: KX_STATE16 -.. data:: KX_STATE17 -.. data:: KX_STATE18 -.. data:: KX_STATE19 -.. data:: KX_STATE20 -.. data:: KX_STATE21 -.. data:: KX_STATE22 -.. data:: KX_STATE23 -.. data:: KX_STATE24 -.. data:: KX_STATE25 -.. data:: KX_STATE26 -.. data:: KX_STATE27 -.. data:: KX_STATE28 -.. data:: KX_STATE29 -.. data:: KX_STATE30 - -.. _state-actuator-operation: - -See :class:`bge.types.KX_StateActuator.operation` - -.. data:: KX_STATE_OP_CLR - - Substract bits to state mask - - :value: 0 - -.. data:: KX_STATE_OP_CPY - - Copy state mask - - :value: 1 - -.. data:: KX_STATE_OP_NEG - - Invert bits to state mask - - :value: 2 - -.. data:: KX_STATE_OP_SET - - Add bits to state mask - - :value: 3 diff --git a/doc/python_api/rst/bge.render.rst b/doc/python_api/rst/bge.render.rst deleted file mode 100644 index 02c3beef672..00000000000 --- a/doc/python_api/rst/bge.render.rst +++ /dev/null @@ -1,425 +0,0 @@ - -Rasterizer (bge.render) -======================= - -***** -Intro -***** - -.. module:: bge.render - -Example of using a :class:`bge.types.SCA_MouseSensor`, -and two :class:`bge.types.KX_ObjectActuator` to implement MouseLook: - -.. note:: - This can also be achieved with the :class:`bge.types.KX_MouseActuator`. - -.. code-block:: python - - # To use a mouse movement sensor "Mouse" and a - # motion actuator to mouse look: - import bge - - # scale sets the speed of motion - scale = 1.0, 0.5 - - co = bge.logic.getCurrentController() - obj = co.owner - mouse = co.sensors["Mouse"] - lmotion = co.actuators["LMove"] - wmotion = co.actuators["WMove"] - - # Transform the mouse coordinates to see how far the mouse has moved. - def mousePos(): - x = (bge.render.getWindowWidth() / 2 - mouse.position[0]) * scale[0] - y = (bge.render.getWindowHeight() / 2 - mouse.position[1]) * scale[1] - return (x, y) - - pos = mousePos() - - # Set the amount of motion: X is applied in world coordinates... - wmotion.useLocalTorque = False - wmotion.torque = ((0.0, 0.0, pos[0])) - - # ...Y is applied in local coordinates - lmotion.useLocalTorque = True - lmotion.torque = ((-pos[1], 0.0, 0.0)) - - # Activate both actuators - co.activate(lmotion) - co.activate(wmotion) - - # Centre the mouse - bge.render.setMousePosition(int(bge.render.getWindowWidth() / 2), int(bge.render.getWindowHeight() / 2)) - -********* -Constants -********* - -.. data:: KX_TEXFACE_MATERIAL - - Materials as defined by the texture face settings. - -.. data:: KX_BLENDER_MULTITEX_MATERIAL - - Materials approximating blender materials with multitexturing. - -.. data:: KX_BLENDER_GLSL_MATERIAL - - Materials approximating blender materials with GLSL. - -.. DATA:: VSYNC_OFF - - Disables vsync - -.. DATA:: VSYNC_ON - - Enables vsync - -.. DATA:: VSYNC_ADAPTIVE - - Enables adaptive vsync if supported. - Adaptive vsync enables vsync if the framerate is above the monitors refresh rate. - Otherwise, vsync is diabled if the framerate is too low. - -.. data:: LEFT_EYE - - Left eye being used during stereoscopic rendering. - -.. data:: RIGHT_EYE - - Right eye being used during stereoscopic rendering. - -.. data:: RAS_OFS_RENDER_BUFFER - - The pixel buffer for offscreen render is a RenderBuffer. Argument to :func:`offScreenCreate` - -.. data:: RAS_OFS_RENDER_TEXTURE - - The pixel buffer for offscreen render is a Texture. Argument to :func:`offScreenCreate` - - -***** -Types -***** - -.. class:: RASOffScreen - - An off-screen render buffer object. - - Use :func:`offScreenCreate` to create it. - Currently it can only be used in the :class:`bge.texture.ImageRender` - constructor to render on a FBO rather than the default viewport. - - .. attribute:: width - - The width in pixel of the FBO - - :type: integer - - .. attribute:: height - - The height in pixel of the FBO - - :type: integer - - .. attribute:: color - - The underlying OpenGL bind code of the texture object that holds - the rendered image, 0 if the FBO is using RenderBuffer. - The choice between RenderBuffer and Texture is determined - by the target argument of :func:`offScreenCreate`. - - :type: integer - - -********* -Functions -********* - -.. function:: getWindowWidth() - - Gets the width of the window (in pixels) - - :rtype: integer - -.. function:: getWindowHeight() - - Gets the height of the window (in pixels) - - :rtype: integer - -.. function:: setWindowSize(width, height) - - Set the width and height of the window (in pixels). This also works for fullscreen applications. - - .. note:: Only works in the standalone player, not the Blender-embedded player. - - :arg width: width in pixels - :type width: integer - :arg height: height in pixels - :type height: integer - -.. function:: setFullScreen(enable) - - Set whether or not the window should be fullscreen. - - .. note:: Only works in the standalone player, not the Blender-embedded player. - - :arg enable: ``True`` to set full screen, ``False`` to set windowed. - :type enable: bool - -.. function:: getFullScreen() - - Returns whether or not the window is fullscreen. - - .. note:: Only works in the standalone player, not the Blender-embedded player; there it always returns False. - - :rtype: bool - -.. function:: getDisplayDimensions() - - Get the display dimensions, in pixels, of the display (e.g., the - monitor). Can return the size of the entire view, so the - combination of all monitors; for example, ``(3840, 1080)`` for two - side-by-side 1080p monitors. - - :rtype: tuple (width, height) - -.. function:: makeScreenshot(filename) - - Writes an image file with the current displayed frame. - - The image is written to *'filename'*. - The path may be absolute (eg. ``/home/foo/image``) or relative when started with - ``//`` (eg. ``//image``). Note that absolute paths are not portable between platforms. - If the filename contains a ``#``, - it will be replaced by an incremental index so that screenshots can be taken multiple - times without overwriting the previous ones (eg. ``image-#``). - - Settings for the image are taken from the render settings (file format and respective settings, - gamma and colospace conversion, etc). - The image resolution matches the framebuffer, meaning, the window size and aspect ratio. - When running from the standalone player, instead of the embedded player, only PNG files are supported. - Additional color conversions are also not supported. - - :arg filename: path and name of the file to write - :type filename: string - - -.. function:: enableVisibility(visible) - - Deprecated; doesn't do anything. - - -.. function:: showMouse(visible) - - Enables or disables the operating system mouse cursor. - - :arg visible: - :type visible: boolean - - -.. function:: setMousePosition(x, y) - - Sets the mouse cursor position. - - :arg x: X-coordinate in screen pixel coordinates. - :type x: integer - :arg y: Y-coordinate in screen pixel coordinates. - :type y: integer - - -.. function:: setBackgroundColor(rgba) - - Deprecated and no longer functional. Use :py:meth:`bge.types.KX_WorldInfo.backgroundColor` instead. - - -.. function:: setEyeSeparation(eyesep) - - Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value. - - :arg eyesep: The distance between the left and right eye. - :type eyesep: float - - -.. function:: getEyeSeparation() - - Gets the current eye separation for stereo mode. - - :rtype: float - - -.. function:: setFocalLength(focallength) - - Sets the focal length for stereo mode. It uses the current camera focal length as initial value. - - :arg focallength: The focal length. - :type focallength: float - -.. function:: getFocalLength() - - Gets the current focal length for stereo mode. - - :rtype: float - -.. function:: getStereoEye() - - Gets the current stereoscopy eye being rendered. - This function is mainly used in a :class:`bge.types.KX_Scene.pre_draw` callback - function to customize the camera projection matrices for each - stereoscopic eye. - - :rtype: LEFT_EYE, RIGHT_EYE - -.. function:: setMaterialMode(mode) - - Set the material mode to use for OpenGL rendering. - - :arg mode: material mode - :type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL - - .. note:: Changes will only affect newly created scenes. - - -.. function:: getMaterialMode(mode) - - Get the material mode to use for OpenGL rendering. - - :rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL - - -.. function:: setGLSLMaterialSetting(setting, enable) - - Enables or disables a GLSL material setting. - - :arg setting: - :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures) - :arg enable: - :type enable: boolean - - -.. function:: getGLSLMaterialSetting(setting) - - Get the state of a GLSL material setting. - - :arg setting: - :type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures) - :rtype: boolean - -.. function:: setAnisotropicFiltering(level) - - Set the anisotropic filtering level for textures. - - :arg level: The new anisotropic filtering level to use - :type level: integer (must be one of 1, 2, 4, 8, 16) - - .. note:: Changing this value can cause all textures to be recreated, which can be slow. - -.. function:: getAnisotropicFiltering() - - Get the anisotropic filtering level used for textures. - - :rtype: integer (one of 1, 2, 4, 8, 16) - -.. function:: setMipmapping(value) - - Change how to use mipmapping. - - :type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR - - .. note:: Changing this value can cause all textures to be recreated, which can be slow. - -.. function:: getMipmapping() - - Get the current mipmapping setting. - - :rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR - -.. function:: drawLine(fromVec,toVec,color) - - Draw a line in the 3D scene. - - :arg fromVec: the origin of the line - :type fromVec: list [x, y, z] - :arg toVec: the end of the line - :type toVec: list [x, y, z] - :arg color: the color of the line - :type color: list [r, g, b] - - -.. function:: enableMotionBlur(factor) - - Enable the motion blur effect. - - :arg factor: the ammount of motion blur to display. - :type factor: float [0.0 - 1.0] - - -.. function:: disableMotionBlur() - - Disable the motion blur effect. - -.. function:: showFramerate(enable) - - Show or hide the framerate. - - :arg enable: - :type enable: boolean - -.. function:: showProfile(enable) - - Show or hide the profile. - - :arg enable: - :type enable: boolean - -.. function:: showProperties(enable) - - Show or hide the debug properties. - - :arg enable: - :type enable: boolean - -.. function:: autoDebugList(enable) - - Enable or disable auto adding debug properties to the debug list. - - :arg enable: - :type enable: boolean - -.. function:: clearDebugList() - - Clears the debug property list. - -.. function:: setVsync(value) - - Set the vsync value - - :arg value: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE - :type value: integer - -.. function:: getVsync() - - Get the current vsync value - - :rtype: One of VSYNC_OFF, VSYNC_ON, VSYNC_ADAPTIVE - -.. function:: offScreenCreate(width,height[,samples=0][,target=bge.render.RAS_OFS_RENDER_BUFFER]) - - Create a Off-screen render buffer object. - - :arg width: the width of the buffer in pixels - :type width: integer - :arg height: the height of the buffer in pixels - :type height: integer - :arg samples: the number of multisample for anti-aliasing (MSAA), 0 to disable MSAA - :type samples: integer - :arg target: the pixel storage: :data:`RAS_OFS_RENDER_BUFFER` to render on RenderBuffers (the default), - :data:`RAS_OFS_RENDER_TEXTURE` to render on texture. - The later is interesting if you want to access the texture directly (see :attr:`RASOffScreen.color`). - Otherwise the default is preferable as it's more widely supported by GPUs and more efficient. - If the GPU does not support MSAA+Texture (e.g. Intel HD GPU), MSAA will be disabled. - :type target: integer - :rtype: :class:`RASOffScreen` - diff --git a/doc/python_api/rst/bge.texture.rst b/doc/python_api/rst/bge.texture.rst deleted file mode 100644 index cd99cde0bc8..00000000000 --- a/doc/python_api/rst/bge.texture.rst +++ /dev/null @@ -1,1557 +0,0 @@ - -Video Texture (bge.texture) -=========================== - -************ -Introduction -************ - -The ``bge.texture`` module allows you to manipulate textures during the game. -Several sources for texture are possible: video files, image files, video capture, -memory buffer, camera render or a mix of that. -The video and image files can be loaded from the Internet using a URL instead of a file name. -In addition, you can apply filters on the images before sending them to the GPU, -allowing video effect: blue screen, color band, gray, normal map. -``bge.texture`` uses FFmpeg to load images and videos. -All the formats and codecs that FFmpeg supports are supported by ``bge.texture``, -including but not limited to: - -* AVI -* Ogg -* Xvid -* Theora -* dv1394 camera -* video4linux capture card (this includes many webcams) -* videoForWindows capture card (this includes many webcams) -* JPG - - -How it works ------------- - -The principle is simple: first you identify a texture on an existing object using the -:class:`~bge.texture.materialID` function, then you create a new texture with dynamic content -and swap the two textures in the GPU. - -The game engine is not aware of the substitution and continues to display the object as always, -except that you are now in control of the texture. - -When the texture object is deleted, the new texture is deleted and the old texture restored. - - -Game Preparation ----------------- - -Before you can use the :mod:`bge.texture` module, -you must have objects with textures applied appropriately. - -Imagine you want to have a television showing live broadcast programs in the game. -You will create a television object and UV-apply a different texture at the place of the screen, -for example ``tv.png``. What this texture looks like is not important; -probably you want to make it dark gray to simulate power-off state. -When the television must be turned on, you create a dynamic texture from a video capture card -and use it instead of ``tv.png``: the TV screen will come to life. - -You have two ways to define textures that ``bge.texture`` can grab: - -- Simple UV texture. -- Blender material with image texture channel. - -Because ``bge.texture`` works at texture level, it is compatible with all -the Blender Game Engine's fancy texturing features: GLSL, multi-texture, custom shaders, etc. - - -******** -Examples -******** - -.. include:: __/examples/bge.texture.py - :start-line: 1 - :end-line: 5 - -.. literalinclude:: __/examples/bge.texture.py - :lines: 7- - -.. include:: __/examples/bge.texture.1.py - :start-line: 1 - :end-line: 6 - -.. literalinclude:: __/examples/bge.texture.1.py - :lines: 8- - -.. include:: __/examples/bge.texture.2.py - :start-line: 1 - :end-line: 6 - -.. literalinclude:: __/examples/bge.texture.2.py - :lines: 8- - - -.. module:: bge.texture - -************* -Video classes -************* - -.. class:: VideoFFmpeg(file, capture=-1, rate=25.0, width=0, height=0) - - FFmpeg video source, used for video files, video captures, or video streams. - - :arg file: Path to the video to load; if capture >= 0 on Windows, this parameter will not be used. - :type file: str - :arg capture: Capture device number; if >= 0, the corresponding webcam will be used. (optional) - :type capture: int - :arg rate: Capture rate. (optional, used only if capture >= 0) - :type rate: float - :arg width: Capture width. (optional, used only if capture >= 0) - :type width: int - :arg height: Capture height. (optional, used only if capture >= 0) - :type height: int - - .. attribute:: status - - Video status. (readonly) - - :type: int - :value: see `FFmpeg Video and Image Status`_. - - .. attribute:: range - - The start and stop time of the video playback, expressed in seconds from beginning. - By default the entire video. - - :type: sequence of two floats - - .. attribute:: repeat - - Number of times to replay the video, -1 for infinite repeat. - - :type: int - - .. attribute:: framerate - - Relative frame rate, <1.0 for slow, >1.0 for fast. - - :type: float - - .. attribute:: valid - - Tells if an image is available. (readonly) - - :type: bool - - .. attribute:: image - - Image data. (readonly) - - :type: :class:`~bgl.Buffer` or None - - .. attribute:: size - - Image size. (readonly) - - :type: tuple of two ints - - .. attribute:: scale - - Set to True to activate fast nearest neighbor scaling algorithm. - Texture width and height must be a power of 2. - If the video picture size is not a power of 2, rescaling is required. - By default ``bge.texture`` uses the precise but slow ``gluScaleImage()`` function. - Best is to rescale the video offline so that no scaling is necessary at runtime! - - :type: bool - - .. attribute:: flip - - If True the imaged will be flipped vertically. - FFmpeg always delivers the image upside down, so this attribute is set to True by default. - - :type: bool - - .. attribute:: filter - - An additional filter that is applied on the video before sending it to the GPU. - - :type: one of: - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - - .. attribute:: preseek - - Number of frames of preseek. - - :type: int - - .. attribute:: deinterlace - - Deinterlace image. - - :type: bool - - .. method:: play() - - Play (restart) video. - - :return: Whether the video was ready or stopped. - :rtype: bool - - .. method:: pause() - - Pause video. - - :return: Whether the video was playing. - :rtype: bool - - .. method:: stop() - - Stop video (play will replay it from start). - - :return: Whether the video was playing. - :rtype: bool - - .. method:: refresh(buffer=None, format="RGBA", timestamp=-1.0) - - Refresh video - get its status and optionally copy the frame to an external buffer. - - :arg buffer: An optional object that implements the buffer protocol. - If specified, the image is copied to the buffer, which must be big enough or an exception is thrown. - :type buffer: any buffer type - :arg format: An optional image format specifier for the image that will be copied to the buffer. - Only valid values are "RGBA" or "BGRA" - :type format: str - :arg timestamp: An optional timestamp (in seconds from the start of the movie) - of the frame to be copied to the buffer. - :type timestamp: float - :return: see `FFmpeg Video and Image Status`_. - :rtype: int - - -************* -Image classes -************* - -.. class:: ImageFFmpeg(file) - - FFmpeg image source, used for image files and web based images. - - :arg file: Path to the image to load. - :type file: str - - .. attribute:: status - - Image status. (readonly) - - :type: int - :value: see `FFmpeg Video and Image Status`_. - - .. attribute:: valid - - Tells if an image is available. (readonly) - - :type: bool - - .. attribute:: image - - Image data. (readonly) - - :type: :class:`~bgl.Buffer` or None - - .. attribute:: size - - Image size. (readonly) - - :type: tuple of two ints - - .. attribute:: scale - - Fast scale of image (near neighbour). - - :type: bool - - .. attribute:: flip - - Flip image vertically. - - :type: bool - - .. attribute:: filter - - Pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - - .. method:: refresh(buffer=None, format="RGBA") - - Refresh image, get its status and optionally copy the frame to an external buffer. - - :arg buffer: An optional object that implements the buffer protocol. - If specified, the image is copied to the buffer, which must be big enough or an exception is thrown. - :type buffer: any buffer type - :arg format: An optional image format specifier for the image that will be copied to the buffer. - Only valid values are "RGBA" or "BGRA" - :type format: str - :return: see `FFmpeg Video and Image Status`_. - :rtype: int - - .. method:: reload(newname=None) - - Reload image, i.e. reopen it. - - :arg newname: Path to a new image. (optional) - :type newname: str - -.. class:: ImageBuff(width, height, color=0, scale=False) - - Image from application memory. - For computer generated images, drawing applications. - - :arg width: Width of the image. - :type width: int - :arg height: Height of the image. - :type height: int - :arg color: Value to initialize RGB channels with. The initialized buffer will have - all pixels set to (color, color, color, 255). (optional) - :type color: int in [0, 255] - :arg scale: Image uses scaling. (optional) - :type scale: bool - - .. attribute:: filter - - Pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - - .. attribute:: flip - - Flip image vertically. - - :type: bool - - .. attribute:: image - - Image data. (readonly) - - :type: :class:`~bgl.Buffer` or None - - .. method:: load(imageBuffer, width, height) - - Load image from buffer. - - :arg imageBuffer: Buffer to load the image from. - :type imageBuffer: :class:`~bgl.Buffer` or Python object implementing the buffer protocol (f.ex. bytes) - :arg width: Width of the image to load. - :type width: int - :arg height: Height of the image to load. - :type height: int - - .. method:: plot(imageBuffer, width, height, positionX, positionY, mode=IMB_BLEND_COPY) - - Update image buffer. - - :arg imageBuffer: Buffer to load the new data from. - :type imageBuffer: :class:`~bgl.Buffer`, :class:`ImageBuff` - or Python object implementing the buffer protocol (f.ex. bytes) - :arg width: Width of the data to load. - :type width: int - :arg height: Height of the data to load. - :type height: int - :arg positionX: Left boundary of the region to be drawn on. - :type positionX: int - :arg positionY: Upper boundary of the region to be drawn on. - :type positionY: int - :arg mode: Drawing mode, see `Image Blending Modes`_. - :type mode: int - - - .. attribute:: scale - - Fast scale of image (near neighbour). - - :type: bool - - .. attribute:: size - - Image size. (readonly) - - :type: tuple of two ints - - .. attribute:: valid - - Tells if an image is available. (readonly) - - :type: bool - -.. class:: ImageMirror(scene, observer, mirror, material=0) - - Image source from mirror. - - :arg scene: Scene in which the image has to be taken. - :type scene: :class:`~bge.types.KX_Scene` - :arg observer: Reference object for the mirror - (the object from which the mirror has to be looked at, for example a camera). - :type observer: :class:`~bge.types.KX_GameObject` - :arg mirror: Object holding the mirror. - :type mirror: :class:`~bge.types.KX_GameObject` - :arg material: ID of the mirror's material to be used for mirroring. (optional) - :type material: int - - .. attribute:: alpha - - Use alpha in texture. - - :type: bool - - .. attribute:: background - - Background color. - - :type: int or float list [r, g, b, a] in [0.0, 255.0] - - .. attribute:: capsize - - Size of render area. - - :type: sequence of two ints - - .. attribute:: clip - - Clipping distance. - - :type: float in [0.01, 5000.0] - - .. attribute:: filter - - Pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - - .. attribute:: flip - - Flip image vertically. - - :type: bool - - .. attribute:: image - - Image data. (readonly) - - :type: :class:`~bgl.Buffer` or None - - .. method:: refresh(buffer=None, format="RGBA") - - Refresh image - render and copy the image to an external buffer (optional) - then invalidate its current content. - - :arg buffer: An optional object that implements the buffer protocol. - If specified, the image is rendered and copied to the buffer, - which must be big enough or an exception is thrown. - :type buffer: any buffer type - :arg format: An optional image format specifier for the image that will be copied to the buffer. - Only valid values are "RGBA" or "BGRA" - :type format: str - - .. attribute:: scale - - Fast scale of image (near neighbour). - - :type: bool - - .. attribute:: size - - Image size (readonly). - - :type: tuple of two ints - - .. attribute:: valid - - Tells if an image is available. (readonly) - - :type: bool - - .. attribute:: whole - - Use whole viewport to render. - - :type: bool - -.. class:: ImageMix - - Image mixer used to mix multiple image sources together. - - .. attribute:: filter - - Pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - - .. attribute:: flip - - Flip image vertically. - - :type: bool - - .. method:: getSource(id) - - Get image source. - - :arg id: Identifier of the source to get. - :type id: str - - :return: Image source. - :rtype: one of... - - * :class:`VideoFFmpeg` - * :class:`ImageFFmpeg` - * :class:`ImageBuff` - * :class:`ImageMirror` - * :class:`ImageMix` - * :class:`ImageRender` - * :class:`ImageViewport` - - .. method:: getWeight(id) - - Get image source weight. - - :arg id: Identifier of the source. - :type id: str - - :return: Weight of the source. - :rtype: int - - .. attribute:: image - - Image data. (readonly) - - :type: :class:`~bgl.Buffer` or None - - .. method:: refresh(buffer=None, format="RGBA") - - Refresh image - calculate and copy the image to an external buffer (optional) - then invalidate its current content. - - :arg buffer: An optional object that implements the buffer protocol. - If specified, the image is calculated and copied to the buffer, - which must be big enough or an exception is thrown. - :type buffer: any buffer type - :arg format: An optional image format specifier for the image that will be copied to the buffer. - Only valid values are "RGBA" or "BGRA" - :type format: str - - .. attribute:: scale - - Fast scale of image (near neighbour). - - :type: bool - - .. attribute:: size - - Image size. (readonly) - - :type: tuple of two ints - - .. method:: setSource(id, image) - - Set image source - all sources must have the same size. - - :arg id: Identifier of the source to set. - :type id: str - :arg image: Image source of type... - - * :class:`VideoFFmpeg` - * :class:`ImageFFmpeg` - * :class:`ImageBuff` - * :class:`ImageMirror` - * :class:`ImageMix` - * :class:`ImageRender` - * :class:`ImageViewport` - - .. method:: setWeight(id, weight) - - Set image source weight - the sum of the weights should be 256 to get full color intensity in the output. - - :arg id: Identifier of the source. - :type id: str - :arg weight: Weight of the source. - :type weight: int - - .. attribute:: valid - - Tells if an image is available. (readonly) - - :type: bool - -.. class:: ImageRender(scene, camera) - - Image source from a render of a non active camera. - The render is done on a custom framebuffer object if fbo is specified, - otherwise on the default framebuffer. - - :arg scene: Scene in which the image has to be taken. - :type scene: :class:`~bge.types.KX_Scene` - :arg camera: Camera from which the image has to be taken. - :type camera: :class:`~bge.types.KX_Camera` - :arg fbo: Off-screen render buffer object (optional) - :type fbo: :class:`~bge.render.RASOffScreen` - - .. attribute:: alpha - - Use alpha in texture. - - :type: bool - - .. attribute:: background - - Background color. - - :type: int or float list [r, g, b, a] in [0.0, 255.0] - - .. attribute:: capsize - - Size of render area. - - :type: sequence of two ints - - .. attribute:: filter - - Pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - - .. attribute:: flip - - Flip image vertically. - - :type: bool - - .. attribute:: image - - Image data. (readonly) - - :type: :class:`~bgl.Buffer` or None - - .. attribute:: scale - - Fast scale of image (near neighbour). - - :type: bool - - .. attribute:: size - - Image size. (readonly) - - :type: tuple of two ints - - .. attribute:: valid - - Tells if an image is available. (readonly) - - :type: bool - - .. attribute:: whole - - Use whole viewport to render. - - :type: bool - - .. attribute:: depth - - Use depth component of render as array of float - not suitable for texture source, - should only be used with bge.texture.imageToArray(mode='F'). - - :type: bool - - .. attribute:: zbuff - - Use depth component of render as grayscale color - suitable for texture source. - - :type: bool - - .. method:: render() - - Render the scene but do not extract the pixels yet. - The function returns as soon as the render commands have been send to the GPU. - The render will proceed asynchronously in the GPU while the host can perform other tasks. - To complete the render, you can either call :func:`refresh` - directly of refresh the texture of which this object is the source. - This method is useful to implement asynchronous render for optimal performance: call render() - on frame n and refresh() on frame n+1 to give as much as time as possible to the GPU - to render the frame while the game engine can perform other tasks. - - :return: True if the render was initiated, False if the render cannot be performed (e.g. the camera is active) - :rtype: bool - - .. method:: refresh() - .. method:: refresh(buffer, format="RGBA") - - Refresh video - render and optionally copy the image to an external buffer then invalidate its current content. - The render may have been started earlier with the :func:`render` method, - in which case this function simply waits for the render operations to complete. - When called without argument, the pixels are not extracted but the render is guaranteed - to be completed when the function returns. - This only makes sense with offscreen render on texture target (see :func:`~bge.render.offScreenCreate`). - - :arg buffer: An object that implements the buffer protocol. - If specified, the image is copied to the buffer, which must be big enough or an exception is thrown. - The transfer to the buffer is optimal if no processing of the image is needed. - This is the case if ``flip=False, alpha=True, scale=False, whole=True, depth=False, zbuff=False`` - and no filter is set. - :type buffer: any buffer type of sufficient size - :arg format: An optional image format specifier for the image that will be copied to the buffer. - Only valid values are "RGBA" or "BGRA" - :type format: str - :return: True if the render is complete, False if the render cannot be performed (e.g. the camera is active) - :rtype: bool - -.. class:: ImageViewport - - Image source from viewport rendered by the active camera. - To render from a non active camera see :class:`ImageRender`. - - .. attribute:: alpha - - Use alpha in texture. - - :type: bool - - .. attribute:: capsize - - Size of viewport area being captured. - - :type: sequence of two ints - - .. attribute:: filter - - Pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - - .. attribute:: flip - - Flip image vertically. - - :type: bool - - .. attribute:: image - - Image data. (readonly) - - :type: :class:`~bgl.Buffer` or None - - .. attribute:: position - - Upper left corner of the captured area. - - :type: sequence of two ints - - .. method:: refresh(buffer=None, format="RGBA") - - Refresh video - copy the viewport to an external buffer (optional) then invalidate its current content. - - :arg buffer: An optional object that implements the buffer protocol. If specified, - the image is copied to the buffer, which must be big enough or an exception is thrown. - The transfer to the buffer is optimal if no processing of the image is needed. This is the case if - ``flip=False, alpha=True, scale=False, whole=True, depth=False, zbuff=False`` and no filter is set. - :type buffer: any buffer type - :arg format: An optional image format specifier for the image that will be copied to the buffer. - Only valid values are "RGBA" or "BGRA" - :type format: str - - .. attribute:: scale - - Fast scale of image (near neighbour). - - :type: bool - - .. attribute:: size - - Image size. (readonly) - - :type: tuple of two ints - - .. attribute:: valid - - Tells if an image is available. (readonly) - - :type: bool - - .. attribute:: whole - - Use whole viewport to capture. - - :type: bool - - .. attribute:: depth - - Use depth component of viewport as array of float - not suitable for texture source, - should only be used with ``bge.texture.imageToArray(mode='F')``. - - :type: bool - - .. attribute:: zbuff - - Use depth component of viewport as grayscale color - suitable for texture source. - - :type: bool - -.. class:: VideoDeckLink(format, capture=0) - - Image source from an external video stream captured with a DeckLink video card from - Black Magic Design. - Before this source can be used, a DeckLink hardware device must be installed, it can be a PCIe card - or a USB device, and the 'Desktop Video' software package (version 10.4 or above must be installed) - on the host as described in the DeckLink documentation. - If in addition you have a recent nVideo Quadro card, you can benefit from the 'GPUDirect' technology - to push the captured video frame very efficiently to the GPU. For this you need to install the - 'DeckLink SDK' version 10.4 or above and copy the 'dvp.dll' runtime library to Blender's - installation directory or to any other place where Blender can load a DLL from. - - :arg format: string describing the video format to be captured. - :type format: str - :arg capture: Card number from which the input video must be captured. - :type capture: int - - The format argument must be written as ``<displayMode>/<pixelFormat>[/3D][:<cacheSize>]`` - where ``<displayMode>`` describes the frame size and rate and <pixelFormat> the encoding of the pixels. - The optional ``/3D`` suffix is to be used if the video stream is stereo with a left and right eye feed. - The optional ``:<cacheSize>`` suffix determines the number of the video frames kept in cache, by default 8. - Some DeckLink cards won't work below a certain cache size. The default value 8 should be sufficient for all cards. - You may try to reduce the cache size to reduce the memory footprint. For example the The 4K Extreme is known - to work with 3 frames only, the Extreme 2 needs 4 frames and the Intensity Shuttle needs 6 frames, etc. - Reducing the cache size may be useful when Decklink is used in conjunction with GPUDirect: - all frames must be locked in memory in that case and that puts a lot of pressure on memory. - If you reduce the cache size too much, you'll get no error but no video feed either. - - The valid ``<displayMode>`` values are copied from the ``BMDDisplayMode`` enum in the DeckLink API - without the 'bmdMode' prefix. In case a mode that is not in this list is added in a later version - of the SDK, it is also possible to specify the 4 letters of the internal code for that mode. - You will find the internal code in the ``DeckLinkAPIModes.h`` file that is part of the SDK. - Here is for reference the full list of supported display modes with their equivalent internal code: - - Internal Codes - - NTSC 'ntsc' - - NTSC2398 'nt23' - - PAL 'pal ' - - NTSCp 'ntsp' - - PALp 'palp' - HD 1080 Modes - - HD1080p2398 '23ps' - - HD1080p24 '24ps' - - HD1080p25 'Hp25' - - HD1080p2997 'Hp29' - - HD1080p30 'Hp30' - - HD1080i50 'Hi50' - - HD1080i5994 'Hi59' - - HD1080i6000 'Hi60' - - HD1080p50 'Hp50' - - HD1080p5994 'Hp59' - - HD1080p6000 'Hp60' - HD 720 Modes - - HD720p50 'hp50' - - HD720p5994 'hp59' - - HD720p60 'hp60' - 2k Modes - - 2k2398 '2k23' - - 2k24 '2k24' - - 2k25 '2k25' - 4k Modes - - 4K2160p2398 '4k23' - - 4K2160p24 '4k24' - - 4K2160p25 '4k25' - - 4K2160p2997 '4k29' - - 4K2160p30 '4k30' - - 4K2160p50 '4k50' - - 4K2160p5994 '4k59' - - 4K2160p60 '4k60' - - Most of names are self explanatory. If necessary refer to the DeckLink API documentation for more information. - - Similarly, <pixelFormat> is copied from the BMDPixelFormat enum. - - Here is for reference the full list of supported pixel format and their equivalent internal code: - - Pixel Formats - - 8BitYUV '2vuy' - - 10BitYUV 'v210' - - 8BitARGB * no equivalent code * - - 8BitBGRA 'BGRA' - - 10BitRGB 'r210' - - 12BitRGB 'R12B' - - 12BitRGBLE 'R12L' - - 10BitRGBXLE 'R10l' - - 10BitRGBX 'R10b' - - Refer to the DeckLink SDK documentation for a full description of these pixel format. - It is important to understand them as the decoding of the pixels is NOT done in VideoTexture - for performance reason. Instead a specific shader must be used to decode the pixel in the GPU. - Only the '8BitARGB', '8BitBGRA' and '10BitRGBXLE' pixel formats are mapped directly to OpenGL RGB float textures. - The '8BitYUV' and '10BitYUV' pixel formats are mapped to openGL RGB float texture but require a shader to decode. - The other pixel formats are sent as a ``GL_RED_INTEGER`` texture (i.e. a texture with only the - red channel coded as an unsigned 32 bit integer) and are not recommended for use. - - Example: ``HD1080p24/10BitYUV/3D:4`` is equivalent to ``24ps/v210/3D:4`` - and represents a full HD stereo feed at 24 frame per second and 4 frames cache size. - - Although video format auto detection is possible with certain DeckLink devices, the corresponding - API is NOT implemented in the BGE. Therefore it is important to specify the format string that - matches exactly the video feed. If the format is wrong, no frame will be captured. - It should be noted that the pixel format that you need to specify is not necessarily the actual - format in the video feed. For example, the 4K Extreme card delivers 8bit RGBs pixels in the - '10BitRGBXLE' format. Use the 'Media Express' application included in 'Desktop Video' to discover - which pixel format works for a particular video stream. - - .. attribute:: status - - Status of the capture: 1=ready to use, 2=capturing, 3=stopped - - :type: int - - .. attribute:: framerate - - Capture frame rate as computed from the video format. - - :type: float - - .. attribute:: valid - - Tells if the image attribute can be used to retrieve the image. - Always False in this implementation (the image is not available at python level) - - :type: bool - - .. attribute:: image - - The image data. Always None in this implementation. - - :type: :class:`~bgl.Buffer` or None - - .. attribute:: size - - The size of the frame in pixel. - Stereo frames have double the height of the video frame, i.e. 3D is delivered to the GPU - as a single image in top-bottom order, left eye on top. - - :type: (int,int) - - .. attribute:: scale - - Not used in this object. - - :type: bool - - .. attribute:: flip - - Not used in this object. - - :type: bool - - .. attribute:: filter - - Not used in this object. - - .. method:: play() - - Kick-off the capture after creation of the object. - - :return: True if the capture could be started, False otherwise. - :rtype: bool - - .. method:: pause() - - Temporary stops the capture. Use play() to restart it. - - :return: True if the capture could be paused, False otherwise. - :rtype: bool - - .. method:: stop() - - Stops the capture. - - :return: True if the capture could be stopped, False otherwise. - :rtype: bool - - -*************** -Texture classes -*************** - -.. class:: Texture(gameObj, materialID=0, textureID=0, textureObj=None) - - Class that creates the ``Texture`` object that loads the dynamic texture on the GPU. - - :arg gameObj: Game object to be created a video texture on. - :type gameObj: :class:`~bge.types.KX_GameObject` - :arg materialID: Material ID default, 0 is the first material. (optional) - :type materialID: int - :arg textureID: Texture index in case of multi-texture channel, 0 = first channel by default. - In case of UV texture, this parameter should always be 0. (optional) - :type textureID: int - :arg textureObj: Reference to another ``Texture`` object with shared bindId - which he user might want to reuse the texture. - If this argument is used, you should not create any source on this texture - and there is no need to refresh it either: the other ``Texture`` object will - provide the texture for both materials/textures.(optional) - :type textureObj: :class:`Texture` - - .. attribute:: bindId - - OpenGL Bind Name. (readonly) - - :type: int - - .. method:: close() - - Close dynamic texture and restore original. - - .. attribute:: mipmap - - Mipmap texture. - - :type: bool - - .. method:: refresh(refresh_source, timestamp=-1.0) - - Refresh texture from source. - - :arg refresh_source: Whether to also refresh the image source of the texture. - :type refresh_source: bool - :arg timestamp: If the texture controls a VideoFFmpeg object: - timestamp (in seconds from the start of the movie) of the frame to be loaded; this can be - used for video-sound synchonization by passing :attr:`~bge.types.KX_SoundActuator.time` to it. (optional) - :type timestamp: float - - .. attribute:: source - - Source of texture. - - :type: one of... - - * :class:`VideoFFmpeg` - * :class:`VideoDeckLink` - * :class:`ImageFFmpeg` - * :class:`ImageBuff` - * :class:`ImageMirror` - * :class:`ImageMix` - * :class:`ImageRender` - * :class:`ImageViewport` - -.. class:: DeckLink(cardIdx=0, format="") - - Certain DeckLink devices can be used to playback video: the host sends video frames regularly - for immediate or scheduled playback. The video feed is outputted on HDMI or SDI interfaces. - This class supports the immediate playback mode: it has a source attribute that is assigned - one of the source object in the bge.texture module. Refreshing the DeckLink object causes - the image source to be computed and sent to the DeckLink device for immediate transmission - on the output interfaces. Keying is supported: it allows to composite the frame with an - input video feed that transits through the DeckLink card. - - :arg cardIdx: Number of the card to be used for output (0=first card). - It should be noted that DeckLink devices are usually half duplex: - they can either be used for capture or playback but not both at the same time. - :type cardIdx: int - :arg format: String representing the display mode of the output feed. - :type format: str - - The default value of the format argument is reserved for auto detection but it is currently - not supported (it will generate a runtime error) and thus the video format must be explicitly - specified. If keying is the goal (see keying attributes), the format must match exactly the - input video feed, otherwise it can be any format supported by the device (there will be a - runtime error if not). - The format of the string is ``<displayMode>[/3D]``. - - Refer to :class:`VideoDeckLink` to get the list of acceptable ``<displayMode>``. - The optional ``/3D`` suffix is used to create a stereo 3D feed. - In that case the 'right' attribute must also be set to specify the image source for the right eye. - - Note: The pixel format is not specified here because it is always BGRA. The alpha channel is - used in keying to mix the source with the input video feed, otherwise it is not used. - If a conversion is needed to match the native video format, it is done inside the DeckLink driver - or device. - - .. attribute:: source - - This attribute must be set to one of the image sources. If the image size does not fit exactly - the frame size, the extend attribute determines what to do. - - For best performance, the source image should match exactly the size of the output frame. - A further optimization is achieved if the image source object is ImageViewport or ImageRender - set for whole viewport, flip disabled and no filter: the GL frame buffer is copied directly - to the image buffer and directly from there to the DeckLink card (hence no buffer to buffer - copy inside VideoTexture). - - :type: one of... - - :class:`VideoFFmpeg` - - :class:`VideoDeckLink` - - :class:`ImageFFmpeg` - - :class:`ImageBuff` - - :class:`ImageMirror` - - :class:`ImageMix` - - :class:`ImageRender` - - :class:`ImageViewport` - - .. attribute:: right - - If the video format is stereo 3D, this attribute should be set to an image source object - that will produce the right eye images. If the goal is to render the BGE scene in 3D, - it can be achieved with 2 cameras, one for each eye, used by 2 ImageRender with an offscreen - render buffer that is just the size of the video frame. - - :type: one of... - - :class:`VideoFFmpeg` - - :class:`VideoDeckLink` - - :class:`ImageFFmpeg` - - :class:`ImageBuff` - - :class:`ImageMirror` - - :class:`ImageMix` - - :class:`ImageRender` - - :class:`ImageViewport` - - .. attribute:: keying - - Specify if keying is enabled. False (default): the output frame is sent unmodified on - the output interface (in that case no input video is required). True: the output frame - is mixed with the input video, using the alpha channel to blend the two images and the - combination is sent on the output interface. - - :type: bool - - .. attribute:: level - - If keying is enabled, sets the keying level from 0 to 255. This value is a global alpha value - that multiplies the alpha channel of the image source. Use 255 (the default) to keep the alpha - channel unmodified, 0 to make the output frame totally transparent. - - :type: int - - .. attribute:: extend - - Determines how the image source should be mapped if the size does not fit the video frame size. - * False (the default): map the image pixel by pixel. - If the image size is smaller than the frame size, extra space around the image is filled with - 0-alpha black. If it is larger, the image is cropped to fit the frame size. - * True: the image is scaled by the nearest neighbor algorithm to fit the frame size. - The scaling is fast but poor quality. For best results, always adjust the image source to - match the size of the output video. - - :type: bool - - .. method:: close() - - Close the DeckLink device and release all resources. After calling this method, - the object cannot be reactivated, it must be destroyed and a new DeckLink object - created from fresh to restart the output. - - .. method:: refresh(refresh_source,ts) - - This method must be called frequently to update the output frame in the DeckLink device. - - :arg refresh_source: True if the source objects image buffer should be invalidated after being - used to compute the output frame. This triggers the recomputing of the - source image on next refresh, which is normally the desired effect. - False if the image source buffer should stay valid and reused on next refresh. - Note that the DeckLink device stores the output frame and replays until a - new frame is sent from the host. Thus, it is not necessary to refresh the - DeckLink object if it is known that the image source has not changed. - :type refresh_source: bool - :arg ts: The timestamp value passed to the image source object to compute the image. - If unspecified, the BGE clock is used. - :type ts: float - - -************** -Filter classes -************** - -.. class:: FilterBGR24 - - Source filter BGR24. - -.. class:: FilterBlueScreen - - Filter for Blue Screen. - The RGB channels of the color are left unchanged, while the output alpha is obtained as follows: - - - if the square of the euclidian distance between the RGB color - and the filter's reference color is smaller than the filter's lower limit, - the output alpha is set to 0; - - if that square is bigger than the filter's upper limit, the output alpha is set to 255; - - otherwise the output alpha is linarly extrapoled between 0 and 255 in the interval of the limits. - - .. attribute:: color - - Reference color. - - :type: sequence of three ints - :default: (0, 0, 255) - - .. attribute:: limits - - Reference color limits. - - :type: sequence of two ints - :default: (64, 64) - - .. attribute:: previous - - Previous pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - -.. class:: FilterColor - - Filter for color calculations. - The output color is obtained by multiplying the reduced 4x4 matrix with the input color - and adding the remaining column to the result. - - .. attribute:: matrix - - Matrix [4][5] for color calculation. - - :type: sequence of four sequences of five ints - :default: ((256, 0, 0, 0, 0), (0, 256, 0, 0, 0), (0, 0, 256, 0, 0), (0, 0, 0, 256, 0)) - - .. attribute:: previous - - Previous pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - -.. class:: FilterGray - - Filter for grayscale effect. - Proportions of R, G and B contributions in the output grayscale are 28:151:77. - - .. attribute:: previous - - Previous pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - -.. class:: FilterLevel - - Filter for levels calculations. Each output color component is obtained as follows: - - * if it is smaller than its corresponding min value, it is set to 0; - - * if it is bigger than its corresponding max value, it is set to 255; - - * Otherwise it is linearly extrapoled between 0 and 255 in the (min, max) interval. - - .. attribute:: levels - - Levels matrix [4] (min, max). - - :type: sequence of four sequences of two ints - :default: ((0, 255), (0, 255), (0, 255), (0, 255)) - - .. attribute:: previous - - Previous pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - -.. class:: FilterNormal - - Normal map filter. - - .. attribute:: colorIdx - - Index of color used to calculate normal (0 - red, 1 - green, 2 - blue, 3 - alpha). - - :type: int in [0, 3] - :default: 0 - - .. attribute:: depth - - Depth of relief. - - :type: float - :default: 4.0 - - .. attribute:: previous - - Previous pixel filter. - - :type: one of... - - * :class:`FilterBGR24` - * :class:`FilterBlueScreen` - * :class:`FilterColor` - * :class:`FilterGray` - * :class:`FilterLevel` - * :class:`FilterNormal` - * :class:`FilterRGB24` - * :class:`FilterRGBA32` - -.. class:: FilterRGB24 - - Returns a new input filter object to be used with :class:`ImageBuff` object when the image passed - to the :meth:`ImageBuff.load` function has the 3-bytes pixel format BGR. - -.. class:: FilterRGBA32 - - Source filter RGBA32. - - -********* -Functions -********* - -.. function:: getLastError() - - Last error that occurred in a bge.texture function. - - :return: The description of the last error occurred in a bge.texture function. - :rtype: str - -.. function:: imageToArray(image, mode) - - Returns a :class:`~bgl.Buffer` corresponding to the current image stored in a texture source object. - - :arg image: Image source object of type: - - * :class:`VideoFFmpeg` - * :class:`ImageFFmpeg` - * :class:`ImageBuff` - * :class:`ImageMirror` - * :class:`ImageMix` - * :class:`ImageRender` - * :class:`ImageViewport` - - :arg mode: Optional argument representing the pixel format. - - - You can use the characters R, G, B for the 3 color channels, A for the alpha channel, - 0 to force a fixed 0 color channel and 1 to force a fixed 255 color channel. - - Examples: - - - "BGR" will return 3 bytes per pixel with the - Blue, Green and Red channels in that order. - - "RGB1" will return 4 bytes per pixel with the - Red, Green, Blue channels in that order and the alpha channel forced to 255. - - - A special mode "F" allows to return the image as an array of float. - This mode should only be used to retrieve the depth buffer of the - class:`ImageViewport` and :class:`ImageRender` objects. - The default mode is "RGBA". - - :type mode: str - - :return: An object representing the image as one dimensional array of bytes of size (pixel_size*width*height), - line by line starting from the bottom of the image. The pixel size and format is determined by the mode - parameter. For mode 'F', the array is a one dimensional array of float of size (width*height). - :rtype: :class:`~bgl.Buffer` - -.. function:: materialID(object, name) - - Returns a numeric value that can be used in :class:`Texture` to create a dynamic texture. - - The value corresponds to an internal material number that uses the texture identified - by name. name is a string representing a texture name with ``IM`` prefix if you want to - identify the texture directly. This method works for basic tex face and for material, - provided the material has a texture channel using that particular texture in first - position of the texture stack. name can also have ``MA`` prefix if you want to identify - the texture by material. In that case the material must have a texture channel in first - position. - - If the object has no material that matches name, it generates a runtime error. - Use try/except to catch the exception. - - Ex: ``bge.texture.materialID(obj, 'IMvideo.png')`` - - :arg object: The game object that uses the texture you want to make dynamic. - :type object: :class:`~bge.types.KX_GameObject` - :arg name: Name of the texture/material you want to make dynamic. - :type name: str - - :return: The internal material number. - :rtype: int - -.. function:: setLogFile(filename) - - Sets the name of a text file in which runtime error messages will be written, - in addition to the printing of the messages on the Python console. - Only the runtime errors specific to the VideoTexture module are written in that file, - ordinary runtime time errors are not written. - - :arg filename: Name of the error log file. - :type filename: str - - :return: -1 if the parameter name is invalid (not of type string), else 0. - :rtype: int - - -********* -Constants -********* - -FFmpeg Video and Image Status -+++++++++++++++++++++++++++++ - - -.. data:: SOURCE_ERROR - -.. data:: SOURCE_EMPTY - -.. data:: SOURCE_READY - -.. data:: SOURCE_PLAYING - -.. data:: SOURCE_STOPPED - - -Image Blending Modes -++++++++++++++++++++ - -See Wikipedia's `Blend Modes <https://en.wikipedia.org/wiki/Blend_modes>`_ for reference. - -.. data:: IMB_BLEND_MIX - -.. data:: IMB_BLEND_ADD - -.. data:: IMB_BLEND_SUB - -.. data:: IMB_BLEND_MUL - -.. data:: IMB_BLEND_LIGHTEN - -.. data:: IMB_BLEND_DARKEN - -.. data:: IMB_BLEND_ERASE_ALPHA - -.. data:: IMB_BLEND_ADD_ALPHA - -.. data:: IMB_BLEND_OVERLAY - -.. data:: IMB_BLEND_HARDLIGHT - -.. data:: IMB_BLEND_COLORBURN - -.. data:: IMB_BLEND_LINEARBURN - -.. data:: IMB_BLEND_COLORDODGE - -.. data:: IMB_BLEND_SCREEN - -.. data:: IMB_BLEND_SOFTLIGHT - -.. data:: IMB_BLEND_PINLIGHT - -.. data:: IMB_BLEND_VIVIDLIGHT - -.. data:: IMB_BLEND_LINEARLIGHT - -.. data:: IMB_BLEND_DIFFERENCE - -.. data:: IMB_BLEND_EXCLUSION - -.. data:: IMB_BLEND_HUE - -.. data:: IMB_BLEND_SATURATION - -.. data:: IMB_BLEND_LUMINOSITY - -.. data:: IMB_BLEND_COLOR - -.. data:: IMB_BLEND_COPY - -.. data:: IMB_BLEND_COPY_RGB - -.. data:: IMB_BLEND_COPY_ALPHA diff --git a/doc/python_api/rst/bge.types.rst b/doc/python_api/rst/bge.types.rst deleted file mode 100644 index b043f53e413..00000000000 --- a/doc/python_api/rst/bge.types.rst +++ /dev/null @@ -1,37 +0,0 @@ - -Game Types (bge.types) -====================== - -.. module:: bge.types - -************ -Introduction -************ - -This module contains the classes that appear as instances in the Game Engine. A -script must interact with these classes if it is to affect the behaviour of -objects in a game. - -The following example would move an object (i.e. an instance of -:class:`KX_GameObject`) one unit up. - -.. code-block:: python - - # bge.types.SCA_PythonController - cont = bge.logic.getCurrentController() - - # bge.types.KX_GameObject - obj = cont.owner - obj.worldPosition.z += 1 - -To run the code, it could be placed in a Blender text block and executed with -a :class:`SCA_PythonController` logic brick. - -***** -Types -***** - -.. toctree:: - :glob: - - bge.types.* diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst b/doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst deleted file mode 100644 index c761a0d4e44..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_ActionActuator.rst +++ /dev/null @@ -1,75 +0,0 @@ -BL_ActionActuator(SCA_IActuator) -================================ - -base class --- :class:`SCA_IActuator` - -.. class:: BL_ActionActuator(SCA_IActuator) - - Action Actuators apply an action to an actor. - - .. attribute:: action - - The name of the action to set as the current action. - - :type: string - - .. attribute:: frameStart - - Specifies the starting frame of the animation. - - :type: float - - .. attribute:: frameEnd - - Specifies the ending frame of the animation. - - :type: float - - .. attribute:: blendIn - - Specifies the number of frames of animation to generate when making transitions between actions. - - :type: float - - .. attribute:: priority - - Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers. - - :type: integer - - .. attribute:: frame - - Sets the current frame for the animation. - - :type: float - - .. attribute:: propName - - Sets the property to be used in FromProp playback mode. - - :type: string - - .. attribute:: blendTime - - Sets the internal frame timer. This property must be in the range from 0.0 to blendIn. - - :type: float - - .. attribute:: mode - - The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`. - - :type: integer - - .. attribute:: useContinue - - The actions continue option, True or False. When True, the action will always play from where last left off, - otherwise negative events to this actuator will reset it to its start frame. - - :type: boolean - - .. attribute:: framePropName - - The name of the property that is set to the current frame number. - - :type: string diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureActuator.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureActuator.rst deleted file mode 100644 index d60782dde32..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureActuator.rst +++ /dev/null @@ -1,58 +0,0 @@ -BL_ArmatureActuator(SCA_IActuator) -================================== - -base class --- :class:`SCA_IActuator` - -.. class:: BL_ArmatureActuator(SCA_IActuator) - - Armature Actuators change constraint condition on armatures. - - .. attribute:: type - - The type of action that the actuator executes when it is active. - - Can be one of :ref:`these constants <armatureactuator-constants-type>` - - :type: integer - - .. attribute:: constraint - - The constraint object this actuator is controlling. - - :type: :class:`BL_ArmatureConstraint` - - .. attribute:: target - - The object that this actuator will set as primary target to the constraint it controls. - - :type: :class:`KX_GameObject` - - .. attribute:: subtarget - - The object that this actuator will set as secondary target to the constraint it controls. - - :type: :class:`KX_GameObject`. - - .. note:: - - Currently, the only secondary target is the pole target for IK constraint. - - .. attribute:: weight - - The weight this actuator will set on the constraint it controls. - - :type: float. - - .. note:: - - Currently only the IK constraint has a weight. It must be a value between 0 and 1. - - .. note:: - - A weight of 0 disables a constraint while still updating constraint runtime values (see :class:`BL_ArmatureConstraint`) - - .. attribute:: influence - - The influence this actuator will set on the constraint it controls. - - :type: float. diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst deleted file mode 100644 index 0200c9c513b..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureBone.rst +++ /dev/null @@ -1,103 +0,0 @@ -BL_ArmatureBone(PyObjectPlus) -============================= - -base class --- :class:`PyObjectPlus` - -.. class:: BL_ArmatureBone(PyObjectPlus) - - Proxy to Blender bone structure. All fields are read-only and comply to RNA names. - All space attribute correspond to the rest pose. - - .. attribute:: name - - bone name. - - :type: string - - .. attribute:: connected - - true when the bone head is struck to the parent's tail. - - :type: boolean - - .. attribute:: hinge - - true when bone doesn't inherit rotation or scale from parent bone. - - :type: boolean - - .. attribute:: inherit_scale - - true when bone inherits scaling from parent bone. - - :type: boolean - - .. attribute:: bbone_segments - - number of B-bone segments. - - :type: integer - - .. attribute:: roll - - bone rotation around head-tail axis. - - :type: float - - .. attribute:: head - - location of head end of the bone in parent bone space. - - :type: vector [x, y, z] - - .. attribute:: tail - - location of head end of the bone in parent bone space. - - :type: vector [x, y, z] - - .. attribute:: length - - bone length. - - :type: float - - .. attribute:: arm_head - - location of head end of the bone in armature space. - - :type: vector [x, y, z] - - .. attribute:: arm_tail - - location of tail end of the bone in armature space. - - :type: vector [x, y, z] - - .. attribute:: arm_mat - - matrix of the bone head in armature space. - - :type: matrix [4][4] - - .. note:: - - This matrix has no scale part. - - .. attribute:: bone_mat - - rotation matrix of the bone in parent bone space. - - :type: matrix [3][3] - - .. attribute:: parent - - parent bone, or None for root bone. - - :type: :class:`BL_ArmatureBone` - - .. attribute:: children - - list of bone's children. - - :type: list of :class:`BL_ArmatureBone` diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst deleted file mode 100644 index d8fcfa8cbe4..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureChannel.rst +++ /dev/null @@ -1,275 +0,0 @@ -BL_ArmatureChannel(PyObjectPlus) -================================ - -base class --- :class:`PyObjectPlus` - -.. class:: BL_ArmatureChannel(PyObjectPlus) - - Proxy to armature pose channel. Allows to read and set armature pose. - The attributes are identical to RNA attributes, but mostly in read-only mode. - - .. attribute:: name - - channel name (=bone name), read-only. - - :type: string - - .. attribute:: bone - - return the bone object corresponding to this pose channel, read-only. - - :type: :class:`BL_ArmatureBone` - - .. attribute:: parent - - return the parent channel object, None if root channel, read-only. - - :type: :class:`BL_ArmatureChannel` - - .. attribute:: has_ik - - true if the bone is part of an active IK chain, read-only. - This flag is not set when an IK constraint is defined but not enabled (miss target information for example). - - :type: boolean - - .. attribute:: ik_dof_x - - true if the bone is free to rotation in the X axis, read-only. - - :type: boolean - - .. attribute:: ik_dof_y - - true if the bone is free to rotation in the Y axis, read-only. - - :type: boolean - - .. attribute:: ik_dof_z - - true if the bone is free to rotation in the Z axis, read-only. - - :type: boolean - - .. attribute:: ik_limit_x - - true if a limit is imposed on X rotation, read-only. - - :type: boolean - - .. attribute:: ik_limit_y - - true if a limit is imposed on Y rotation, read-only. - - :type: boolean - - .. attribute:: ik_limit_z - - true if a limit is imposed on Z rotation, read-only. - - :type: boolean - - .. attribute:: ik_rot_control - - true if channel rotation should applied as IK constraint, read-only. - - :type: boolean - - .. attribute:: ik_lin_control - - true if channel size should applied as IK constraint, read-only. - - :type: boolean - - .. attribute:: location - - displacement of the bone head in armature local space, read-write. - - :type: vector [X, Y, Z]. - - .. note:: - - You can only move a bone if it is unconnected to its parent. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation. - - .. note:: - - Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`). - - .. attribute:: scale - - scale of the bone relative to its parent, read-write. - - :type: vector [sizeX, sizeY, sizeZ]. - - .. note:: - - An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation. - - .. note:: - - Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`) - - .. attribute:: rotation_quaternion - - rotation of the bone relative to its parent expressed as a quaternion, read-write. - - :type: vector [qr, qi, qj, qk]. - - .. note:: - - This field is only used if rotation_mode is 0. An action playing on the armature may change the value. An IK chain does not update this value, see joint_rotation. - - .. note:: - - Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`) - - .. attribute:: rotation_euler - - rotation of the bone relative to its parent expressed as a set of euler angles, read-write. - - :type: vector [X, Y, Z]. - - .. note:: - - This field is only used if rotation_mode is > 0. You must always pass the angles in [X, Y, Z] order; the order of applying the angles to the bone depends on rotation_mode. An action playing on the armature may change this field. An IK chain does not update this value, see joint_rotation. - - .. note:: - - Changing this field has no immediate effect, the pose is updated when the armature is updated during the graphic render (see :data:`BL_ArmatureObject.update`) - - .. attribute:: rotation_mode - - Method of updating the bone rotation, read-write. - - :type: integer (one of :ref:`these constants <armaturechannel-constants-rotation-mode>`) - - .. attribute:: channel_matrix - - pose matrix in bone space (deformation of the bone due to action, constraint, etc), Read-only. - This field is updated after the graphic render, it represents the current pose. - - :type: matrix [4][4] - - .. attribute:: pose_matrix - - pose matrix in armature space, read-only, - This field is updated after the graphic render, it represents the current pose. - - :type: matrix [4][4] - - .. attribute:: pose_head - - position of bone head in armature space, read-only. - - :type: vector [x, y, z] - - .. attribute:: pose_tail - - position of bone tail in armature space, read-only. - - :type: vector [x, y, z] - - .. attribute:: ik_min_x - - minimum value of X rotation in degree (<= 0) when X rotation is limited (see ik_limit_x), read-only. - - :type: float - - .. attribute:: ik_max_x - - maximum value of X rotation in degree (>= 0) when X rotation is limited (see ik_limit_x), read-only. - - :type: float - - .. attribute:: ik_min_y - - minimum value of Y rotation in degree (<= 0) when Y rotation is limited (see ik_limit_y), read-only. - - :type: float - - .. attribute:: ik_max_y - - maximum value of Y rotation in degree (>= 0) when Y rotation is limited (see ik_limit_y), read-only. - - :type: float - - .. attribute:: ik_min_z - - minimum value of Z rotation in degree (<= 0) when Z rotation is limited (see ik_limit_z), read-only. - - :type: float - - .. attribute:: ik_max_z - - maximum value of Z rotation in degree (>= 0) when Z rotation is limited (see ik_limit_z), read-only. - - :type: float - - .. attribute:: ik_stiffness_x - - bone rotation stiffness in X axis, read-only. - - :type: float between 0 and 1 - - .. attribute:: ik_stiffness_y - - bone rotation stiffness in Y axis, read-only. - - :type: float between 0 and 1 - - .. attribute:: ik_stiffness_z - - bone rotation stiffness in Z axis, read-only. - - :type: float between 0 and 1 - - .. attribute:: ik_stretch - - ratio of scale change that is allowed, 0=bone can't change size, read-only. - - :type: float - - .. attribute:: ik_rot_weight - - weight of rotation constraint when ik_rot_control is set, read-write. - - :type: float between 0 and 1 - - .. attribute:: ik_lin_weight - - weight of size constraint when ik_lin_control is set, read-write. - - :type: float between 0 and 1 - - .. attribute:: joint_rotation - - Control bone rotation in term of joint angle (for robotic applications), read-write. - - When writing to this attribute, you pass a [x, y, z] vector and an appropriate set of euler angles or quaternion is calculated according to the rotation_mode. - - When you read this attribute, the current pose matrix is converted into a [x, y, z] vector representing the joint angles. - - The value and the meaning of the x, y, z depends on the ik_dof_x/ik_dof_y/ik_dof_z attributes: - - * 1DoF joint X, Y or Z: the corresponding x, y, or z value is used an a joint angle in radiant - * 2DoF joint X+Y or Z+Y: treated as 2 successive 1DoF joints: first X or Z, then Y. The x or z value is used as a joint angle in radiant along the X or Z axis, followed by a rotation along the new Y axis of y radiants. - * 2DoF joint X+Z: treated as a 2DoF joint with rotation axis on the X/Z plane. The x and z values are used as the coordinates of the rotation vector in the X/Z plane. - * 3DoF joint X+Y+Z: treated as a revolute joint. The [x, y, z] vector represents the equivalent rotation vector to bring the joint from the rest pose to the new pose. - - :type: vector [x, y, z] - - .. note:: - - The bone must be part of an IK chain if you want to set the ik_dof_x/ik_dof_y/ik_dof_z attributes via the UI, but this will interfere with this attribute since the IK solver will overwrite the pose. You can stay in control of the armature if you create an IK constraint but do not finalize it (e.g. don't set a target) the IK solver will not run but the IK panel will show up on the UI for each bone in the chain. - - .. note:: - - [0, 0, 0] always corresponds to the rest pose. - - .. note:: - - You must request the armature pose to update and wait for the next graphic frame to see the effect of setting this attribute (see :data:`BL_ArmatureObject.update`). - - .. note:: - - You can read the result of the calculation in rotation or euler_rotation attributes after setting this attribute. diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst deleted file mode 100644 index 8a62d2d688f..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureConstraint.rst +++ /dev/null @@ -1,126 +0,0 @@ -BL_ArmatureConstraint(PyObjectPlus) -=================================== - -base class --- :class:`PyObjectPlus` - -.. class:: BL_ArmatureConstraint(PyObjectPlus) - - Proxy to Armature Constraint. Allows to change constraint on the fly. - Obtained through :class:`BL_ArmatureObject`.constraints. - - .. note:: - - Not all armature constraints are supported in the GE. - - - .. attribute:: type - - Type of constraint, (read-only). - - Use one of :ref:`these constants<armatureconstraint-constants-type>`. - - :type: integer, one of CONSTRAINT_TYPE_* constants - - .. attribute:: name - - Name of constraint constructed as <bone_name>:<constraint_name>. constraints list. - - :type: string - - This name is also the key subscript on :class:`BL_ArmatureObject`. - - .. attribute:: enforce - - fraction of constraint effect that is enforced. Between 0 and 1. - - :type: float - - .. attribute:: headtail - - Position of target between head and tail of the target bone: 0=head, 1=tail. - - :type: float. - - .. note:: - - Only used if the target is a bone (i.e target object is an armature. - - .. attribute:: lin_error - - runtime linear error (in Blender units) on constraint at the current frame. - - This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver. - - :type: float - - .. attribute:: rot_error - - Runtime rotation error (in radiant) on constraint at the current frame. - - :type: float. - - This is a runtime value updated on each frame by the IK solver. Only available on IK constraint and iTaSC solver. - - It is only set if the constraint has a rotation part, for example, a CopyPose+Rotation IK constraint. - - .. attribute:: target - - Primary target object for the constraint. The position of this object in the GE will be used as target for the constraint. - - :type: :class:`KX_GameObject`. - - .. attribute:: subtarget - - Secondary target object for the constraint. The position of this object in the GE will be used as secondary target for the constraint. - - :type: :class:`KX_GameObject`. - - Currently this is only used for pole target on IK constraint. - - .. attribute:: active - - True if the constraint is active. - - :type: boolean - - .. note:: - - An inactive constraint does not update lin_error and rot_error. - - .. attribute:: ik_weight - - Weight of the IK constraint between 0 and 1. - - Only defined for IK constraint. - - :type: float - - .. attribute:: ik_type - - Type of IK constraint, (read-only). - - Use one of :ref:`these constants<armatureconstraint-constants-ik-type>`. - - :type: integer. - - .. attribute:: ik_flag - - Combination of IK constraint option flags, read-only. - - Use one of :ref:`these constants<armatureconstraint-constants-ik-flag>`. - - :type: integer - - .. attribute:: ik_dist - - Distance the constraint is trying to maintain with target, only used when ik_type=CONSTRAINT_IK_DISTANCE. - - :type: float - - .. attribute:: ik_mode - - Use one of :ref:`these constants<armatureconstraint-constants-ik-mode>`. - - Additional mode for IK constraint. Currently only used for Distance constraint: - - :type: integer diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst b/doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst deleted file mode 100644 index 336ae29daac..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_ArmatureObject.rst +++ /dev/null @@ -1,31 +0,0 @@ -BL_ArmatureObject(KX_GameObject) -================================ - -base class --- :class:`KX_GameObject` - -.. class:: BL_ArmatureObject(KX_GameObject) - - An armature object. - - .. attribute:: constraints - - The list of armature constraint defined on this armature. - Elements of the list can be accessed by index or string. - The key format for string access is '<bone_name>:<constraint_name>'. - - :type: list of :class:`BL_ArmatureConstraint` - - .. attribute:: channels - - The list of armature channels. - Elements of the list can be accessed by index or name the bone. - - :type: list of :class:`BL_ArmatureChannel` - - .. method:: update() - - Ensures that the armature will be updated on next graphic frame. - - This action is unecessary if a KX_ArmatureActuator with mode run is active - or if an action is playing. Use this function in other cases. It must be called - on each frame to ensure that the armature is updated continously. diff --git a/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst b/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst deleted file mode 100644 index 53544978482..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_Shader.rst +++ /dev/null @@ -1,227 +0,0 @@ -BL_Shader(PyObjectPlus) -======================= - -base class --- :class:`PyObjectPlus` - -.. class:: BL_Shader(PyObjectPlus) - - BL_Shader GLSL shaders. - - TODO - Description - - .. method:: setUniformfv(name, fList) - - Set a uniform with a list of float values - - :arg name: the uniform name - :type name: string - :arg fList: a list (2, 3 or 4 elements) of float values - :type fList: list[float] - - .. method:: delSource() - - Clear the shader. Use this method before the source is changed with :data:`setSource`. - - .. method:: getFragmentProg() - - Returns the fragment program. - - :return: The fragment program. - :rtype: string - - .. method:: getVertexProg() - - Get the vertex program. - - :return: The vertex program. - :rtype: string - - .. method:: isValid() - - Check if the shader is valid. - - :return: True if the shader is valid - :rtype: boolean - - .. method:: setAttrib(enum) - - Set attribute location. (The parameter is ignored a.t.m. and the value of "tangent" is always used.) - - :arg enum: attribute location value - :type enum: integer - - .. method:: setNumberOfPasses( max_pass ) - - Set the maximum number of passes. Not used a.t.m. - - :arg max_pass: the maximum number of passes - :type max_pass: integer - - .. method:: setSampler(name, index) - - Set uniform texture sample index. - - :arg name: Uniform name - :type name: string - :arg index: Texture sample index. - :type index: integer - - .. method:: setSource(vertexProgram, fragmentProgram) - - Set the vertex and fragment programs - - :arg vertexProgram: Vertex program - :type vertexProgram: string - :arg fragmentProgram: Fragment program - :type fragmentProgram: string - - .. method:: setUniform1f(name, fx) - - Set a uniform with 1 float value. - - :arg name: the uniform name - :type name: string - :arg fx: Uniform value - :type fx: float - - .. method:: setUniform1i(name, ix) - - Set a uniform with an integer value. - - :arg name: the uniform name - :type name: string - :arg ix: the uniform value - :type ix: integer - - .. method:: setUniform2f(name, fx, fy) - - Set a uniform with 2 float values - - :arg name: the uniform name - :type name: string - :arg fx: first float value - :type fx: float - - :arg fy: second float value - :type fy: float - - .. method:: setUniform2i(name, ix, iy) - - Set a uniform with 2 integer values - - :arg name: the uniform name - :type name: string - :arg ix: first integer value - :type ix: integer - :arg iy: second integer value - :type iy: integer - - .. method:: setUniform3f(name, fx, fy, fz) - - Set a uniform with 3 float values. - - :arg name: the uniform name - :type name: string - :arg fx: first float value - :type fx: float - :arg fy: second float value - :type fy: float - :arg fz: third float value - :type fz: float - - .. method:: setUniform3i(name, ix, iy, iz) - - Set a uniform with 3 integer values - - :arg name: the uniform name - :type name: string - :arg ix: first integer value - :type ix: integer - :arg iy: second integer value - :type iy: integer - :arg iz: third integer value - :type iz: integer - - .. method:: setUniform4f(name, fx, fy, fz, fw) - - Set a uniform with 4 float values. - - :arg name: the uniform name - :type name: string - :arg fx: first float value - :type fx: float - :arg fy: second float value - :type fy: float - :arg fz: third float value - :type fz: float - :arg fw: fourth float value - :type fw: float - - .. method:: setUniform4i(name, ix, iy, iz, iw) - - Set a uniform with 4 integer values - - :arg name: the uniform name - :type name: string - :arg ix: first integer value - :type ix: integer - :arg iy: second integer value - :type iy: integer - :arg iz: third integer value - :type iz: integer - :arg iw: fourth integer value - :type iw: integer - - .. method:: setUniformDef(name, type) - - Define a new uniform - - :arg name: the uniform name - :type name: string - :arg type: uniform type - :type type: UNI_NONE, UNI_INT, UNI_FLOAT, UNI_INT2, UNI_FLOAT2, UNI_INT3, UNI_FLOAT3, UNI_INT4, UNI_FLOAT4, UNI_MAT3, UNI_MAT4, UNI_MAX - - .. method:: setUniformMatrix3(name, mat, transpose) - - Set a uniform with a 3x3 matrix value - - :arg name: the uniform name - :type name: string - :arg mat: A 3x3 matrix [[f, f, f], [f, f, f], [f, f, f]] - :type mat: 3x3 matrix - :arg transpose: set to True to transpose the matrix - :type transpose: boolean - - .. method:: setUniformMatrix4(name, mat, transpose) - - Set a uniform with a 4x4 matrix value - - :arg name: the uniform name - :type name: string - :arg mat: A 4x4 matrix [[f, f, f, f], [f, f, f, f], [f, f, f, f], [f, f, f, f]] - :type mat: 4x4 matrix - :arg transpose: set to True to transpose the matrix - :type transpose: boolean - - .. method:: setUniformiv(name, iList) - - Set a uniform with a list of integer values - - :arg name: the uniform name - :type name: string - :arg iList: a list (2, 3 or 4 elements) of integer values - :type iList: list[integer] - - .. method:: setUniformEyef(name) - - Set a uniform with a float value that reflects the eye being render in stereo mode: - 0.0 for the left eye, 0.5 for the right eye. In non stereo mode, the value of the uniform - is fixed to 0.0. The typical use of this uniform is in stereo mode to sample stereo textures - containing the left and right eye images in a top-bottom order. - - :arg name: the uniform name - :type name: string - - .. method:: validate() - - Validate the shader object. diff --git a/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst b/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst deleted file mode 100644 index 4c8d113ad87..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.BL_ShapeActionActuator.rst +++ /dev/null @@ -1,68 +0,0 @@ -BL_ShapeActionActuator(SCA_IActuator) -===================================== - -base class --- :class:`SCA_IActuator` - -.. class:: BL_ShapeActionActuator(SCA_IActuator) - - ShapeAction Actuators apply an shape action to an mesh object. - - .. attribute:: action - - The name of the action to set as the current shape action. - - :type: string - - .. attribute:: frameStart - - Specifies the starting frame of the shape animation. - - :type: float - - .. attribute:: frameEnd - - Specifies the ending frame of the shape animation. - - :type: float - - .. attribute:: blendIn - - Specifies the number of frames of animation to generate when making transitions between actions. - - :type: float - - .. attribute:: priority - - Sets the priority of this actuator. Actuators will lower priority numbers will override actuators with higher numbers. - - :type: integer - - .. attribute:: frame - - Sets the current frame for the animation. - - :type: float - - .. attribute:: propName - - Sets the property to be used in FromProp playback mode. - - :type: string - - .. attribute:: blendTime - - Sets the internal frame timer. This property must be in the range from 0.0 to blendin. - - :type: float - - .. attribute:: mode - - The operation mode of the actuator. Can be one of :ref:`these constants<action-actuator>`. - - :type: integer - - .. attribute:: framePropName - - The name of the property that is set to the current frame number. - - :type: string diff --git a/doc/python_api/rst/bge_types/bge.types.CListValue.rst b/doc/python_api/rst/bge_types/bge.types.CListValue.rst deleted file mode 100644 index e47cf351f60..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.CListValue.rst +++ /dev/null @@ -1,69 +0,0 @@ -CListValue(CPropValue) -====================== - -base class --- :class:`CPropValue` - -.. class:: CListValue(CPropValue) - - This is a list like object used in the game engine internally that behaves similar to a python list in most ways. - - As well as the normal index lookup (``val= clist[i]``), CListValue supports string lookups (``val= scene.objects["Cube"]``) - - Other operations such as ``len(clist)``, ``list(clist)``, ``clist[0:10]`` are also supported. - - .. method:: append(val) - - Add an item to the list (like pythons append) - - .. warning:: - - Appending values to the list can cause crashes when the list is used internally by the game engine. - - .. method:: count(val) - - Count the number of instances of a value in the list. - - :return: number of instances - :rtype: integer - - .. method:: index(val) - - Return the index of a value in the list. - - :return: The index of the value in the list. - :rtype: integer - - .. method:: reverse() - - Reverse the order of the list. - - .. method:: get(key, default=None) - - Return the value matching key, or the default value if its not found. - - :return: The key value or a default. - - .. method:: from_id(id) - - This is a funtion especially for the game engine to return a value with a spesific id. - - Since object names are not always unique, the id of an object can be used to get an object from the CValueList. - - Example: - - .. code-block:: python - - myObID=id(gameObject) - ob= scene.objects.from_id(myObID) - - Where ``myObID`` is an int or long from the id function. - - This has the advantage that you can store the id in places you could not store a gameObject. - - .. warning:: - - The id is derived from a memory location and will be different each time the game engine starts. - - .. warning:: - - The id can't be stored as an integer in game object properties, as those only have a limited range that the id may not be contained in. Instead an id can be stored as a string game property and converted back to an integer for use in from_id lookups. diff --git a/doc/python_api/rst/bge_types/bge.types.CPropValue.rst b/doc/python_api/rst/bge_types/bge.types.CPropValue.rst deleted file mode 100644 index 67fc2c4fafd..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.CPropValue.rst +++ /dev/null @@ -1,8 +0,0 @@ -CPropValue(CValue) -================== - -base class --- :class:`CValue` - -.. class:: CPropValue(CValue) - - This class has no python functions diff --git a/doc/python_api/rst/bge_types/bge.types.CValue.rst b/doc/python_api/rst/bge_types/bge.types.CValue.rst deleted file mode 100644 index 3255471daf2..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.CValue.rst +++ /dev/null @@ -1,15 +0,0 @@ -CValue(PyObjectPlus) -==================== - -base class --- :class:`PyObjectPlus` - -.. class:: CValue(PyObjectPlus) - - This class is a basis for other classes. - - .. attribute:: name - - The name of this CValue derived object (read-only). - - :type: string - diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ArmatureSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_ArmatureSensor.rst deleted file mode 100644 index ca617395a69..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_ArmatureSensor.rst +++ /dev/null @@ -1,34 +0,0 @@ -KX_ArmatureSensor(SCA_ISensor) -============================== - -base class --- :class:`SCA_ISensor` - -.. class:: KX_ArmatureSensor(SCA_ISensor) - - Armature sensor detect conditions on armatures. - - .. attribute:: type - - The type of measurement that the sensor make when it is active. - - Can be one of :ref:`these constants <armaturesensor-type>` - - :type: integer. - - .. attribute:: constraint - - The constraint object this sensor is watching. - - :type: :class:`BL_ArmatureConstraint` - - .. attribute:: value - - The threshold used in the comparison with the constraint error - The linear error is only updated on CopyPose/Distance IK constraint with iTaSC solver - The rotation error is only updated on CopyPose+rotation IK constraint with iTaSC solver - The linear error on CopyPose is always >= 0: it is the norm of the distance between the target and the bone - The rotation error on CopyPose is always >= 0: it is the norm of the equivalent rotation vector between the bone and the target orientations - The linear error on Distance can be positive if the distance between the bone and the target is greater than the desired distance, and negative if the distance is smaller. - - :type: float - diff --git a/doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst b/doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst deleted file mode 100644 index fd3bbc58a7c..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_BlenderMaterial.rst +++ /dev/null @@ -1,182 +0,0 @@ -KX_BlenderMaterial(PyObjectPlus) -================================ - -base class --- :class:`PyObjectPlus` - -.. class:: KX_BlenderMaterial(PyObjectPlus) - - This is the interface to materials in the game engine. - - Materials define the render state to be applied to mesh objects. - - The example below shows a simple GLSL shader setup allowing to dynamically mix two texture channels - in a material. All materials of the object executing this script should have two textures using - separate UV maps in the two first texture channels. - - The code works for both Multitexture and GLSL rendering modes. - - .. code-block:: python - - from bge import logic - - vertex_shader = """ - - void main(void) - { - // simple projection of the vertex position to view space - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - // coordinate of the 1st texture channel - gl_TexCoord[0] = gl_MultiTexCoord0; - // coordinate of the 2nd texture channel - gl_TexCoord[1] = gl_MultiTexCoord1; - } - """ - - fragment_shader =""" - - uniform sampler2D texture_0; - uniform sampler2D texture_1; - uniform float factor; - - void main(void) - { - vec4 color_0 = texture2D(texture_0, gl_TexCoord[0].st); - vec4 color_1 = texture2D(texture_1, gl_TexCoord[1].st); - gl_FragColor = mix(color_0, color_1, factor); - } - """ - - object = logic.getCurrentController().owner - - for mesh in object.meshes: - for material in mesh.materials: - shader = material.getShader() - if shader is not None: - if not shader.isValid(): - shader.setSource(vertex_shader, fragment_shader, True) - - # get the first texture channel of the material - shader.setSampler('texture_0', 0) - # get the second texture channel of the material - shader.setSampler('texture_1', 1) - # pass another uniform to the shader - shader.setUniform1f('factor', 0.3) - - .. attribute:: shader - - The material's shader. - - :type: :class:`BL_Shader` - - .. attribute:: blending - - Ints used for pixel blending, (src, dst), matching the setBlending method. - - :type: (integer, integer) - - .. attribute:: material_index - - The material's index. - - :type: integer - - .. method:: getShader() - - Returns the material's shader. - - :return: the material's shader - :rtype: :class:`BL_Shader` - - .. method:: getTextureBindcode(textureslot) - - Returns the material's texture OpenGL bind code/id/number/name. - - :arg textureslot: Specifies the texture slot number - :type textureslot: integer - :return: the material's texture OpenGL bind code/id/number/name - :rtype: integer - - .. attribute:: alpha - - The material's alpha transparency. - - :type: float between 0.0 and 1.0 inclusive - - .. attribute:: hardness - - How hard (sharp) the material's specular reflection is. - - :type: integer between 1 and 511 inclusive - - .. attribute:: emit - - Amount of light to emit. - - :type: float between 0.0 and 2.0 inclusive - - .. attribute:: specularIntensity - - How intense (bright) the material's specular reflection is. - - :type: float between 0.0 and 1.0 inclusive - - .. attribute:: diffuseIntensity - - The material's amount of diffuse reflection. - - :type: float between 0.0 and 1.0 inclusive - - .. attribute:: specularColor - - The material's specular color. - - :type: :class:`mathutils.Color` - - .. attribute:: diffuseColor - - The material's diffuse color. - - :type: :class:`mathutils.Color` - - .. method:: setBlending(src, dest) - - Set the pixel color arithmetic functions. - - :arg src: Specifies how the red, green, blue, and alpha source blending factors are computed, one of... - - * :data:`~bgl.GL_ZERO` - * :data:`~bgl.GL_ONE` - * :data:`~bgl.GL_SRC_COLOR` - * :data:`~bgl.GL_ONE_MINUS_SRC_COLOR` - * :data:`~bgl.GL_DST_COLOR` - * :data:`~bgl.GL_ONE_MINUS_DST_COLOR` - * :data:`~bgl.GL_SRC_ALPHA` - * :data:`~bgl.GL_ONE_MINUS_SRC_ALPHA` - * :data:`~bgl.GL_DST_ALPHA` - * :data:`~bgl.GL_ONE_MINUS_DST_ALPHA` - * :data:`~bgl.GL_SRC_ALPHA_SATURATE` - - :type src: int - - :arg dest: Specifies how the red, green, blue, and alpha destination blending factors are computed, one of... - - * :data:`~bgl.GL_ZERO` - * :data:`~bgl.GL_ONE` - * :data:`~bgl.GL_SRC_COLOR` - * :data:`~bgl.GL_ONE_MINUS_SRC_COLOR` - * :data:`~bgl.GL_DST_COLOR` - * :data:`~bgl.GL_ONE_MINUS_DST_COLOR` - * :data:`~bgl.GL_SRC_ALPHA` - * :data:`~bgl.GL_ONE_MINUS_SRC_ALPHA` - * :data:`~bgl.GL_DST_ALPHA` - * :data:`~bgl.GL_ONE_MINUS_DST_ALPHA` - * :data:`~bgl.GL_SRC_ALPHA_SATURATE` - - :type dest: int - - .. method:: getMaterialIndex() - - Returns the material's index. - - :return: the material's index - :rtype: integer diff --git a/doc/python_api/rst/bge_types/bge.types.KX_Camera.rst b/doc/python_api/rst/bge_types/bge.types.KX_Camera.rst deleted file mode 100644 index 8c8c68fc051..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_Camera.rst +++ /dev/null @@ -1,300 +0,0 @@ -KX_Camera(KX_GameObject) -======================== - -base class --- :class:`KX_GameObject` - -.. class:: KX_Camera(KX_GameObject) - - A Camera object. - - .. data:: INSIDE - - See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum` - - .. data:: INTERSECT - - See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum` - - .. data:: OUTSIDE - - See :data:`sphereInsideFrustum` and :data:`boxInsideFrustum` - - .. attribute:: lens - - The camera's lens value. - - :type: float - - .. attribute:: fov - - The camera's field of view value. - - :type: float - - .. attribute:: ortho_scale - - The camera's view scale when in orthographic mode. - - :type: float - - .. attribute:: near - - The camera's near clip distance. - - :type: float - - .. attribute:: far - - The camera's far clip distance. - - :type: float - - .. attribute:: shift_x - - The camera's horizontal shift. - - :type: float - - .. attribute:: shift_y - - The camera's vertical shift. - - :type: float - - .. attribute:: perspective - - True if this camera has a perspective transform, False for an orthographic projection. - - :type: boolean - - .. attribute:: frustum_culling - - True if this camera is frustum culling. - - :type: boolean - - .. attribute:: projection_matrix - - This camera's 4x4 projection matrix. - - .. note:: - - This is the identity matrix prior to rendering the first frame (any Python done on frame 1). - - :type: 4x4 Matrix [[float]] - - .. attribute:: modelview_matrix - - This camera's 4x4 model view matrix. (read-only). - - :type: 4x4 Matrix [[float]] - - .. note:: - - This matrix is regenerated every frame from the camera's position and orientation. Also, this is the identity matrix prior to rendering the first frame (any Python done on frame 1). - - .. attribute:: camera_to_world - - This camera's camera to world transform. (read-only). - - :type: 4x4 Matrix [[float]] - - .. note:: - - This matrix is regenerated every frame from the camera's position and orientation. - - .. attribute:: world_to_camera - - This camera's world to camera transform. (read-only). - - :type: 4x4 Matrix [[float]] - - .. note:: - - Regenerated every frame from the camera's position and orientation. - - .. note:: - - This is camera_to_world inverted. - - .. attribute:: useViewport - - True when the camera is used as a viewport, set True to enable a viewport for this camera. - - :type: boolean - - .. method:: sphereInsideFrustum(centre, radius) - - Tests the given sphere against the view frustum. - - :arg centre: The centre of the sphere (in world coordinates.) - :type centre: list [x, y, z] - :arg radius: the radius of the sphere - :type radius: float - :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT` - :rtype: integer - - .. note:: - - When the camera is first initialized the result will be invalid because the projection matrix has not been set. - - .. code-block:: python - - from bge import logic - cont = logic.getCurrentController() - cam = cont.owner - - # A sphere of radius 4.0 located at [x, y, z] = [1.0, 1.0, 1.0] - if (cam.sphereInsideFrustum([1.0, 1.0, 1.0], 4) != cam.OUTSIDE): - # Sphere is inside frustum ! - # Do something useful ! - else: - # Sphere is outside frustum - - .. method:: boxInsideFrustum(box) - - Tests the given box against the view frustum. - - :arg box: Eight (8) corner points of the box (in world coordinates.) - :type box: list of lists - :return: :data:`~bge.types.KX_Camera.INSIDE`, :data:`~bge.types.KX_Camera.OUTSIDE` or :data:`~bge.types.KX_Camera.INTERSECT` - - .. note:: - - When the camera is first initialized the result will be invalid because the projection matrix has not been set. - - .. code-block:: python - - from bge import logic - cont = logic.getCurrentController() - cam = cont.owner - - # Box to test... - box = [] - box.append([-1.0, -1.0, -1.0]) - box.append([-1.0, -1.0, 1.0]) - box.append([-1.0, 1.0, -1.0]) - box.append([-1.0, 1.0, 1.0]) - box.append([ 1.0, -1.0, -1.0]) - box.append([ 1.0, -1.0, 1.0]) - box.append([ 1.0, 1.0, -1.0]) - box.append([ 1.0, 1.0, 1.0]) - - if (cam.boxInsideFrustum(box) != cam.OUTSIDE): - # Box is inside/intersects frustum ! - # Do something useful ! - else: - # Box is outside the frustum ! - - .. method:: pointInsideFrustum(point) - - Tests the given point against the view frustum. - - :arg point: The point to test (in world coordinates.) - :type point: 3D Vector - :return: True if the given point is inside this camera's viewing frustum. - :rtype: boolean - - .. note:: - - When the camera is first initialized the result will be invalid because the projection matrix has not been set. - - .. code-block:: python - - from bge import logic - cont = logic.getCurrentController() - cam = cont.owner - - # Test point [0.0, 0.0, 0.0] - if (cam.pointInsideFrustum([0.0, 0.0, 0.0])): - # Point is inside frustum ! - # Do something useful ! - else: - # Box is outside the frustum ! - - .. method:: getCameraToWorld() - - Returns the camera-to-world transform. - - :return: the camera-to-world transform matrix. - :rtype: matrix (4x4 list) - - .. method:: getWorldToCamera() - - Returns the world-to-camera transform. - - This returns the inverse matrix of getCameraToWorld(). - - :return: the world-to-camera transform matrix. - :rtype: matrix (4x4 list) - - .. method:: setOnTop() - - Set this cameras viewport ontop of all other viewport. - - .. method:: setViewport(left, bottom, right, top) - - Sets the region of this viewport on the screen in pixels. - - Use :data:`bge.render.getWindowHeight` and :data:`bge.render.getWindowWidth` to calculate values relative to the entire display. - - :arg left: left pixel coordinate of this viewport - :type left: integer - :arg bottom: bottom pixel coordinate of this viewport - :type bottom: integer - :arg right: right pixel coordinate of this viewport - :type right: integer - :arg top: top pixel coordinate of this viewport - :type top: integer - - .. method:: getScreenPosition(object) - - Gets the position of an object projected on screen space. - - .. code-block:: python - - # For an object in the middle of the screen, coord = [0.5, 0.5] - coord = camera.getScreenPosition(object) - - :arg object: object name or list [x, y, z] - :type object: :class:`KX_GameObject` or 3D Vector - :return: the object's position in screen coordinates. - :rtype: list [x, y] - - .. method:: getScreenVect(x, y) - - Gets the vector from the camera position in the screen coordinate direction. - - :arg x: X Axis - :type x: float - :arg y: Y Axis - :type y: float - :rtype: 3D Vector - :return: The vector from screen coordinate. - - .. code-block:: python - - # Gets the vector of the camera front direction: - m_vect = camera.getScreenVect(0.5, 0.5) - - .. method:: getScreenRay(x, y, dist=inf, property=None) - - Look towards a screen coordinate (x, y) and find first object hit within dist that matches prop. - The ray is similar to KX_GameObject->rayCastTo. - - :arg x: X Axis - :type x: float - :arg y: Y Axis - :type y: float - :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other - :type dist: float - :arg property: property name that object must have; can be omitted => detect any object - :type property: string - :rtype: :class:`KX_GameObject` - :return: the first object hit or None if no object or object does not match prop - - .. code-block:: python - - # Gets an object with a property "wall" in front of the camera within a distance of 100: - target = camera.getScreenRay(0.5, 0.5, 100, "wall") - diff --git a/doc/python_api/rst/bge_types/bge.types.KX_CameraActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_CameraActuator.rst deleted file mode 100644 index 14cf1e47070..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_CameraActuator.rst +++ /dev/null @@ -1,44 +0,0 @@ -KX_CameraActuator(SCA_IActuator) -================================ - -base class --- :class:`SCA_IActuator` - -.. class:: KX_CameraActuator(SCA_IActuator) - - Applies changes to a camera. - - .. attribute:: damping - - strength of of the camera following movement. - - :type: float - - .. attribute:: axis - - The camera axis (0, 1, 2) for positive ``XYZ``, (3, 4, 5) for negative ``XYZ``. - - :type: int - - .. attribute:: min - - minimum distance to the target object maintained by the actuator. - - :type: float - - .. attribute:: max - - maximum distance to stay from the target object. - - :type: float - - .. attribute:: height - - height to stay above the target object. - - :type: float - - .. attribute:: object - - the object this actuator tracks. - - :type: :class:`KX_GameObject` or None diff --git a/doc/python_api/rst/bge_types/bge.types.KX_CharacterWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_CharacterWrapper.rst deleted file mode 100644 index df95b842b5d..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_CharacterWrapper.rst +++ /dev/null @@ -1,42 +0,0 @@ -KX_CharacterWrapper(PyObjectPlus) -================================= - -base class --- :class:`PyObjectPlus` - -.. class:: KX_CharacterWrapper(PyObjectPlus) - - A wrapper to expose character physics options. - - .. attribute:: onGround - - Whether or not the character is on the ground. (read-only) - - :type: boolean - - .. attribute:: gravity - - The gravity value used for the character. - - :type: float - - .. attribute:: maxJumps - - The maximum number of jumps a character can perform before having to touch the ground. By default this is set to 1. 2 allows for a double jump, etc. - - :type: int in [0, 255], default 1 - - .. attribute:: jumpCount - - The current jump count. This can be used to have different logic for a single jump versus a double jump. For example, a different animation for the second jump. - - :type: int - - .. attribute:: walkDirection - - The speed and direction the character is traveling in using world coordinates. This should be used instead of applyMovement() to properly move the character. - - :type: Vector((x, y, z)) - - .. method:: jump() - - The character jumps based on it's jump speed. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintActuator.rst deleted file mode 100644 index 56c87cc110e..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintActuator.rst +++ /dev/null @@ -1,76 +0,0 @@ -KX_ConstraintActuator(SCA_IActuator) -==================================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_ConstraintActuator(SCA_IActuator) - - A constraint actuator limits the position, rotation, distance or orientation of an object. - - .. attribute:: damp - - Time constant of the constraint expressed in frame (not use by Force field constraint). - - :type: integer - - .. attribute:: rotDamp - - Time constant for the rotation expressed in frame (only for the distance constraint), 0 = use damp for rotation as well. - - :type: integer - - .. attribute:: direction - - The reference direction in world coordinate for the orientation constraint. - - :type: 3-tuple of float: (x, y, z) - - .. attribute:: option - - Binary combination of :ref:`these constants <constraint-actuator-option>` - - :type: integer - - .. attribute:: time - - activation time of the actuator. The actuator disables itself after this many frame. If set to 0, the actuator is not limited in time. - - :type: integer - - .. attribute:: propName - - the name of the property or material for the ray detection of the distance constraint. - - :type: string - - .. attribute:: min - - The lower bound of the constraint. For the rotation and orientation constraint, it represents radiant. - - :type: float - - .. attribute:: distance - - the target distance of the distance constraint. - - :type: float - - .. attribute:: max - - the upper bound of the constraint. For rotation and orientation constraints, it represents radiant. - - :type: float - - .. attribute:: rayLength - - the length of the ray of the distance constraint. - - :type: float - - .. attribute:: limit - - type of constraint. Use one of the :ref:`these constants <constraint-actuator-limit>` - - :type: integer. - - diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst deleted file mode 100644 index 77eec6bde78..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_ConstraintWrapper.rst +++ /dev/null @@ -1,140 +0,0 @@ -KX_ConstraintWrapper(PyObjectPlus) -================================== - -base class --- :class:`PyObjectPlus` - -.. class:: KX_ConstraintWrapper(PyObjectPlus) - - KX_ConstraintWrapper - - .. method:: getConstraintId(val) - - Returns the contraint ID - - :return: the constraint ID - :rtype: integer - - .. method:: setParam(axis, value0, value1) - - Set the contraint limits - - :arg axis: - :type axis: integer - - .. note:: - * Lowerlimit == Upperlimit -> axis is locked - * Lowerlimit > Upperlimit -> axis is free - * Lowerlimit < Upperlimit -> axis it limited in that range - - For PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3: - - axis = 3 is a constraint limit, with low/high limit value - * 3: X axis angle - - :arg value0 (min): Set the minimum limit of the axis - :type value0: float - :arg value1 (max): Set the maximum limit of the axis - :type value1: float - - For PHY_CONE_TWIST_CONSTRAINT = 4: - - axis = 3..5 are constraint limits, high limit values - * 3: X axis angle - * 4: Y axis angle - * 5: Z axis angle - - :arg value0 (min): Set the minimum limit of the axis - :type value0: float - :arg value1 (max): Set the maximum limit of the axis - :type value1: float - - For PHY_GENERIC_6DOF_CONSTRAINT = 12: - - axis = 0..2 are constraint limits, with low/high limit value - * 0: X axis position - * 1: Y axis position - * 2: Z axis position - - axis = 3..5 are relative constraint (Euler) angles in radians - * 3: X axis angle - * 4: Y axis angle - * 5: Z axis angle - - :arg value0 (min): Set the minimum limit of the axis - :type value0: float - :arg value1 (max): Set the maximum limit of the axis - :type value1: float - - axis = 6..8 are translational motors, with value0=target velocity, value1 = max motor force - * 6: X axis position - * 7: Y axis position - * 8: Z axis position - - axis = 9..11 are rotational motors, with value0=target velocity, value1 = max motor force - * 9: X axis angle - * 10: Y axis angle - * 11: Z axis angle - - :arg value0 (speed): Set the linear velocity of the axis - :type value0: float Range: -10,000.00 to 10,000.00 - :arg value1 (force): Set the maximum force limit of the axis - :type value1: float Range: -10,000.00 to 10,000.00 - - axis = 12..14 are for linear springs on each of the position of freedom - * 12: X axis position - * 13: Y axis position - * 14: Z axis position - - axis = 15..17 are for angular springs on each of the angle of freedom in radians - * 15: X axis angle - * 16: Y axis angle - * 17: Z axis angle - - :arg value0 (stiffness): Set the stiffness of the spring - :type value0: float - :arg value1 (damping): Tendency of the spring to return to it's original position - :type value1: float - 1.0 = springs back to original position (no damping) - 0.0 = don't springs back - - .. method:: getParam(axis) - - Get the contraint position or euler angle of a generic 6DOF constraint - - :arg axis: - :type axis: integer - - axis = 0..2 are linear constraint values - * 0: X axis position - * 1: Y axis position - * 2: Z axis position - - :return: position - :rtype: float - - axis = 3..5 are relative constraint (Euler) angles in radians - * 3: X axis angle - * 4: Y axis angle - * 5: Z axis angle - - :return: angle - :rtype: float - - .. attribute:: constraint_id - - Returns the contraint ID (read only) - - :type: integer - - .. attribute:: constraint_type - - Returns the contraint type (read only) - - :type: integer - - - :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT` - - :class:`~bge.constraints.LINEHINGE_CONSTRAINT` - - :class:`~bge.constraints.ANGULAR_CONSTRAINT` - - :class:`~bge.constraints.CONETWIST_CONSTRAINT` - - :class:`~bge.constraints.VEHICLE_CONSTRAINT` - - :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT` diff --git a/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst deleted file mode 100644 index f02609af0fa..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_FontObject.rst +++ /dev/null @@ -1,29 +0,0 @@ -KX_FontObject(KX_GameObject) -============================ - -base class --- :class:`KX_GameObject` - -.. class:: KX_FontObject(KX_GameObject) - - A Font object. - - .. code-block:: python - - # Display a message about the exit key using a Font object. - import bge - - co = bge.logic.getCurrentController() - font = co.owner - - exit_key = bge.events.EventToString(bge.logic.getExitKey()) - - if exit_key.endswith("KEY"): - exit_key = exit_key[:-3] - - font.text = "Press key '%s' to quit the game." % exit_key - - .. attribute:: text - - The text displayed by this Font object. - - :type: string diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_GameActuator.rst deleted file mode 100644 index a36c49d57e2..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_GameActuator.rst +++ /dev/null @@ -1,20 +0,0 @@ -KX_GameActuator(SCA_IActuator) -============================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_GameActuator(SCA_IActuator) - - The game actuator loads a new .blend file, restarts the current .blend file or quits the game. - - .. attribute:: fileName - - the new .blend file to load. - - :type: string - - .. attribute:: mode - - The mode of this actuator. Can be on of :ref:`these constants <game-actuator>` - - :type: Int diff --git a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst deleted file mode 100644 index 2797e8ef361..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst +++ /dev/null @@ -1,1011 +0,0 @@ -KX_GameObject(SCA_IObject) -========================== - -base class --- :class:`SCA_IObject` - -.. class:: KX_GameObject(SCA_IObject) - - All game objects are derived from this class. - - Properties assigned to game objects are accessible as attributes of this class. - - .. note:: - - Calling ANY method or attribute on an object that has been removed from a scene will raise a SystemError, - if an object may have been removed since last accessing it use the :data:`invalid` attribute to check. - - KX_GameObject can be subclassed to extend functionality. For example: - - .. code-block:: python - - import bge - - class CustomGameObject(bge.types.KX_GameObject): - RATE = 0.05 - - def __init__(self, old_owner): - # "old_owner" can just be ignored. At this point, "self" is - # already the object in the scene, and "old_owner" has been - # destroyed. - - # New attributes can be defined - but we could also use a game - # property, like "self['rate']". - self.rate = CustomGameObject.RATE - - def update(self): - self.worldPosition.z += self.rate - - # switch direction - if self.worldPosition.z > 1.0: - self.rate = -CustomGameObject.RATE - elif self.worldPosition.z < 0.0: - self.rate = CustomGameObject.RATE - - # Called first - def mutate(cont): - old_object = cont.owner - mutated_object = CustomGameObject(cont.owner) - - # After calling the constructor above, references to the old object - # should not be used. - assert(old_object is not mutated_object) - assert(old_object.invalid) - assert(mutated_object is cont.owner) - - # Called later - note we are now working with the mutated object. - def update(cont): - cont.owner.update() - - When subclassing objects other than empties and meshes, the specific type - should be used - e.g. inherit from :class:`BL_ArmatureObject` when the object - to mutate is an armature. - - .. attribute:: name - - The object's name. (read-only). - - :type: string - - .. attribute:: mass - - The object's mass - - :type: float - - .. note:: - - The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0. - - .. attribute:: isSuspendDynamics - - The object's dynamic state (read-only). - - :type: boolean - - .. seealso:: :py:meth:`suspendDynamics` and :py:meth:`restoreDynamics` allow you to change the state. - - .. attribute:: linearDamping - - The object's linear damping, also known as translational damping. Can be set simultaneously with angular damping using the :py:meth:`setDamping` method. - - :type: float between 0 and 1 inclusive. - - .. note:: - - The object must have a physics controller for the linear damping to be applied, otherwise the value will be returned as 0.0. - - .. attribute:: angularDamping - - The object's angular damping, also known as rotationation damping. Can be set simultaneously with linear damping using the :py:meth:`setDamping` method. - - :type: float between 0 and 1 inclusive. - - .. note:: - - The object must have a physics controller for the angular damping to be applied, otherwise the value will be returned as 0.0. - - - .. attribute:: linVelocityMin - - Enforces the object keeps moving at a minimum velocity. - - :type: float - - .. note:: - - Applies to dynamic and rigid body objects only. - - .. note:: - - A value of 0.0 disables this option. - - .. note:: - - While objects are stationary the minimum velocity will not be applied. - - .. attribute:: linVelocityMax - - Clamp the maximum linear velocity to prevent objects moving beyond a set speed. - - :type: float - - .. note:: - - Applies to dynamic and rigid body objects only. - - .. note:: - - A value of 0.0 disables this option (rather than setting it stationary). - - .. attribute:: angularVelocityMin - - Enforces the object keeps rotating at a minimum velocity. A value of 0.0 disables this. - - :type: non-negative float - - .. note:: - - Applies to dynamic and rigid body objects only. - While objects are stationary the minimum velocity will not be applied. - - - .. attribute:: angularVelocityMax - - Clamp the maximum angular velocity to prevent objects rotating beyond a set speed. - A value of 0.0 disables clamping; it does not stop rotation. - - :type: non-negative float - - .. note:: - - Applies to dynamic and rigid body objects only. - - .. attribute:: localInertia - - the object's inertia vector in local coordinates. Read only. - - :type: Vector((ix, iy, iz)) - - .. attribute:: parent - - The object's parent object. (read-only). - - :type: :class:`KX_GameObject` or None - - .. attribute:: groupMembers - - Returns the list of group members if the object is a group object (dupli group instance), otherwise None is returned. - - :type: :class:`CListValue` of :class:`KX_GameObject` or None - - .. attribute:: groupObject - - Returns the group object (dupli group instance) that the object belongs to or None if the object is not part of a group. - - :type: :class:`KX_GameObject` or None - - .. attribute:: collisionGroup - - The object's collision group. - - :type: bitfield - - .. attribute:: collisionMask - - The object's collision mask. - - :type: bitfield - - .. attribute:: collisionCallbacks - - A list of functions to be called when a collision occurs. - - :type: list of functions and/or methods - - Callbacks should either accept one argument `(object)`, or three - arguments `(object, point, normal)`. For simplicity, per - colliding object only the first collision point is reported. - - .. code-block:: python - - # Function form - def callback_three(object, point, normal): - print('Hit by %r at %s with normal %s' % (object.name, point, normal)) - - def callback_one(object): - print('Hit by %r' % object.name) - - def register_callback(controller): - controller.owner.collisionCallbacks.append(callback_three) - controller.owner.collisionCallbacks.append(callback_one) - - - # Method form - class YourGameEntity(bge.types.KX_GameObject): - def __init__(self, old_owner): - self.collisionCallbacks.append(self.on_collision_three) - self.collisionCallbacks.append(self.on_collision_one) - - def on_collision_three(self, object, point, normal): - print('Hit by %r at %s with normal %s' % (object.name, point, normal)) - - def on_collision_one(self, object): - print('Hit by %r' % object.name) - - .. note:: - For backward compatibility, a callback with variable number of - arguments (using `*args`) will be passed only the `object` - argument. Only when there is more than one fixed argument (not - counting `self` for methods) will the three-argument form be - used. - - .. attribute:: scene - - The object's scene. (read-only). - - :type: :class:`KX_Scene` or None - - .. attribute:: visible - - visibility flag. - - :type: boolean - - .. note:: - - Game logic will still run for invisible objects. - - .. attribute:: record_animation - - Record animation for this object. - - :type: boolean - - .. attribute:: color - - The object color of the object. [r, g, b, a] - - :type: :class:`mathutils.Vector` - - .. attribute:: occlusion - - occlusion capability flag. - - :type: boolean - - .. attribute:: position - - The object's position. [x, y, z] On write: local position, on read: world position - - .. deprecated:: use :data:`localPosition` and :data:`worldPosition`. - - :type: :class:`mathutils.Vector` - - .. attribute:: orientation - - The object's orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. On write: local orientation, on read: world orientation - - .. deprecated:: use :data:`localOrientation` and :data:`worldOrientation`. - - :type: :class:`mathutils.Matrix` - - .. attribute:: scaling - - The object's scaling factor. [sx, sy, sz] On write: local scaling, on read: world scaling - - .. deprecated:: use :data:`localScale` and :data:`worldScale`. - - :type: :class:`mathutils.Vector` - - .. attribute:: localOrientation - - The object's local orientation. 3x3 Matrix. You can also write a Quaternion or Euler vector. - - :type: :class:`mathutils.Matrix` - - .. attribute:: worldOrientation - - The object's world orientation. 3x3 Matrix. - - :type: :class:`mathutils.Matrix` - - .. attribute:: localScale - - The object's local scaling factor. [sx, sy, sz] - - :type: :class:`mathutils.Vector` - - .. attribute:: worldScale - - The object's world scaling factor. [sx, sy, sz] - - :type: :class:`mathutils.Vector` - - .. attribute:: localPosition - - The object's local position. [x, y, z] - - :type: :class:`mathutils.Vector` - - .. attribute:: worldPosition - - The object's world position. [x, y, z] - - :type: :class:`mathutils.Vector` - - .. attribute:: localTransform - - The object's local space transform matrix. 4x4 Matrix. - - :type: :class:`mathutils.Matrix` - - .. attribute:: worldTransform - - The object's world space transform matrix. 4x4 Matrix. - - :type: :class:`mathutils.Matrix` - - .. attribute:: localLinearVelocity - - The object's local linear velocity. [x, y, z] - - :type: :class:`mathutils.Vector` - - .. attribute:: worldLinearVelocity - - The object's world linear velocity. [x, y, z] - - :type: :class:`mathutils.Vector` - - .. attribute:: localAngularVelocity - - The object's local angular velocity. [x, y, z] - - :type: :class:`mathutils.Vector` - - .. attribute:: worldAngularVelocity - - The object's world angular velocity. [x, y, z] - - :type: :class:`mathutils.Vector` - - .. attribute:: timeOffset - - adjust the slowparent delay at runtime. - - :type: float - - .. attribute:: state - - the game object's state bitmask, using the first 30 bits, one bit must always be set. - - :type: int - - .. attribute:: meshes - - a list meshes for this object. - - :type: list of :class:`KX_MeshProxy` - - .. note:: - - Most objects use only 1 mesh. - - .. note:: - - Changes to this list will not update the KX_GameObject. - - .. attribute:: sensors - - a sequence of :class:`SCA_ISensor` objects with string/index lookups and iterator support. - - :type: list - - .. note:: - - This attribute is experimental and may be removed (but probably wont be). - - .. note:: - - Changes to this list will not update the KX_GameObject. - - .. attribute:: controllers - - a sequence of :class:`SCA_IController` objects with string/index lookups and iterator support. - - :type: list of :class:`SCA_ISensor` - - .. note:: - - This attribute is experimental and may be removed (but probably wont be). - - .. note:: - - Changes to this list will not update the KX_GameObject. - - .. attribute:: actuators - - a list of :class:`SCA_IActuator` with string/index lookups and iterator support. - - :type: list - - .. note:: - - This attribute is experemental and may be removed (but probably wont be). - - .. note:: - - Changes to this list will not update the KX_GameObject. - - .. attribute:: attrDict - - get the objects internal python attribute dictionary for direct (faster) access. - - :type: dict - - .. attribute:: children - - direct children of this object, (read-only). - - :type: :class:`CListValue` of :class:`KX_GameObject`'s - - .. attribute:: childrenRecursive - - all children of this object including children's children, (read-only). - - :type: :class:`CListValue` of :class:`KX_GameObject`'s - - .. attribute:: life - - The number of seconds until the object ends, assumes 50fps. - (when added with an add object actuator), (read-only). - - :type: float - - .. attribute:: debug - - If true, the object's debug properties will be displayed on screen. - - :type: boolean - - .. attribute:: debugRecursive - - If true, the object's and children's debug properties will be displayed on screen. - - :type: boolean - - .. attribute:: currentLodLevel - - The index of the level of detail (LOD) currently used by this object (read-only). - - :type: int - - .. method:: endObject() - - Delete this object, can be used in place of the EndObject Actuator. - - The actual removal of the object from the scene is delayed. - - .. method:: replaceMesh(mesh, useDisplayMesh=True, usePhysicsMesh=False) - - Replace the mesh of this object with a new mesh. This works the same was as the actuator. - - :arg mesh: mesh to replace or the meshes name. - :type mesh: :class:`MeshProxy` or string - :arg useDisplayMesh: when enabled the display mesh will be replaced (optional argument). - :type useDisplayMesh: boolean - :arg usePhysicsMesh: when enabled the physics mesh will be replaced (optional argument). - :type usePhysicsMesh: boolean - - .. method:: setVisible(visible, recursive) - - Sets the game object's visible flag. - - :arg visible: the visible state to set. - :type visible: boolean - :arg recursive: optional argument to set all childrens visibility flag too. - :type recursive: boolean - - .. method:: setOcclusion(occlusion, recursive) - - Sets the game object's occlusion capability. - - :arg occlusion: the state to set the occlusion to. - :type occlusion: boolean - :arg recursive: optional argument to set all childrens occlusion flag too. - :type recursive: boolean - - .. method:: alignAxisToVect(vect, axis=2, factor=1.0) - - Aligns any of the game object's axis along the given vector. - - - :arg vect: a vector to align the axis. - :type vect: 3D vector - :arg axis: The axis you want to align - - * 0: X axis - * 1: Y axis - * 2: Z axis - - :type axis: integer - :arg factor: Only rotate a feaction of the distance to the target vector (0.0 - 1.0) - :type factor: float - - .. method:: getAxisVect(vect) - - Returns the axis vector rotates by the object's worldspace orientation. - This is the equivalent of multiplying the vector by the orientation matrix. - - :arg vect: a vector to align the axis. - :type vect: 3D Vector - :return: The vector in relation to the objects rotation. - :rtype: 3d vector. - - .. method:: applyMovement(movement, local=False) - - Sets the game object's movement. - - :arg movement: movement vector. - :type movement: 3D Vector - :arg local: - * False: you get the "global" movement ie: relative to world orientation. - * True: you get the "local" movement ie: relative to object orientation. - :arg local: boolean - - .. method:: applyRotation(rotation, local=False) - - Sets the game object's rotation. - - :arg rotation: rotation vector. - :type rotation: 3D Vector - :arg local: - * False: you get the "global" rotation ie: relative to world orientation. - * True: you get the "local" rotation ie: relative to object orientation. - :arg local: boolean - - .. method:: applyForce(force, local=False) - - Sets the game object's force. - - This requires a dynamic object. - - :arg force: force vector. - :type force: 3D Vector - :arg local: - * False: you get the "global" force ie: relative to world orientation. - * True: you get the "local" force ie: relative to object orientation. - :type local: boolean - - .. method:: applyTorque(torque, local=False) - - Sets the game object's torque. - - This requires a dynamic object. - - :arg torque: torque vector. - :type torque: 3D Vector - :arg local: - * False: you get the "global" torque ie: relative to world orientation. - * True: you get the "local" torque ie: relative to object orientation. - :type local: boolean - - .. method:: getLinearVelocity(local=False) - - Gets the game object's linear velocity. - - This method returns the game object's velocity through it's center of mass, ie no angular velocity component. - - :arg local: - * False: you get the "global" velocity ie: relative to world orientation. - * True: you get the "local" velocity ie: relative to object orientation. - :type local: boolean - :return: the object's linear velocity. - :rtype: Vector((vx, vy, vz)) - - .. method:: setLinearVelocity(velocity, local=False) - - Sets the game object's linear velocity. - - This method sets game object's velocity through it's center of mass, - ie no angular velocity component. - - This requires a dynamic object. - - :arg velocity: linear velocity vector. - :type velocity: 3D Vector - :arg local: - * False: you get the "global" velocity ie: relative to world orientation. - * True: you get the "local" velocity ie: relative to object orientation. - :type local: boolean - - .. method:: getAngularVelocity(local=False) - - Gets the game object's angular velocity. - - :arg local: - * False: you get the "global" velocity ie: relative to world orientation. - * True: you get the "local" velocity ie: relative to object orientation. - :type local: boolean - :return: the object's angular velocity. - :rtype: Vector((vx, vy, vz)) - - .. method:: setAngularVelocity(velocity, local=False) - - Sets the game object's angular velocity. - - This requires a dynamic object. - - :arg velocity: angular velocity vector. - :type velocity: boolean - :arg local: - * False: you get the "global" velocity ie: relative to world orientation. - * True: you get the "local" velocity ie: relative to object orientation. - - .. method:: getVelocity(point=(0, 0, 0)) - - Gets the game object's velocity at the specified point. - - Gets the game object's velocity at the specified point, including angular - components. - - :arg point: optional point to return the velocity for, in local coordinates. - :type point: 3D Vector - :return: the velocity at the specified point. - :rtype: Vector((vx, vy, vz)) - - .. method:: getReactionForce() - - Gets the game object's reaction force. - - The reaction force is the force applied to this object over the last simulation timestep. - This also includes impulses, eg from collisions. - - :return: the reaction force of this object. - :rtype: Vector((fx, fy, fz)) - - .. note:: - - This is not implimented at the moment. - - .. method:: applyImpulse(point, impulse, local=False) - - Applies an impulse to the game object. - - This will apply the specified impulse to the game object at the specified point. - If point != position, applyImpulse will also change the object's angular momentum. - Otherwise, only linear momentum will change. - - :arg point: the point to apply the impulse to (in world or local coordinates) - :type point: point [ix, iy, iz] the point to apply the impulse to (in world or local coordinates) - :arg impulse: impulse vector. - :type impulse: 3D Vector - :arg local: - * False: you get the "global" impulse ie: relative to world coordinates with world orientation. - * True: you get the "local" impulse ie: relative to local coordinates with object orientation. - :type local: boolean - - .. method:: setDamping(linear_damping, angular_damping) - - Sets both the :py:attr:`linearDamping` and :py:attr:`angularDamping` simultaneously. This is more efficient than setting both properties individually. - - :arg linear_damping: Linear ("translational") damping factor. - :type linear_damping: float ∈ [0, 1] - :arg angular_damping: Angular ("rotational") damping factor. - :type angular_damping: float ∈ [0, 1] - - .. method:: suspendDynamics([ghost]) - - Suspends physics for this object. - - :arg ghost: When set to `True`, collisions with the object will be ignored, similar to the "ghost" checkbox in - Blender. When `False` (the default), the object becomes static but still collide with other objects. - :type ghost: bool - - .. seealso:: :py:attr:`isSuspendDynamics` allows you to inspect whether the object is in a suspended state. - - .. method:: restoreDynamics() - - Resumes physics for this object. Also reinstates collisions; the object will no longer be a ghost. - - .. note:: - - The objects linear velocity will be applied from when the dynamics were suspended. - - .. method:: enableRigidBody() - - Enables rigid body physics for this object. - - Rigid body physics allows the object to roll on collisions. - - .. method:: disableRigidBody() - - Disables rigid body physics for this object. - - .. method:: setParent(parent, compound=True, ghost=True) - - Sets this object's parent. - Control the shape status with the optional compound and ghost parameters: - - In that case you can control if it should be ghost or not: - - :arg parent: new parent object. - :type parent: :class:`KX_GameObject` - :arg compound: whether the shape should be added to the parent compound shape. - - * True: the object shape should be added to the parent compound shape. - * False: the object should keep its individual shape. - - :type compound: boolean - :arg ghost: whether the object should be ghost while parented. - - * True: if the object should be made ghost while parented. - * False: if the object should be solid while parented. - - :type ghost: boolean - - .. note:: - - If the object type is sensor, it stays ghost regardless of ghost parameter - - .. method:: removeParent() - - Removes this objects parent. - - .. method:: getPhysicsId() - - Returns the user data object associated with this game object's physics controller. - - .. method:: getPropertyNames() - - Gets a list of all property names. - - :return: All property names for this object. - :rtype: list - - .. method:: getDistanceTo(other) - - :arg other: a point or another :class:`KX_GameObject` to measure the distance to. - :type other: :class:`KX_GameObject` or list [x, y, z] - :return: distance to another object or point. - :rtype: float - - .. method:: getVectTo(other) - - Returns the vector and the distance to another object or point. - The vector is normalized unless the distance is 0, in which a zero length vector is returned. - - :arg other: a point or another :class:`KX_GameObject` to get the vector and distance to. - :type other: :class:`KX_GameObject` or list [x, y, z] - :return: (distance, globalVector(3), localVector(3)) - :rtype: 3-tuple (float, 3-tuple (x, y, z), 3-tuple (x, y, z)) - - .. method:: rayCastTo(other, dist, prop) - - Look towards another point/object and find first object hit within dist that matches prop. - - The ray is always casted from the center of the object, ignoring the object itself. - The ray is casted towards the center of another object or an explicit [x, y, z] point. - Use rayCast() if you need to retrieve the hit point - - :arg other: [x, y, z] or object towards which the ray is casted - :type other: :class:`KX_GameObject` or 3-tuple - :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to other - :type dist: float - :arg prop: property name that object must have; can be omitted => detect any object - :type prop: string - :return: the first object hit or None if no object or object does not match prop - :rtype: :class:`KX_GameObject` - - .. method:: rayCast(objto, objfrom, dist, prop, face, xray, poly, mask) - - Look from a point/object to another point/object and find first object hit within dist that matches prop. - if poly is 0, returns a 3-tuple with object reference, hit point and hit normal or (None, None, None) if no hit. - if poly is 1, returns a 4-tuple with in addition a :class:`KX_PolyProxy` as 4th element. - if poly is 2, returns a 5-tuple with in addition a 2D vector with the UV mapping of the hit point as 5th element. - - .. code-block:: python - - # shoot along the axis gun-gunAim (gunAim should be collision-free) - obj, point, normal = gun.rayCast(gunAim, None, 50) - if obj: - # do something - pass - - The face parameter determines the orientation of the normal. - - * 0 => hit normal is always oriented towards the ray origin (as if you casted the ray from outside) - * 1 => hit normal is the real face normal (only for mesh object, otherwise face has no effect) - - The ray has X-Ray capability if xray parameter is 1, otherwise the first object hit (other than self object) stops the ray. - The prop and xray parameters interact as follow. - - * prop off, xray off: return closest hit or no hit if there is no object on the full extend of the ray. - * prop off, xray on : idem. - * prop on, xray off: return closest hit if it matches prop, no hit otherwise. - * prop on, xray on : return closest hit matching prop or no hit if there is no object matching prop on the full extend of the ray. - - The :class:`KX_PolyProxy` 4th element of the return tuple when poly=1 allows to retrieve information on the polygon hit by the ray. - If there is no hit or the hit object is not a static mesh, None is returned as 4th element. - - The ray ignores collision-free objects and faces that dont have the collision flag enabled, you can however use ghost objects. - - :arg objto: [x, y, z] or object to which the ray is casted - :type objto: :class:`KX_GameObject` or 3-tuple - :arg objfrom: [x, y, z] or object from which the ray is casted; None or omitted => use self object center - :type objfrom: :class:`KX_GameObject` or 3-tuple or None - :arg dist: max distance to look (can be negative => look behind); 0 or omitted => detect up to to - :type dist: float - :arg prop: property name that object must have; can be omitted or "" => detect any object - :type prop: string - :arg face: normal option: 1=>return face normal; 0 or omitted => normal is oriented towards origin - :type face: integer - :arg xray: X-ray option: 1=>skip objects that don't match prop; 0 or omitted => stop on first object - :type xray: integer - :arg poly: polygon option: 0, 1 or 2 to return a 3-, 4- or 5-tuple with information on the face hit. - - * 0 or omitted: return value is a 3-tuple (object, hitpoint, hitnormal) or (None, None, None) if no hit - * 1: return value is a 4-tuple and the 4th element is a :class:`KX_PolyProxy` or None if no hit or the object doesn't use a mesh collision shape. - * 2: return value is a 5-tuple and the 5th element is a 2-tuple (u, v) with the UV mapping of the hit point or None if no hit, or the object doesn't use a mesh collision shape, or doesn't have a UV mapping. - - :type poly: integer - :arg mask: collision mask: The collision mask (16 layers mapped to a 16-bit integer) is combined with each object's collision group, to hit only a subset of the objects in the scene. Only those objects for which ``collisionGroup & mask`` is true can be hit. - :type mask: bitfield - :return: (object, hitpoint, hitnormal) or (object, hitpoint, hitnormal, polygon) or (object, hitpoint, hitnormal, polygon, hituv). - - * object, hitpoint and hitnormal are None if no hit. - * polygon is valid only if the object is valid and is a static object, a dynamic object using mesh collision shape or a soft body object, otherwise it is None - * hituv is valid only if polygon is valid and the object has a UV mapping, otherwise it is None - - :rtype: - - * 3-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz)) - * or 4-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`KX_PolyProxy`) - * or 5-tuple (:class:`KX_GameObject`, 3-tuple (x, y, z), 3-tuple (nx, ny, nz), :class:`KX_PolyProxy`, 2-tuple (u, v)) - - .. note:: - - The ray ignores the object on which the method is called. It is casted from/to object center or explicit [x, y, z] points. - - .. method:: setCollisionMargin(margin) - - Set the objects collision margin. - - :arg margin: the collision margin distance in blender units. - :type margin: float - - .. note:: - - If this object has no physics controller (a physics ID of zero), this function will raise RuntimeError. - - .. method:: sendMessage(subject, body="", to="") - - Sends a message. - - :arg subject: The subject of the message - :type subject: string - :arg body: The body of the message (optional) - :type body: string - :arg to: The name of the object to send the message to (optional) - :type to: string - - .. method:: reinstancePhysicsMesh(gameObject, meshObject) - - Updates the physics system with the changed mesh. - - If no arguments are given the physics mesh will be re-created from the first mesh assigned to the game object. - - :arg gameObject: optional argument, set the physics shape from this gameObjets mesh. - :type gameObject: string, :class:`KX_GameObject` or None - :arg meshObject: optional argument, set the physics shape from this mesh. - :type meshObject: string, :class:`MeshProxy` or None - - :return: True if reinstance succeeded, False if it failed. - :rtype: boolean - - .. note:: - - If this object has instances the other instances will be updated too. - - .. note:: - - The gameObject argument has an advantage that it can convert from a mesh with modifiers applied (such as the Subdivision Surface modifier). - - .. warning:: - - Only triangle mesh type objects are supported currently (not convex hull) - - .. warning:: - - If the object is a part of a compound object it will fail (parent or child) - - .. warning:: - - Rebuilding the physics mesh can be slow, running many times per second will give a performance hit. - - .. method:: get(key, default=None) - - Return the value matching key, or the default value if its not found. - :return: The key value or a default. - - .. method:: playAction(name, start_frame, end_frame, layer=0, priority=0, blendin=0, play_mode=KX_ACTION_MODE_PLAY, layer_weight=0.0, ipo_flags=0, speed=1.0, blend_mode=KX_ACTION_BLEND_BLEND) - - Plays an action. - - :arg name: the name of the action - :type name: string - :arg start: the start frame of the action - :type start: float - :arg end: the end frame of the action - :type end: float - :arg layer: the layer the action will play in (actions in different layers are added/blended together) - :type layer: integer - :arg priority: only play this action if there isn't an action currently playing in this layer with a higher (lower number) priority - :type priority: integer - :arg blendin: the amount of blending between this animation and the previous one on this layer - :type blendin: float - :arg play_mode: the play mode - :type play_mode: one of :ref:`these constants <gameobject-playaction-mode>` - :arg layer_weight: how much of the previous layer to use for blending - :type layer_weight: float - :arg ipo_flags: flags for the old IPO behaviors (force, etc) - :type ipo_flags: int bitfield - :arg speed: the playback speed of the action as a factor (1.0 = normal speed, 2.0 = 2x speed, etc) - :type speed: float - :arg blend_mode: how to blend this layer with previous layers - :type blend_mode: one of :ref:`these constants <gameobject-playaction-blend>` - - .. method:: stopAction(layer=0) - - Stop playing the action on the given layer. - - :arg layer: The layer to stop playing. - :type layer: integer - - .. method:: getActionFrame(layer=0) - - Gets the current frame of the action playing in the supplied layer. - - :arg layer: The layer that you want to get the frame from. - :type layer: integer - - :return: The current frame of the action - :rtype: float - - .. method:: getActionName(layer=0) - - Gets the name of the current action playing in the supplied layer. - - :arg layer: The layer that you want to get the action name from. - :type layer: integer - - :return: The name of the current action - :rtype: string - - .. method:: setActionFrame(frame, layer=0) - - Set the current frame of the action playing in the supplied layer. - - :arg layer: The layer where you want to set the frame - :type layer: integer - :arg frame: The frame to set the action to - :type frame: float - - .. method:: isPlayingAction(layer=0) - - Checks to see if there is an action playing in the given layer. - - :arg layer: The layer to check for a playing action. - :type layer: integer - - :return: Whether or not the action is playing - :rtype: boolean - - .. method:: addDebugProperty (name, debug = True) - - Adds a single debug property to the debug list. - - :arg name: name of the property that added to the debug list. - :type name: string - :arg debug: the debug state. - :type debug: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.KX_LibLoadStatus.rst b/doc/python_api/rst/bge_types/bge.types.KX_LibLoadStatus.rst deleted file mode 100644 index 3e7d370476e..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_LibLoadStatus.rst +++ /dev/null @@ -1,48 +0,0 @@ -KX_LibLoadStatus(PyObjectPlus) -============================== - -base class --- :class:`PyObjectPlus` - -.. class:: KX_LibLoadStatus(PyObjectPlus) - - An object providing information about a LibLoad() operation. - - .. code-block:: python - - # Print a message when an async LibLoad is done - import bge - - def finished_cb(status): - print("Library (%s) loaded in %.2fms." % (status.libraryName, status.timeTaken)) - - bge.logic.LibLoad('myblend.blend', 'Scene', async=True).onFinish = finished_cb - - .. attribute:: onFinish - - A callback that gets called when the lib load is done. - - :type: callable - - .. attribute:: finished - - The current status of the lib load. - - :type: boolean - - .. attribute:: progress - - The current progress of the lib load as a normalized value from 0.0 to 1.0. - - :type: float - - .. attribute:: libraryName - - The name of the library being loaded (the first argument to LibLoad). - - :type: string - - .. attribute:: timeTaken - - The amount of time, in seconds, the lib load took (0 until the operation is complete). - - :type: float diff --git a/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst deleted file mode 100644 index ca4e4eaf1b3..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_LightObject.rst +++ /dev/null @@ -1,161 +0,0 @@ -KX_LightObject(KX_GameObject) -============================= - -base class --- :class:`KX_GameObject` - -.. class:: KX_LightObject(KX_GameObject) - - A Light object. - - .. code-block:: python - - # Turn on a red alert light. - import bge - - co = bge.logic.getCurrentController() - light = co.owner - - light.energy = 1.0 - light.color = [1.0, 0.0, 0.0] - - .. data:: SPOT - - A spot light source. See attribute :data:`type` - - .. data:: SUN - - A point light source with no attenuation. See attribute :data:`type` - - .. data:: NORMAL - - A point light source. See attribute :data:`type` - - .. attribute:: type - - The type of light - must be SPOT, SUN or NORMAL - - .. attribute:: layer - - The layer mask that this light affects object on. - - :type: bitfield - - .. attribute:: energy - - The brightness of this light. - - :type: float - - .. attribute:: shadowClipStart - - The shadowmap clip start, below which objects will not generate shadows. - - :type: float (read only) - - .. attribute:: shadowClipEnd - - The shadowmap clip end, beyond which objects will not generate shadows. - - :type: float (read only) - - .. attribute:: shadowFrustumSize - - Size of the frustum used for creating the shadowmap. - - :type: float (read only) - - .. attribute:: shadowBindId - - The OpenGL shadow texture bind number/id. - - :type: int (read only) - - .. attribute:: shadowMapType - - The shadow shadow map type (0 -> Simple; 1 -> Variance) - - :type: int (read only) - - .. attribute:: shadowBias - - The shadow buffer sampling bias. - - :type: float (read only) - - .. attribute:: shadowBleedBias - - The bias for reducing light-bleed on variance shadow maps. - - :type: float (read only) - - .. attribute:: useShadow - - Returns True if the light has Shadow option activated, else returns False. - - :type: boolean (read only) - - .. attribute:: shadowColor - - The color of this light shadows. Black = (0.0, 0.0, 0.0), White = (1.0, 1.0, 1.0). - - :type: :class:`mathutils.Color` (read only) - - .. attribute:: shadowMatrix - - Matrix that converts a vector in camera space to shadow buffer depth space. - - Computed as: - mat4_perspective_to_depth * mat4_lamp_to_perspective * mat4_world_to_lamp * mat4_cam_to_world. - - mat4_perspective_to_depth is a fixed matrix defined as follow: - - 0.5 0.0 0.0 0.5 - 0.0 0.5 0.0 0.5 - 0.0 0.0 0.5 0.5 - 0.0 0.0 0.0 1.0 - - .. note: - - There is one matrix of that type per lamp casting shadow in the scene. - - :type: Matrix4x4 (read only) - - .. attribute:: distance - - The maximum distance this light can illuminate. (SPOT and NORMAL lights only). - - :type: float - - .. attribute:: color - - The color of this light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]. - - :type: list [r, g, b] - - .. attribute:: lin_attenuation - - The linear component of this light's attenuation. (SPOT and NORMAL lights only). - - :type: float - - .. attribute:: quad_attenuation - - The quadratic component of this light's attenuation (SPOT and NORMAL lights only). - - :type: float - - .. attribute:: spotsize - - The cone angle of the spot light, in degrees (SPOT lights only). - - :type: float in [0 - 180]. - - .. attribute:: spotblend - - Specifies the intensity distribution of the spot light (SPOT lights only). - - :type: float in [0 - 1] - - .. note:: - - Higher values result in a more focused light source. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst b/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst deleted file mode 100644 index c009db17e4d..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_MeshProxy.rst +++ /dev/null @@ -1,131 +0,0 @@ -KX_MeshProxy(SCA_IObject) -========================= - -base class --- :class:`SCA_IObject` - -.. class:: KX_MeshProxy(SCA_IObject) - - A mesh object. - - You can only change the vertex properties of a mesh object, not the mesh topology. - - To use mesh objects effectively, you should know a bit about how the game engine handles them. - - #. Mesh Objects are converted from Blender at scene load. - #. The Converter groups polygons by Material. This means they can be sent to the renderer efficiently. A material holds: - - #. The texture. - #. The Blender material. - #. The Tile properties - #. The face properties - (From the "Texture Face" panel) - #. Transparency & z sorting - #. Light layer - #. Polygon shape (triangle/quad) - #. Game Object - - #. Vertices will be split by face if necessary. Vertices can only be shared between faces if: - - #. They are at the same position - #. UV coordinates are the same - #. Their normals are the same (both polygons are "Set Smooth") - #. They are the same color, for example: a cube has 24 vertices: 6 faces with 4 vertices per face. - - The correct method of iterating over every :class:`KX_VertexProxy` in a game object - - .. code-block:: python - - from bge import logic - - cont = logic.getCurrentController() - object = cont.owner - - for mesh in object.meshes: - for m_index in range(len(mesh.materials)): - for v_index in range(mesh.getVertexArrayLength(m_index)): - vertex = mesh.getVertex(m_index, v_index) - # Do something with vertex here... - # ... eg: color the vertex red. - vertex.color = [1.0, 0.0, 0.0, 1.0] - - .. attribute:: materials - - :type: list of :class:`KX_BlenderMaterial` type - - .. attribute:: numPolygons - - :type: integer - - .. attribute:: numMaterials - - :type: integer - - .. method:: getMaterialName(matid) - - Gets the name of the specified material. - - :arg matid: the specified material. - :type matid: integer - :return: the attached material name. - :rtype: string - - .. method:: getTextureName(matid) - - Gets the name of the specified material's texture. - - :arg matid: the specified material - :type matid: integer - :return: the attached material's texture name. - :rtype: string - - .. method:: getVertexArrayLength(matid) - - Gets the length of the vertex array associated with the specified material. - - There is one vertex array for each material. - - :arg matid: the specified material - :type matid: integer - :return: the number of verticies in the vertex array. - :rtype: integer - - .. method:: getVertex(matid, index) - - Gets the specified vertex from the mesh object. - - :arg matid: the specified material - :type matid: integer - :arg index: the index into the vertex array. - :type index: integer - :return: a vertex object. - :rtype: :class:`KX_VertexProxy` - - .. method:: getPolygon(index) - - Gets the specified polygon from the mesh. - - :arg index: polygon number - :type index: integer - :return: a polygon object. - :rtype: :class:`KX_PolyProxy` - - .. method:: transform(matid, matrix) - - Transforms the vertices of a mesh. - - :arg matid: material index, -1 transforms all. - :type matid: integer - :arg matrix: transformation matrix. - :type matrix: 4x4 matrix [[float]] - - .. method:: transformUV(matid, matrix, uv_index=-1, uv_index_from=-1) - - Transforms the vertices UV's of a mesh. - - :arg matid: material index, -1 transforms all. - :type matid: integer - :arg matrix: transformation matrix. - :type matrix: 4x4 matrix [[float]] - :arg uv_index: optional uv index, -1 for all, otherwise 0 or 1. - :type uv_index: integer - :arg uv_index_from: optional uv index to copy from, -1 to transform the current uv. - :type uv_index_from: integer diff --git a/doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst deleted file mode 100644 index e0fe32baa2b..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_MouseActuator.rst +++ /dev/null @@ -1,100 +0,0 @@ -KX_MouseActuator(SCA_IActuator) -==================================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_MouseActuator(SCA_IActuator) - - The mouse actuator gives control over the visibility of the mouse cursor and rotates the parent object according to mouse movement. - - .. method:: reset() - - Undoes the rotation caused by the mouse actuator. - - .. attribute:: visible - - The visibility of the mouse cursor. - - :type: boolean - - .. attribute:: use_axis_x - - Mouse movement along the x axis effects object rotation. - - :type: boolean - - .. attribute:: use_axis_y - - Mouse movement along the y axis effects object rotation. - - :type: boolean - - .. attribute:: threshold - - Amount of movement from the mouse required before rotation is triggered. - - :type: list (vector of 2 floats) - - The values in the list should be between 0.0 and 0.5. - - .. attribute:: reset_x - - Mouse is locked to the center of the screen on the x axis. - - :type: boolean - - .. attribute:: reset_y - - Mouse is locked to the center of the screen on the y axis. - - :type: boolean - - .. attribute:: object_axis - - The object's 3D axis to rotate with the mouse movement. ([x, y]) - - :type: list (vector of 2 integers from 0 to 2) - - * KX_ACT_MOUSE_OBJECT_AXIS_X - * KX_ACT_MOUSE_OBJECT_AXIS_Y - * KX_ACT_MOUSE_OBJECT_AXIS_Z - - .. attribute:: local_x - - Rotation caused by mouse movement along the x axis is local. - - :type: boolean - - .. attribute:: local_y - - Rotation caused by mouse movement along the y axis is local. - - :type: boolean - - .. attribute:: sensitivity - - The amount of rotation caused by mouse movement along the x and y axis. - - :type: list (vector of 2 floats) - - Negative values invert the rotation. - - .. attribute:: limit_x - - The minimum and maximum angle of rotation caused by mouse movement along the x axis in degrees. - limit_x[0] is minimum, limit_x[1] is maximum. - - :type: list (vector of 2 floats) - - .. attribute:: limit_y - - The minimum and maximum angle of rotation caused by mouse movement along the y axis in degrees. - limit_y[0] is minimum, limit_y[1] is maximum. - - :type: list (vector of 2 floats) - - .. attribute:: angle - - The current rotational offset caused by the mouse actuator in degrees. - - :type: list (vector of 2 floats) diff --git a/doc/python_api/rst/bge_types/bge.types.KX_MouseFocusSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_MouseFocusSensor.rst deleted file mode 100644 index 1d7eb007c1e..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_MouseFocusSensor.rst +++ /dev/null @@ -1,81 +0,0 @@ -KX_MouseFocusSensor(SCA_MouseSensor) -==================================== - -base class --- :class:`SCA_MouseSensor` - -.. class:: KX_MouseFocusSensor(SCA_MouseSensor) - - The mouse focus sensor detects when the mouse is over the current game object. - - The mouse focus sensor works by transforming the mouse coordinates from 2d device - space to 3d space then raycasting away from the camera. - - .. attribute:: raySource - - The worldspace source of the ray (the view position). - - :type: list (vector of 3 floats) - - .. attribute:: rayTarget - - The worldspace target of the ray. - - :type: list (vector of 3 floats) - - .. attribute:: rayDirection - - The :data:`rayTarget` - :class:`raySource` normalized. - - :type: list (normalized vector of 3 floats) - - .. attribute:: hitObject - - the last object the mouse was over. - - :type: :class:`KX_GameObject` or None - - .. attribute:: hitPosition - - The worldspace position of the ray intersecton. - - :type: list (vector of 3 floats) - - .. attribute:: hitNormal - - the worldspace normal from the face at point of intersection. - - :type: list (normalized vector of 3 floats) - - .. attribute:: hitUV - - the UV coordinates at the point of intersection. - - :type: list (vector of 2 floats) - - If the object has no UV mapping, it returns [0, 0]. - - The UV coordinates are not normalized, they can be < 0 or > 1 depending on the UV mapping. - - .. attribute:: usePulseFocus - - When enabled, moving the mouse over a different object generates a pulse. (only used when the 'Mouse Over Any' sensor option is set). - - :type: boolean - - .. attribute:: useXRay - - If enabled it allows the sensor to see through game objects that don't have the selected property or material. - - :type: boolean - - .. attribute:: propName - - The property or material the sensor is looking for. - - :type: string - - .. attribute:: useMaterial - - Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property. - - :type: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NavMeshObject.rst b/doc/python_api/rst/bge_types/bge.types.KX_NavMeshObject.rst deleted file mode 100644 index 00d51108937..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_NavMeshObject.rst +++ /dev/null @@ -1,44 +0,0 @@ -KX_NavMeshObject(KX_GameObject) -=============================== - -base class --- :class:`KX_GameObject` - -.. class:: KX_NavMeshObject(KX_GameObject) - - Python interface for using and controlling navigation meshes. - - .. method:: findPath(start, goal) - - Finds the path from start to goal points. - - :arg start: the start point - :arg start: 3D Vector - :arg goal: the goal point - :arg start: 3D Vector - :return: a path as a list of points - :rtype: list of points - - .. method:: raycast(start, goal) - - Raycast from start to goal points. - - :arg start: the start point - :arg start: 3D Vector - :arg goal: the goal point - :arg start: 3D Vector - :return: the hit factor - :rtype: float - - .. method:: draw(mode) - - Draws a debug mesh for the navigation mesh. - - :arg mode: the drawing mode (one of :ref:`these constants <navmesh-draw-mode>`) - :arg mode: integer - :return: None - - .. method:: rebuild() - - Rebuild the navigation mesh. - - :return: None diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NearSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_NearSensor.rst deleted file mode 100644 index 91969dfc79d..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_NearSensor.rst +++ /dev/null @@ -1,20 +0,0 @@ -KX_NearSensor(KX_TouchSensor) -============================= - -base class --- :class:`KX_TouchSensor` - -.. class:: KX_NearSensor(KX_TouchSensor) - - A near sensor is a specialised form of touch sensor. - - .. attribute:: distance - - The near sensor activates when an object is within this distance. - - :type: float - - .. attribute:: resetDistance - - The near sensor deactivates when the object exceeds this distance. - - :type: float diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageActuator.rst deleted file mode 100644 index 525289ae71f..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageActuator.rst +++ /dev/null @@ -1,32 +0,0 @@ -KX_NetworkMessageActuator(SCA_IActuator) -======================================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_NetworkMessageActuator(SCA_IActuator) - - Message Actuator - - .. attribute:: propName - - Messages will only be sent to objects with the given property name. - - :type: string - - .. attribute:: subject - - The subject field of the message. - - :type: string - - .. attribute:: body - - The body of the message. - - :type: string - - .. attribute:: usePropBody - - Send a property instead of a regular body message. - - :type: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageSensor.rst deleted file mode 100644 index a732c1e48f7..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_NetworkMessageSensor.rst +++ /dev/null @@ -1,34 +0,0 @@ -KX_NetworkMessageSensor(SCA_ISensor) -==================================== - -base class --- :class:`SCA_ISensor` - -.. class:: KX_NetworkMessageSensor(SCA_ISensor) - - The Message Sensor logic brick. - - Currently only loopback (local) networks are supported. - - .. attribute:: subject - - The subject the sensor is looking for. - - :type: string - - .. attribute:: frameMessageCount - - The number of messages received since the last frame. (read-only). - - :type: integer - - .. attribute:: subjects - - The list of message subjects received. (read-only). - - :type: list of strings - - .. attribute:: bodies - - The list of message bodies received. (read-only). - - :type: list of strings diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ObjectActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_ObjectActuator.rst deleted file mode 100644 index f3948578cd5..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_ObjectActuator.rst +++ /dev/null @@ -1,126 +0,0 @@ -KX_ObjectActuator(SCA_IActuator) -================================ - -base class --- :class:`SCA_IActuator` - -.. class:: KX_ObjectActuator(SCA_IActuator) - - The object actuator ("Motion Actuator") applies force, torque, displacement, angular displacement, - velocity, or angular velocity to an object. - Servo control allows to regulate force to achieve a certain speed target. - - .. attribute:: force - - The force applied by the actuator. - - :type: Vector((x, y, z)) - - .. attribute:: useLocalForce - - A flag specifying if the force is local. - - :type: boolean - - .. attribute:: torque - - The torque applied by the actuator. - - :type: Vector((x, y, z)) - - .. attribute:: useLocalTorque - - A flag specifying if the torque is local. - - :type: boolean - - .. attribute:: dLoc - - The displacement vector applied by the actuator. - - :type: Vector((x, y, z)) - - .. attribute:: useLocalDLoc - - A flag specifying if the dLoc is local. - - :type: boolean - - .. attribute:: dRot - - The angular displacement vector applied by the actuator - - :type: Vector((x, y, z)) - - .. note:: - - Since the displacement is applied every frame, you must adjust the displacement based on the frame rate, or you game experience will depend on the player's computer speed. - - .. attribute:: useLocalDRot - - A flag specifying if the dRot is local. - - :type: boolean - - .. attribute:: linV - - The linear velocity applied by the actuator. - - :type: Vector((x, y, z)) - - .. attribute:: useLocalLinV - - A flag specifying if the linear velocity is local. - - :type: boolean - - .. note:: - - This is the target speed for servo controllers. - - .. attribute:: angV - - The angular velocity applied by the actuator. - - :type: Vector((x, y, z)) - - .. attribute:: useLocalAngV - - A flag specifying if the angular velocity is local. - - :type: boolean - - .. attribute:: damping - - The damping parameter of the servo controller. - - :type: short - - .. attribute:: forceLimitX - - The min/max force limit along the X axis and activates or deactivates the limits in the servo controller. - - :type: list [min(float), max(float), bool] - - .. attribute:: forceLimitY - - The min/max force limit along the Y axis and activates or deactivates the limits in the servo controller. - - :type: list [min(float), max(float), bool] - - .. attribute:: forceLimitZ - - The min/max force limit along the Z axis and activates or deactivates the limits in the servo controller. - - :type: list [min(float), max(float), bool] - - .. attribute:: pid - - The PID coefficients of the servo controller. - - :type: list of floats [proportional, integral, derivate] - - .. attribute:: reference - - The object that is used as reference to compute the velocity for the servo controller. - - :type: :class:`KX_GameObject` or None diff --git a/doc/python_api/rst/bge_types/bge.types.KX_ParentActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_ParentActuator.rst deleted file mode 100644 index 13f4bcb7615..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_ParentActuator.rst +++ /dev/null @@ -1,35 +0,0 @@ -KX_ParentActuator(SCA_IActuator) -================================ - -base class --- :class:`SCA_IActuator` - -.. class:: KX_ParentActuator(SCA_IActuator) - - The parent actuator can set or remove an objects parent object. - - .. attribute:: object - - the object this actuator sets the parent too. - - :type: :class:`KX_GameObject` or None - - .. attribute:: mode - - The mode of this actuator. - - :type: integer from 0 to 1. - - .. attribute:: compound - - Whether the object shape should be added to the parent compound shape when parenting. - - Effective only if the parent is already a compound shape. - - :type: boolean - - .. attribute:: ghost - - Whether the object should be made ghost when parenting - Effective only if the shape is not added to the parent compound shape. - - :type: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.KX_PolyProxy.rst b/doc/python_api/rst/bge_types/bge.types.KX_PolyProxy.rst deleted file mode 100644 index 68baff8d45c..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_PolyProxy.rst +++ /dev/null @@ -1,136 +0,0 @@ -KX_PolyProxy(SCA_IObject) -========================= - -base class --- :class:`SCA_IObject` - -.. class:: KX_PolyProxy(SCA_IObject) - - A polygon holds the index of the vertex forming the poylgon. - - Note: - The polygon attributes are read-only, you need to retrieve the vertex proxy if you want - to change the vertex settings. - - .. attribute:: material_name - - The name of polygon material, empty if no material. - - :type: string - - .. attribute:: material - - The material of the polygon. - - :type: :class:`KX_BlenderMaterial` - - .. attribute:: texture_name - - The texture name of the polygon. - - :type: string - - .. attribute:: material_id - - The material index of the polygon, use this to retrieve vertex proxy from mesh proxy. - - :type: integer - - .. attribute:: v1 - - vertex index of the first vertex of the polygon, use this to retrieve vertex proxy from mesh proxy. - - :type: integer - - .. attribute:: v2 - - vertex index of the second vertex of the polygon, use this to retrieve vertex proxy from mesh proxy. - - :type: integer - - .. attribute:: v3 - - vertex index of the third vertex of the polygon, use this to retrieve vertex proxy from mesh proxy. - - :type: integer - - .. attribute:: v4 - - Vertex index of the fourth vertex of the polygon, 0 if polygon has only 3 vertex - Use this to retrieve vertex proxy from mesh proxy. - - :type: integer - - .. attribute:: visible - - visible state of the polygon: 1=visible, 0=invisible. - - :type: integer - - .. attribute:: collide - - collide state of the polygon: 1=receives collision, 0=collision free. - - :type: integer - - .. method:: getMaterialName() - - Returns the polygon material name with MA prefix - - :return: material name - :rtype: string - - .. method:: getMaterial() - - :return: The polygon material - :rtype: :class:`KX_BlenderMaterial` - - .. method:: getTextureName() - - :return: The texture name - :rtype: string - - .. method:: getMaterialIndex() - - Returns the material bucket index of the polygon. - This index and the ones returned by getVertexIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`. - - :return: the material index in the mesh - :rtype: integer - - .. method:: getNumVertex() - - Returns the number of vertex of the polygon. - - :return: number of vertex, 3 or 4. - :rtype: integer - - .. method:: isVisible() - - Returns whether the polygon is visible or not - - :return: 0=invisible, 1=visible - :rtype: boolean - - .. method:: isCollider() - - Returns whether the polygon is receives collision or not - - :return: 0=collision free, 1=receives collision - :rtype: integer - - .. method:: getVertexIndex(vertex) - - Returns the mesh vertex index of a polygon vertex - This index and the one returned by getMaterialIndex() are needed to retrieve the vertex proxy from :class:`MeshProxy`. - - :arg vertex: index of the vertex in the polygon: 0->3 - :arg vertex: integer - :return: mesh vertex index - :rtype: integer - - .. method:: getMesh() - - Returns a mesh proxy - - :return: mesh proxy - :rtype: :class:`MeshProxy` diff --git a/doc/python_api/rst/bge_types/bge.types.KX_RadarSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_RadarSensor.rst deleted file mode 100644 index 82028cfc186..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_RadarSensor.rst +++ /dev/null @@ -1,41 +0,0 @@ -KX_RadarSensor(KX_NearSensor) -============================= - -base class --- :class:`KX_NearSensor` - -.. class:: KX_RadarSensor(KX_NearSensor) - - Radar sensor is a near sensor with a conical sensor object. - - .. attribute:: coneOrigin - - The origin of the cone with which to test. The origin is in the middle of the cone. (read-only). - - :type: list of floats [x, y, z] - - .. attribute:: coneTarget - - The center of the bottom face of the cone with which to test. (read-only). - - :type: list of floats [x, y, z] - - .. attribute:: distance - - The height of the cone with which to test. - - :type: float - - .. attribute:: angle - - The angle of the cone (in degrees) with which to test. - - :type: float - - .. attribute:: axis - - The axis on which the radar cone is cast. - - :type: integer from 0 to 5 - - KX_RADAR_AXIS_POS_X, KX_RADAR_AXIS_POS_Y, KX_RADAR_AXIS_POS_Z, - KX_RADAR_AXIS_NEG_X, KX_RADAR_AXIS_NEG_Y, KX_RADAR_AXIS_NEG_Z diff --git a/doc/python_api/rst/bge_types/bge.types.KX_RaySensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_RaySensor.rst deleted file mode 100644 index 75e171dd612..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_RaySensor.rst +++ /dev/null @@ -1,75 +0,0 @@ -KX_RaySensor(SCA_ISensor) -========================= - -base class --- :class:`SCA_ISensor` - -.. class:: KX_RaySensor(SCA_ISensor) - - A ray sensor detects the first object in a given direction. - - .. attribute:: propName - - The property the ray is looking for. - - :type: string - - .. attribute:: range - - The distance of the ray. - - :type: float - - .. attribute:: useMaterial - - Whether or not to look for a material (false = property). - - :type: boolean - - .. attribute:: useXRay - - Whether or not to use XRay. - - :type: boolean - - .. attribute:: hitObject - - The game object that was hit by the ray. (read-only). - - :type: :class:`KX_GameObject` - - .. attribute:: hitPosition - - The position (in worldcoordinates) where the object was hit by the ray. (read-only). - - :type: list [x, y, z] - - .. attribute:: hitNormal - - The normal (in worldcoordinates) of the object at the location where the object was hit by the ray. (read-only). - - :type: list [x, y, z] - - .. attribute:: hitMaterial - - The material of the object in the face hit by the ray. (read-only). - - :type: string - - .. attribute:: rayDirection - - The direction from the ray (in worldcoordinates). (read-only). - - :type: list [x, y, z] - - .. attribute:: axis - - The axis the ray is pointing on. - - :type: integer from 0 to 5 - - * KX_RAY_AXIS_POS_X - * KX_RAY_AXIS_POS_Y - * KX_RAY_AXIS_POS_Z - * KX_RAY_AXIS_NEG_X - * KX_RAY_AXIS_NEG_Y - * KX_RAY_AXIS_NEG_Z diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_AddObjectActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_AddObjectActuator.rst deleted file mode 100644 index 9b7d2ad874a..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SCA_AddObjectActuator.rst +++ /dev/null @@ -1,52 +0,0 @@ -KX_SCA_AddObjectActuator(SCA_IActuator) -======================================= - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SCA_AddObjectActuator(SCA_IActuator) - - Edit Object Actuator (in Add Object Mode) - - .. warning:: - - An Add Object actuator will be ignored if at game start, the linked object doesn't exist (or is empty) or the linked object is in an active layer. - - .. code-block:: none - - Error: GameObject 'Name' has a AddObjectActuator 'ActuatorName' without object (in 'nonactive' layer) - - .. attribute:: object - - the object this actuator adds. - - :type: :class:`KX_GameObject` or None - - .. attribute:: objectLastCreated - - the last added object from this actuator (read-only). - - :type: :class:`KX_GameObject` or None - - .. attribute:: time - - the lifetime of added objects, in frames. Set to 0 to disable automatic deletion. - - :type: integer - - .. attribute:: linearVelocity - - the initial linear velocity of added objects. - - :type: list [vx, vy, vz] - - .. attribute:: angularVelocity - - the initial angular velocity of added objects. - - :type: list [vx, vy, vz] - - .. method:: instantAddObject() - - adds the object without needing to calling SCA_PythonController.activate() - - .. note:: Use objectLastCreated to get the newly created object. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_DynamicActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_DynamicActuator.rst deleted file mode 100644 index 822c343aacd..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SCA_DynamicActuator.rst +++ /dev/null @@ -1,26 +0,0 @@ -KX_SCA_DynamicActuator(SCA_IActuator) -===================================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SCA_DynamicActuator(SCA_IActuator) - - Dynamic Actuator. - - .. attribute:: mode - - :type: integer - - the type of operation of the actuator, 0-4 - - * KX_DYN_RESTORE_DYNAMICS(0) - * KX_DYN_DISABLE_DYNAMICS(1) - * KX_DYN_ENABLE_RIGID_BODY(2) - * KX_DYN_DISABLE_RIGID_BODY(3) - * KX_DYN_SET_MASS(4) - - .. attribute:: mass - - the mass value for the KX_DYN_SET_MASS operation. - - :type: float diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_EndObjectActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_EndObjectActuator.rst deleted file mode 100644 index 3a414df9493..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SCA_EndObjectActuator.rst +++ /dev/null @@ -1,10 +0,0 @@ -KX_SCA_EndObjectActuator(SCA_IActuator) -======================================= - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SCA_EndObjectActuator(SCA_IActuator) - - Edit Object Actuator (in End Object mode) - - This actuator has no python methods. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst deleted file mode 100644 index 8a88dff99b9..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SCA_ReplaceMeshActuator.rst +++ /dev/null @@ -1,86 +0,0 @@ -KX_SCA_ReplaceMeshActuator(SCA_IActuator) -========================================= - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SCA_ReplaceMeshActuator(SCA_IActuator) - - Edit Object actuator, in Replace Mesh mode. - - .. warning:: - - Replace mesh actuators will be ignored if at game start, the named mesh doesn't exist. - - This will generate a warning in the console - - .. code-block:: none - - Error: GameObject 'Name' ReplaceMeshActuator 'ActuatorName' without object - - .. code-block:: python - - # Level-of-detail - # Switch a game object's mesh based on its depth in the camera view. - # +----------+ +-----------+ +-------------------------------------+ - # | Always +-----+ Python +-----+ Edit Object (Replace Mesh) LOD.Mesh | - # +----------+ +-----------+ +-------------------------------------+ - from bge import logic - - # List detail meshes here - # Mesh (name, near, far) - # Meshes overlap so that they don't 'pop' when on the edge of the distance. - meshes = ((".Hi", 0.0, -20.0), - (".Med", -15.0, -50.0), - (".Lo", -40.0, -100.0) - ) - - cont = logic.getCurrentController() - object = cont.owner - actuator = cont.actuators["LOD." + obj.name] - camera = logic.getCurrentScene().active_camera - - def Depth(pos, plane): - return pos[0]*plane[0] + pos[1]*plane[1] + pos[2]*plane[2] + plane[3] - - # Depth is negative and decreasing further from the camera - depth = Depth(object.position, camera.world_to_camera[2]) - - newmesh = None - curmesh = None - # Find the lowest detail mesh for depth - for mesh in meshes: - if depth < mesh[1] and depth > mesh[2]: - newmesh = mesh - if "ME" + object.name + mesh[0] == actuator.getMesh(): - curmesh = mesh - - if newmesh != None and "ME" + object.name + newmesh[0] != actuator.mesh: - # The mesh is a different mesh - switch it. - # Check the current mesh is not a better fit. - if curmesh == None or curmesh[1] < depth or curmesh[2] > depth: - actuator.mesh = object.name + newmesh[0] - cont.activate(actuator) - - .. attribute:: mesh - - :class:`MeshProxy` or the name of the mesh that will replace the current one. - - Set to None to disable actuator. - - :type: :class:`MeshProxy` or None if no mesh is set - - .. attribute:: useDisplayMesh - - when true the displayed mesh is replaced. - - :type: boolean - - .. attribute:: usePhysicsMesh - - when true the physics mesh is replaced. - - :type: boolean - - .. method:: instantReplaceMesh() - - Immediately replace mesh without delay. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst b/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst deleted file mode 100644 index 7e632d2c8d4..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_Scene.rst +++ /dev/null @@ -1,183 +0,0 @@ -KX_Scene(PyObjectPlus) -====================== - -base class --- :class:`PyObjectPlus` - -.. class:: KX_Scene(PyObjectPlus) - - An active scene that gives access to objects, cameras, lights and scene attributes. - - The activity culling stuff is supposed to disable logic bricks when their owner gets too far - from the active camera. It was taken from some code lurking at the back of KX_Scene - who knows - what it does! - - .. code-block:: python - - from bge import logic - - # get the scene - scene = logic.getCurrentScene() - - # print all the objects in the scene - for object in scene.objects: - print(object.name) - - # get an object named 'Cube' - object = scene.objects["Cube"] - - # get the first object in the scene. - object = scene.objects[0] - - .. code-block:: python - - # Get the depth of an object in the camera view. - from bge import logic - - object = logic.getCurrentController().owner - cam = logic.getCurrentScene().active_camera - - # Depth is negative and decreasing further from the camera - depth = object.position[0]*cam.world_to_camera[2][0] + object.position[1]*cam.world_to_camera[2][1] + object.position[2]*cam.world_to_camera[2][2] + cam.world_to_camera[2][3] - - @bug: All attributes are read only at the moment. - - .. attribute:: name - - The scene's name, (read-only). - - :type: string - - .. attribute:: objects - - A list of objects in the scene, (read-only). - - :type: :class:`CListValue` of :class:`KX_GameObject` - - .. attribute:: objectsInactive - - A list of objects on background layers (used for the addObject actuator), (read-only). - - :type: :class:`CListValue` of :class:`KX_GameObject` - - .. attribute:: lights - - A list of lights in the scene, (read-only). - - :type: :class:`CListValue` of :class:`KX_LightObject` - - .. attribute:: cameras - - A list of cameras in the scene, (read-only). - - :type: :class:`CListValue` of :class:`KX_Camera` - - .. attribute:: active_camera - - The current active camera. - - :type: :class:`KX_Camera` - - .. note:: - - This can be set directly from python to avoid using the :class:`KX_SceneActuator`. - - .. attribute:: world - - The current active world, (read-only). - - :type: :class:`KX_WorldInfo` - - .. attribute:: suspended - - True if the scene is suspended, (read-only). - - :type: boolean - - .. attribute:: activity_culling - - True if the scene is activity culling. - - :type: boolean - - .. attribute:: activity_culling_radius - - The distance outside which to do activity culling. Measured in manhattan distance. - - :type: float - - .. attribute:: dbvt_culling - - True when Dynamic Bounding box Volume Tree is set (read-only). - - :type: boolean - - .. attribute:: pre_draw - - A list of callables to be run before the render step. - - :type: list - - .. attribute:: post_draw - - A list of callables to be run after the render step. - - :type: list - - .. attribute:: pre_draw_setup - - A list of callables to be run before the drawing setup (i.e., before the model view and projection matrices are computed). - - :type: list - - .. attribute:: gravity - - The scene gravity using the world x, y and z axis. - - :type: Vector((gx, gy, gz)) - - .. method:: addObject(object, reference, time=0) - - Adds an object to the scene like the Add Object Actuator would. - - :arg object: The (name of the) object to add. - :type object: :class:`KX_GameObject` or string - :arg reference: The (name of the) object which position, orientation, and scale to copy (optional), if the object to add is a light and there is not reference the light's layer will be the same that the active layer in the blender scene. - :type reference: :class:`KX_GameObject` or string - :arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever (optional). - :type time: integer - :return: The newly added object. - :rtype: :class:`KX_GameObject` - - .. method:: end() - - Removes the scene from the game. - - .. method:: restart() - - Restarts the scene. - - .. method:: replace(scene) - - Replaces this scene with another one. - - :arg scene: The name of the scene to replace this scene with. - :type scene: string - :return: True if the scene exists and was scheduled for addition, False otherwise. - :rtype: boolean - - .. method:: suspend() - - Suspends this scene. - - .. method:: resume() - - Resume this scene. - - .. method:: get(key, default=None) - - Return the value matching key, or the default value if its not found. - :return: The key value or a default. - - .. method:: drawObstacleSimulation() - - Draw debug visualization of obstacle simulation. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SceneActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SceneActuator.rst deleted file mode 100644 index b6aeaff282c..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SceneActuator.rst +++ /dev/null @@ -1,46 +0,0 @@ -KX_SceneActuator(SCA_IActuator) -=============================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SceneActuator(SCA_IActuator) - - Scene Actuator logic brick. - - .. warning:: - - Scene actuators that use a scene name will be ignored if at game start, the named scene doesn't exist or is empty - - This will generate a warning in the console: - - .. code-block:: none - - Error: GameObject 'Name' has a SceneActuator 'ActuatorName' (SetScene) without scene - - .. attribute:: scene - - the name of the scene to change to/overlay/underlay/remove/suspend/resume. - - :type: string - - .. attribute:: camera - - the camera to change to. - - :type: :class:`KX_Camera` on read, string or :class:`KX_Camera` on write - - .. note:: - - When setting the attribute, you can use either a :class:`KX_Camera` or the name of the camera. - - .. attribute:: useRestart - - Set flag to True to restart the sene. - - :type: boolean - - .. attribute:: mode - - The mode of the actuator. - - :type: integer from 0 to 5. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SoundActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SoundActuator.rst deleted file mode 100644 index d6d258b40d5..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SoundActuator.rst +++ /dev/null @@ -1,112 +0,0 @@ -KX_SoundActuator(SCA_IActuator) -=============================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SoundActuator(SCA_IActuator) - - Sound Actuator. - - The :data:`startSound`, :data:`pauseSound` and :data:`stopSound` do not require the actuator to be activated - they act instantly provided that the actuator has been activated once at least. - - .. attribute:: volume - - The volume (gain) of the sound. - - :type: float - - .. attribute:: time - - The current position in the audio stream (in seconds). - - :type: float - - .. attribute:: pitch - - The pitch of the sound. - - :type: float - - .. attribute:: mode - - The operation mode of the actuator. Can be one of :ref:`these constants<logic-sound-actuator>` - - :type: integer - - .. attribute:: sound - - The sound the actuator should play. - - :type: Audaspace factory - - .. attribute:: is3D - - Whether or not the actuator should be using 3D sound. (read-only) - - :type: boolean - - .. attribute:: volume_maximum - - The maximum gain of the sound, no matter how near it is. - - :type: float - - .. attribute:: volume_minimum - - The minimum gain of the sound, no matter how far it is away. - - :type: float - - .. attribute:: distance_reference - - The distance where the sound has a gain of 1.0. - - :type: float - - .. attribute:: distance_maximum - - The maximum distance at which you can hear the sound. - - :type: float - - .. attribute:: attenuation - - The influence factor on volume depending on distance. - - :type: float - - .. attribute:: cone_angle_inner - - The angle of the inner cone. - - :type: float - - .. attribute:: cone_angle_outer - - The angle of the outer cone. - - :type: float - - .. attribute:: cone_volume_outer - - The gain outside the outer cone (the gain in the outer cone will be interpolated between this value and the normal gain in the inner cone). - - :type: float - - .. method:: startSound() - - Starts the sound. - - :return: None - - .. method:: pauseSound() - - Pauses the sound. - - :return: None - - .. method:: stopSound() - - Stops the sound. - - :return: None diff --git a/doc/python_api/rst/bge_types/bge.types.KX_StateActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_StateActuator.rst deleted file mode 100644 index 7dbe47276fd..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_StateActuator.rst +++ /dev/null @@ -1,26 +0,0 @@ -KX_StateActuator(SCA_IActuator) -=============================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_StateActuator(SCA_IActuator) - - State actuator changes the state mask of parent object. - - .. attribute:: operation - - Type of bit operation to be applied on object state mask. - - You can use one of :ref:`these constants <state-actuator-operation>` - - :type: integer - - .. attribute:: mask - - Value that defines the bits that will be modified by the operation. - - The bits that are 1 in the mask will be updated in the object state. - - The bits that are 0 are will be left unmodified expect for the Copy operation which copies the mask to the object state. - - :type: integer diff --git a/doc/python_api/rst/bge_types/bge.types.KX_SteeringActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_SteeringActuator.rst deleted file mode 100644 index 9e2f2a427a1..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_SteeringActuator.rst +++ /dev/null @@ -1,68 +0,0 @@ -KX_SteeringActuator(SCA_IActuator) -================================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_SteeringActuator(SCA_IActuator) - - Steering Actuator for navigation. - - .. attribute:: behavior - - The steering behavior to use. - - :type: one of :ref:`these constants <logic-steering-actuator>` - - .. attribute:: velocity - - Velocity magnitude - - :type: float - - .. attribute:: acceleration - - Max acceleration - - :type: float - - .. attribute:: turnspeed - - Max turn speed - - :type: float - - .. attribute:: distance - - Relax distance - - :type: float - - .. attribute:: target - - Target object - - :type: :class:`KX_GameObject` - - .. attribute:: navmesh - - Navigation mesh - - :type: :class:`KX_GameObject` - - .. attribute:: selfterminated - - Terminate when target is reached - - :type: boolean - - .. attribute:: enableVisualization - - Enable debug visualization - - :type: boolean - - .. attribute:: pathUpdatePeriod - - Path update period - - :type: int diff --git a/doc/python_api/rst/bge_types/bge.types.KX_TouchSensor.rst b/doc/python_api/rst/bge_types/bge.types.KX_TouchSensor.rst deleted file mode 100644 index 79fd1a63151..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_TouchSensor.rst +++ /dev/null @@ -1,44 +0,0 @@ -KX_TouchSensor(SCA_ISensor) -=========================== - -base class --- :class:`SCA_ISensor` - -.. class:: KX_TouchSensor(SCA_ISensor) - - Touch sensor detects collisions between objects. - - .. attribute:: propName - - The property or material to collide with. - - :type: string - - .. attribute:: useMaterial - - Determines if the sensor is looking for a property or material. KX_True = Find material; KX_False = Find property. - - :type: boolean - - .. attribute:: usePulseCollision - - When enabled, changes to the set of colliding objects generate a pulse. - - :type: boolean - - .. attribute:: hitObject - - The last collided object. (read-only). - - :type: :class:`KX_GameObject` or None - - .. attribute:: hitObjectList - - A list of colliding objects. (read-only). - - :type: :class:`CListValue` of :class:`KX_GameObject` - - .. attribute:: hitMaterial - - The material of the object in the face hit by the ray. (read-only). - - :type: string diff --git a/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst deleted file mode 100644 index fd80c547ce3..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_TrackToActuator.rst +++ /dev/null @@ -1,59 +0,0 @@ -KX_TrackToActuator(SCA_IActuator) -================================= - -base class --- :class:`SCA_IActuator` - -.. class:: KX_TrackToActuator(SCA_IActuator) - - Edit Object actuator in Track To mode. - - .. warning:: - - Track To Actuators will be ignored if at game start, the object to track to is invalid. - - This will generate a warning in the console: - - .. code-block:: none - - GameObject 'Name' no object in EditObjectActuator 'ActuatorName' - - .. attribute:: object - - the object this actuator tracks. - - :type: :class:`KX_GameObject` or None - - .. attribute:: time - - the time in frames with which to delay the tracking motion. - - :type: integer - - .. attribute:: use3D - - the tracking motion to use 3D. - - :type: boolean - - .. attribute:: upAxis - - The axis that points upward. - - :type: integer from 0 to 2 - - * KX_TRACK_UPAXIS_POS_X - * KX_TRACK_UPAXIS_POS_Y - * KX_TRACK_UPAXIS_POS_Z - - .. attribute:: trackAxis - - The axis that points to the target object. - - :type: integer from 0 to 5 - - * KX_TRACK_TRAXIS_POS_X - * KX_TRACK_TRAXIS_POS_Y - * KX_TRACK_TRAXIS_POS_Z - * KX_TRACK_TRAXIS_NEG_X - * KX_TRACK_TRAXIS_NEG_Y - * KX_TRACK_TRAXIS_NEG_Z diff --git a/doc/python_api/rst/bge_types/bge.types.KX_VehicleWrapper.rst b/doc/python_api/rst/bge_types/bge.types.KX_VehicleWrapper.rst deleted file mode 100644 index 0d7b7103ba4..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_VehicleWrapper.rst +++ /dev/null @@ -1,163 +0,0 @@ -KX_VehicleWrapper(PyObjectPlus) -=============================== - -base class --- :class:`PyObjectPlus` - -.. class:: KX_VehicleWrapper(PyObjectPlus) - - KX_VehicleWrapper - - TODO - description - - .. method:: addWheel(wheel, attachPos, downDir, axleDir, suspensionRestLength, wheelRadius, hasSteering) - - Add a wheel to the vehicle - - :arg wheel: The object to use as a wheel. - :type wheel: :class:`KX_GameObject` or a :class:`KX_GameObject` name - :arg attachPos: The position to attach the wheel, relative to the chassis object center. - :type attachPos: vector of 3 floats - :arg downDir: The direction vector pointing down to where the vehicle should collide with the floor. - :type downDir: vector of 3 floats - :arg axleDir: The axis the wheel rotates around, relative to the chassis. - :type axleDir: vector of 3 floats - :arg suspensionRestLength: The length of the suspension when no forces are being applied. - :type suspensionRestLength: float - :arg wheelRadius: The radius of the wheel (half the diameter). - :type wheelRadius: float - :arg hasSteering: True if the wheel should turn with steering, typically used in front wheels. - :type hasSteering: boolean - - - .. method:: applyBraking(force, wheelIndex) - - Apply a braking force to the specified wheel - - :arg force: the brake force - :type force: float - - :arg wheelIndex: index of the wheel where the force needs to be applied - :type wheelIndex: integer - - - .. method:: applyEngineForce(force, wheelIndex) - - Apply an engine force to the specified wheel - - :arg force: the engine force - :type force: float - - :arg wheelIndex: index of the wheel where the force needs to be applied - :type wheelIndex: integer - - - .. method:: getConstraintId() - - Get the constraint ID - - :return: the constraint id - :rtype: integer - - .. method:: getConstraintType() - - Returns the constraint type. - - :return: constraint type - :rtype: integer - - .. method:: getNumWheels() - - Returns the number of wheels. - - :return: the number of wheels for this vehicle - :rtype: integer - - .. method:: getWheelOrientationQuaternion(wheelIndex) - - Returns the wheel orientation as a quaternion. - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - - :return: TODO Description - :rtype: TODO - type should be quat as per method name but from the code it looks like a matrix - - .. method:: getWheelPosition(wheelIndex) - - Returns the position of the specified wheel - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - :return: position vector - :rtype: list[x, y, z] - - .. method:: getWheelRotation(wheelIndex) - - Returns the rotation of the specified wheel - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - - :return: the wheel rotation - :rtype: float - - .. method:: setRollInfluence(rollInfluece, wheelIndex) - - Set the specified wheel's roll influence. - The higher the roll influence the more the vehicle will tend to roll over in corners. - - :arg rollInfluece: the wheel roll influence - :type rollInfluece: float - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - - .. method:: setSteeringValue(steering, wheelIndex) - - Set the specified wheel's steering - - :arg steering: the wheel steering - :type steering: float - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - - .. method:: setSuspensionCompression(compression, wheelIndex) - - Set the specified wheel's compression - - :arg compression: the wheel compression - :type compression: float - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - - .. method:: setSuspensionDamping(damping, wheelIndex) - - Set the specified wheel's damping - - :arg damping: the wheel damping - :type damping: float - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - - .. method:: setSuspensionStiffness(stiffness, wheelIndex) - - Set the specified wheel's stiffness - - :arg stiffness: the wheel stiffness - :type stiffness: float - - :arg wheelIndex: the wheel index - :type wheelIndex: integer - - .. method:: setTyreFriction(friction, wheelIndex) - - Set the specified wheel's tyre friction - - :arg friction: the tyre friction - :type friction: float - - :arg wheelIndex: the wheel index - :type wheelIndex: integer diff --git a/doc/python_api/rst/bge_types/bge.types.KX_VertexProxy.rst b/doc/python_api/rst/bge_types/bge.types.KX_VertexProxy.rst deleted file mode 100644 index f6b52affa27..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_VertexProxy.rst +++ /dev/null @@ -1,206 +0,0 @@ -KX_VertexProxy(SCA_IObject) -=========================== - -base class --- :class:`SCA_IObject` - -.. class:: KX_VertexProxy(SCA_IObject) - - A vertex holds position, UV, color and normal information. - - Note: - The physics simulation is NOT currently updated - physics will not respond - to changes in the vertex position. - - .. attribute:: XYZ - - The position of the vertex. - - :type: Vector((x, y, z)) - - .. attribute:: UV - - The texture coordinates of the vertex. - - :type: Vector((u, v)) - - .. attribute:: normal - - The normal of the vertex. - - :type: Vector((nx, ny, nz)) - - .. attribute:: color - - The color of the vertex. - - :type: Vector((r, g, b, a)) - - Black = [0.0, 0.0, 0.0, 1.0], White = [1.0, 1.0, 1.0, 1.0] - - .. attribute:: x - - The x coordinate of the vertex. - - :type: float - - .. attribute:: y - - The y coordinate of the vertex. - - :type: float - - .. attribute:: z - - The z coordinate of the vertex. - - :type: float - - .. attribute:: u - - The u texture coordinate of the vertex. - - :type: float - - .. attribute:: v - - The v texture coordinate of the vertex. - - :type: float - - .. attribute:: u2 - - The second u texture coordinate of the vertex. - - :type: float - - .. attribute:: v2 - - The second v texture coordinate of the vertex. - - :type: float - - .. attribute:: r - - The red component of the vertex color. 0.0 <= r <= 1.0. - - :type: float - - .. attribute:: g - - The green component of the vertex color. 0.0 <= g <= 1.0. - - :type: float - - .. attribute:: b - - The blue component of the vertex color. 0.0 <= b <= 1.0. - - :type: float - - .. attribute:: a - - The alpha component of the vertex color. 0.0 <= a <= 1.0. - - :type: float - - .. method:: getXYZ() - - Gets the position of this vertex. - - :return: this vertexes position in local coordinates. - :rtype: Vector((x, y, z)) - - .. method:: setXYZ(pos) - - Sets the position of this vertex. - - :type: Vector((x, y, z)) - - :arg pos: the new position for this vertex in local coordinates. - - .. method:: getUV() - - Gets the UV (texture) coordinates of this vertex. - - :return: this vertexes UV (texture) coordinates. - :rtype: Vector((u, v)) - - .. method:: setUV(uv) - - Sets the UV (texture) coordinates of this vertex. - - :type: Vector((u, v)) - - .. method:: getUV2() - - Gets the 2nd UV (texture) coordinates of this vertex. - - :return: this vertexes UV (texture) coordinates. - :rtype: Vector((u, v)) - - .. method:: setUV2(uv, unit) - - Sets the 2nd UV (texture) coordinates of this vertex. - - :type: Vector((u, v)) - - :arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV - :arg unit: integer - - .. method:: getRGBA() - - Gets the color of this vertex. - - The color is represented as four bytes packed into an integer value. The color is - packed as RGBA. - - Since Python offers no way to get each byte without shifting, you must use the struct module to - access color in an machine independent way. - - Because of this, it is suggested you use the r, g, b and a attributes or the color attribute instead. - - .. code-block:: python - - import struct; - col = struct.unpack('4B', struct.pack('I', v.getRGBA())) - # col = (r, g, b, a) - # black = ( 0, 0, 0, 255) - # white = (255, 255, 255, 255) - - :return: packed color. 4 byte integer with one byte per color channel in RGBA format. - :rtype: integer - - .. method:: setRGBA(col) - - Sets the color of this vertex. - - See getRGBA() for the format of col, and its relevant problems. Use the r, g, b and a attributes - or the color attribute instead. - - setRGBA() also accepts a four component list as argument col. The list represents the color as [r, g, b, a] - with black = [0.0, 0.0, 0.0, 1.0] and white = [1.0, 1.0, 1.0, 1.0] - - .. code-block:: python - - v.setRGBA(0xff0000ff) # Red - v.setRGBA(0xff00ff00) # Green on little endian, transparent purple on big endian - v.setRGBA([1.0, 0.0, 0.0, 1.0]) # Red - v.setRGBA([0.0, 1.0, 0.0, 1.0]) # Green on all platforms. - - :arg col: the new color of this vertex in packed RGBA format. - :type col: integer or list [r, g, b, a] - - .. method:: getNormal() - - Gets the normal vector of this vertex. - - :return: normalized normal vector. - :rtype: Vector((nx, ny, nz)) - - .. method:: setNormal(normal) - - Sets the normal vector of this vertex. - - :type: sequence of floats [r, g, b] - - :arg normal: the new normal of this vertex. diff --git a/doc/python_api/rst/bge_types/bge.types.KX_VisibilityActuator.rst b/doc/python_api/rst/bge_types/bge.types.KX_VisibilityActuator.rst deleted file mode 100644 index fc6c042e5b1..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_VisibilityActuator.rst +++ /dev/null @@ -1,26 +0,0 @@ -KX_VisibilityActuator(SCA_IActuator) -==================================== - -base class --- :class:`SCA_IActuator` - -.. class:: KX_VisibilityActuator(SCA_IActuator) - - Visibility Actuator. - - .. attribute:: visibility - - whether the actuator makes its parent object visible or invisible. - - :type: boolean - - .. attribute:: useOcclusion - - whether the actuator makes its parent object an occluder or not. - - :type: boolean - - .. attribute:: useRecursion - - whether the visibility/occlusion should be propagated to all children of the object. - - :type: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst b/doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst deleted file mode 100644 index d96d1c1190f..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.KX_WorldInfo.rst +++ /dev/null @@ -1,77 +0,0 @@ -KX_WorldInfo(PyObjectPlus) -============================= - -base class --- :class:`PyObjectPlus` - -.. class:: KX_WorldInfo(PyObjectPlus) - - A world object. - - .. code-block:: python - - # Set the mist color to red. - import bge - - sce = bge.logic.getCurrentScene() - - sce.world.mistColor = [1.0, 0.0, 0.0] - - .. data:: KX_MIST_QUADRATIC - - Type of quadratic attenuation used to fade mist. - - .. data:: KX_MIST_LINEAR - - Type of linear attenuation used to fade mist. - - .. data:: KX_MIST_INV_QUADRATIC - - Type of inverse quadratic attenuation used to fade mist. - - .. attribute:: mistEnable - - Return the state of the mist. - - :type: bool - - .. attribute:: mistStart - - The mist start point. - - :type: float - - .. attribute:: mistDistance - - The mist distance fom the start point to reach 100% mist. - - :type: float - - .. attribute:: mistIntensity - - The mist intensity. - - :type: float - - .. attribute:: mistType - - The type of mist - must be KX_MIST_QUADRATIC, KX_MIST_LINEAR or KX_MIST_INV_QUADRATIC - - .. attribute:: mistColor - - The color of the mist. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]. - Mist and background color sould always set to the same color. - - :type: :class:`mathutils.Color` - - .. attribute:: backgroundColor - - The color of the background. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]. - Mist and background color sould always set to the same color. - - :type: :class:`mathutils.Color` - - .. attribute:: ambientColor - - The color of the ambient light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0]. - - :type: :class:`mathutils.Color` diff --git a/doc/python_api/rst/bge_types/bge.types.PyObjectPlus.rst b/doc/python_api/rst/bge_types/bge.types.PyObjectPlus.rst deleted file mode 100644 index 4c8ddb9bcf5..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.PyObjectPlus.rst +++ /dev/null @@ -1,18 +0,0 @@ -PyObjectPlus -============ - -.. class:: PyObjectPlus - - PyObjectPlus base class of most other types in the Game Engine. - - .. attribute:: invalid - - Test if the object has been freed by the game engine and is no longer valid. - - Normally this is not a problem but when storing game engine data in the GameLogic module, - KX_Scenes or other KX_GameObjects its possible to hold a reference to invalid data. - Calling an attribute or method on an invalid object will raise a SystemError. - - The invalid attribute allows testing for this case without exception handling. - - :type: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_2DFilterActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_2DFilterActuator.rst deleted file mode 100644 index b4c00ff0181..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_2DFilterActuator.rst +++ /dev/null @@ -1,46 +0,0 @@ -SCA_2DFilterActuator(SCA_IActuator) -=================================== - -base class --- :class:`SCA_IActuator` - -.. class:: SCA_2DFilterActuator(SCA_IActuator) - - Create, enable and disable 2D filters. - - The following properties don't have an immediate effect. - You must active the actuator to get the result. - The actuator is not persistent: it automatically stops itself after setting up the filter - but the filter remains active. To stop a filter you must activate the actuator with 'type' - set to :data:`~bge.logic.RAS_2DFILTER_DISABLED` or :data:`~bge.logic.RAS_2DFILTER_NOFILTER`. - - .. attribute:: shaderText - - shader source code for custom shader. - - :type: string - - .. attribute:: disableMotionBlur - - action on motion blur: 0=enable, 1=disable. - - :type: integer - - .. attribute:: mode - - Type of 2D filter, use one of :ref:`these constants <Two-D-FilterActuator-mode>`. - - :type: integer - - .. attribute:: passNumber - - order number of filter in the stack of 2D filters. Filters are executed in increasing order of passNb. - - Only be one filter can be defined per passNb. - - :type: integer (0-100) - - .. attribute:: value - - argument for motion blur filter. - - :type: float (0.0-100.0) diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ANDController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ANDController.rst deleted file mode 100644 index abef7dd5cb3..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_ANDController.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCA_ANDController(SCA_IController) -================================== - -base class --- :class:`SCA_IController` - -.. class:: SCA_ANDController(SCA_IController) - - An AND controller activates only when all linked sensors are activated. - - There are no special python methods for this controller. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ActuatorSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ActuatorSensor.rst deleted file mode 100644 index cc89fd192c2..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_ActuatorSensor.rst +++ /dev/null @@ -1,16 +0,0 @@ -SCA_ActuatorSensor(SCA_ISensor) -=============================== - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_ActuatorSensor(SCA_ISensor) - - Actuator sensor detect change in actuator state of the parent object. - It generates a positive pulse if the corresponding actuator is activated - and a negative pulse if the actuator is deactivated. - - .. attribute:: actuator - - the name of the actuator that the sensor is monitoring. - - :type: string diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_AlwaysSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_AlwaysSensor.rst deleted file mode 100644 index 2a654a2bf38..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_AlwaysSensor.rst +++ /dev/null @@ -1,8 +0,0 @@ -SCA_AlwaysSensor(SCA_ISensor) -============================= - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_AlwaysSensor(SCA_ISensor) - - This sensor is always activated. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_DelaySensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_DelaySensor.rst deleted file mode 100644 index 34bdc4da44e..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_DelaySensor.rst +++ /dev/null @@ -1,36 +0,0 @@ -SCA_DelaySensor(SCA_ISensor) -============================ - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_DelaySensor(SCA_ISensor) - - The Delay sensor generates positive and negative triggers at precise time, - expressed in number of frames. The delay parameter defines the length of the initial OFF period. A positive trigger is generated at the end of this period. - - The duration parameter defines the length of the ON period following the OFF period. - There is a negative trigger at the end of the ON period. If duration is 0, the sensor stays ON and there is no negative trigger. - - The sensor runs the OFF-ON cycle once unless the repeat option is set: the OFF-ON cycle repeats indefinately (or the OFF cycle if duration is 0). - - Use :class:`SCA_ISensor.reset` at any time to restart sensor. - - .. attribute:: delay - - length of the initial OFF period as number of frame, 0 for immediate trigger. - - :type: integer. - - .. attribute:: duration - - length of the ON period in number of frame after the initial OFF period. - - If duration is greater than 0, a negative trigger is sent at the end of the ON pulse. - - :type: integer - - .. attribute:: repeat - - 1 if the OFF-ON cycle should be repeated indefinately, 0 if it should run once. - - :type: integer diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_IActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_IActuator.rst deleted file mode 100644 index b6afe4acc2f..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_IActuator.rst +++ /dev/null @@ -1,8 +0,0 @@ -SCA_IActuator(SCA_ILogicBrick) -============================== - -base class --- :class:`SCA_ILogicBrick` - -.. class:: SCA_IActuator(SCA_ILogicBrick) - - Base class for all actuator logic bricks. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_IController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_IController.rst deleted file mode 100644 index 4532070c814..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_IController.rst +++ /dev/null @@ -1,52 +0,0 @@ -SCA_IController(SCA_ILogicBrick) -================================ - -base class --- :class:`SCA_ILogicBrick` - -.. class:: SCA_IController(SCA_ILogicBrick) - - Base class for all controller logic bricks. - - .. attribute:: state - - The controllers state bitmask. This can be used with the GameObject's state to test if the controller is active. - - :type: int bitmask - - .. attribute:: sensors - - A list of sensors linked to this controller. - - :type: sequence supporting index/string lookups and iteration. - - .. note:: - - The sensors are not necessarily owned by the same object. - - .. note:: - - When objects are instanced in dupligroups links may be lost from objects outside the dupligroup. - - .. attribute:: actuators - - A list of actuators linked to this controller. - - :type: sequence supporting index/string lookups and iteration. - - .. note:: - - The sensors are not necessarily owned by the same object. - - .. note:: - - When objects are instanced in dupligroups links may be lost from objects outside the dupligroup. - - .. attribute:: useHighPriority - - When set the controller executes always before all other controllers that dont have this set. - - :type: boolen - - .. note:: - - Order of execution between high priority controllers is not guaranteed. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ILogicBrick.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ILogicBrick.rst deleted file mode 100644 index e8d9413d7e5..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_ILogicBrick.rst +++ /dev/null @@ -1,26 +0,0 @@ -SCA_ILogicBrick(CValue) -======================= - -base class --- :class:`CValue` - -.. class:: SCA_ILogicBrick(CValue) - - Base class for all logic bricks. - - .. attribute:: executePriority - - This determines the order controllers are evaluated, and actuators are activated (lower priority is executed first). - - :type: executePriority: int - - .. attribute:: owner - - The game object this logic brick is attached to (read-only). - - :type: :class:`KX_GameObject` or None in exceptional cases. - - .. attribute:: name - - The name of this logic brick (read-only). - - :type: string diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_IObject.rst b/doc/python_api/rst/bge_types/bge.types.SCA_IObject.rst deleted file mode 100644 index a3080879fd0..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_IObject.rst +++ /dev/null @@ -1,8 +0,0 @@ -SCA_IObject(CValue) -=================== - -base class --- :class:`CValue` - -.. class:: SCA_IObject(CValue) - - This class has no python functions diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst deleted file mode 100644 index 7c8d632b0a2..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_ISensor.rst +++ /dev/null @@ -1,98 +0,0 @@ -SCA_ISensor(SCA_ILogicBrick) -============================ - -base class --- :class:`SCA_ILogicBrick` - -.. class:: SCA_ISensor(SCA_ILogicBrick) - - Base class for all sensor logic bricks. - - .. attribute:: usePosPulseMode - - Flag to turn positive pulse mode on and off. - - :type: boolean - - .. attribute:: useNegPulseMode - - Flag to turn negative pulse mode on and off. - - :type: boolean - - .. attribute:: frequency - - The frequency for pulse mode sensors. (Deprecated: use SCA_ISensor.skippedTicks) - - :type: integer - - .. attribute:: skippedTicks - - Number of logic ticks skipped between 2 active pulses - - :type: integer - - .. attribute:: level - - level Option whether to detect level or edge transition when entering a state. - It makes a difference only in case of logic state transition (state actuator). - A level detector will immediately generate a pulse, negative or positive - depending on the sensor condition, as soon as the state is activated. - A edge detector will wait for a state change before generating a pulse. - note: mutually exclusive with :data:`tap`, enabling will disable :data:`tap`. - - :type: boolean - - .. attribute:: tap - - When enabled only sensors that are just activated will send a positive event, - after this they will be detected as negative by the controllers. - This will make a key thats held act as if its only tapped for an instant. - note: mutually exclusive with :data:`level`, enabling will disable :data:`level`. - - :type: boolean - - .. attribute:: invert - - Flag to set if this sensor activates on positive or negative events. - - :type: boolean - - .. attribute:: triggered - - True if this sensor brick is in a positive state. (read-only). - - :type: boolean - - .. attribute:: positive - - True if this sensor brick is in a positive state. (read-only). - - :type: boolean - - .. attribute:: pos_ticks - - The number of ticks since the last positive pulse (read-only). - - :type: int - - .. attribute:: neg_ticks - - The number of ticks since the last negative pulse (read-only). - - :type: int - - .. attribute:: status - - The status of the sensor (read-only): can be one of :ref:`these constants<sensor-status>`. - - :type: int - - .. note:: - - This convenient attribute combines the values of triggered and positive attributes. - - .. method:: reset() - - Reset sensor internal state, effect depends on the type of sensor and settings. - - The sensor is put in its initial state as if it was just activated. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_JoystickSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_JoystickSensor.rst deleted file mode 100644 index 824b9932dc1..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_JoystickSensor.rst +++ /dev/null @@ -1,130 +0,0 @@ -SCA_JoystickSensor(SCA_ISensor) -=============================== - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_JoystickSensor(SCA_ISensor) - - This sensor detects player joystick events. - - .. attribute:: axisValues - - The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only). - - :type: list of ints. - - Each specifying the value of an axis between -32767 and 32767 depending on how far the axis is pushed, 0 for nothing. - The first 2 values are used by most joysticks and gamepads for directional control. 3rd and 4th values are only on some joysticks and can be used for arbitary controls. - - * left:[-32767, 0, ...] - * right:[32767, 0, ...] - * up:[0, -32767, ...] - * down:[0, 32767, ...] - - .. attribute:: axisSingle - - like :data:`axisValues` but returns a single axis value that is set by the sensor. (read-only). - - :type: integer - - .. note:: - - Only use this for "Single Axis" type sensors otherwise it will raise an error. - - .. attribute:: hatValues - - The state of the joysticks hats as a list of values :data:`numHats` long. (read-only). - - :type: list of ints - - Each specifying the direction of the hat from 1 to 12, 0 when inactive. - - Hat directions are as follows... - - * 0:None - * 1:Up - * 2:Right - * 4:Down - * 8:Left - * 3:Up - Right - * 6:Down - Right - * 12:Down - Left - * 9:Up - Left - - .. attribute:: hatSingle - - Like :data:`hatValues` but returns a single hat direction value that is set by the sensor. (read-only). - - :type: integer - - .. attribute:: numAxis - - The number of axes for the joystick at this index. (read-only). - - :type: integer - - .. attribute:: numButtons - - The number of buttons for the joystick at this index. (read-only). - - :type: integer - - .. attribute:: numHats - - The number of hats for the joystick at this index. (read-only). - - :type: integer - - .. attribute:: connected - - True if a joystick is connected at this joysticks index. (read-only). - - :type: boolean - - .. attribute:: index - - The joystick index to use (from 0 to 7). The first joystick is always 0. - - :type: integer - - .. attribute:: threshold - - Axis threshold. Joystick axis motion below this threshold wont trigger an event. Use values between (0 and 32767), lower values are more sensitive. - - :type: integer - - .. attribute:: button - - The button index the sensor reacts to (first button = 0). When the "All Events" toggle is set, this option has no effect. - - :type: integer - - .. attribute:: axis - - The axis this sensor reacts to, as a list of two values [axisIndex, axisDirection] - - * axisIndex: the axis index to use when detecting axis movement, 1=primary directional control, 2=secondary directional control. - * axisDirection: 0=right, 1=up, 2=left, 3=down. - - :type: [integer, integer] - - .. attribute:: hat - - The hat the sensor reacts to, as a list of two values: [hatIndex, hatDirection] - - * hatIndex: the hat index to use when detecting hat movement, 1=primary hat, 2=secondary hat (4 max). - * hatDirection: 1-12. - - :type: [integer, integer] - - .. method:: getButtonActiveList() - - :return: A list containing the indicies of the currently pressed buttons. - :rtype: list - - .. method:: getButtonStatus(buttonIndex) - - :arg buttonIndex: the button index, 0=first button - :type buttonIndex: integer - :return: The current pressed state of the specified button. - :rtype: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_KeyboardSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_KeyboardSensor.rst deleted file mode 100644 index 7450d9c19bb..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_KeyboardSensor.rst +++ /dev/null @@ -1,61 +0,0 @@ -SCA_KeyboardSensor(SCA_ISensor) -=============================== - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_KeyboardSensor(SCA_ISensor) - - A keyboard sensor detects player key presses. - - See module :mod:`bge.events` for keycode values. - - .. attribute:: key - - The key code this sensor is looking for. - - :type: keycode from :mod:`bge.events` module - - .. attribute:: hold1 - - The key code for the first modifier this sensor is looking for. - - :type: keycode from :mod:`bge.events` module - - .. attribute:: hold2 - - The key code for the second modifier this sensor is looking for. - - :type: keycode from :mod:`bge.events` module - - .. attribute:: toggleProperty - - The name of the property that indicates whether or not to log keystrokes as a string. - - :type: string - - .. attribute:: targetProperty - - The name of the property that receives keystrokes in case in case a string is logged. - - :type: string - - .. attribute:: useAllKeys - - Flag to determine whether or not to accept all keys. - - :type: boolean - - .. attribute:: events - - a list of pressed keys that have either been pressed, or just released, or are active this frame. (read-only). - - :type: list [[:ref:`keycode<keyboard-keys>`, :ref:`status<input-status>`], ...] - - .. method:: getKeyStatus(keycode) - - Get the status of a key. - - :arg keycode: The code that represents the key you want to get the state of, use one of :ref:`these constants<keyboard-keys>` - :type keycode: integer - :return: The state of the given key, can be one of :ref:`these constants<input-status>` - :rtype: int diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_MouseSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_MouseSensor.rst deleted file mode 100644 index 8f22ec06404..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_MouseSensor.rst +++ /dev/null @@ -1,36 +0,0 @@ -SCA_MouseSensor(SCA_ISensor) -============================ - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_MouseSensor(SCA_ISensor) - - Mouse Sensor logic brick. - - .. attribute:: position - - current [x, y] coordinates of the mouse, in frame coordinates (pixels). - - :type: [integer, interger] - - .. attribute:: mode - - sensor mode. - - :type: integer - - * KX_MOUSESENSORMODE_LEFTBUTTON(1) - * KX_MOUSESENSORMODE_MIDDLEBUTTON(2) - * KX_MOUSESENSORMODE_RIGHTBUTTON(3) - * KX_MOUSESENSORMODE_WHEELUP(4) - * KX_MOUSESENSORMODE_WHEELDOWN(5) - * KX_MOUSESENSORMODE_MOVEMENT(6) - - .. method:: getButtonStatus(button) - - Get the mouse button status. - - :arg button: The code that represents the key you want to get the state of, use one of :ref:`these constants<mouse-keys>` - :type button: int - :return: The state of the given key, can be one of :ref:`these constants<input-status>` - :rtype: int diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_NANDController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_NANDController.rst deleted file mode 100644 index 74094f476f3..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_NANDController.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCA_NANDController(SCA_IController) -=================================== - -base class --- :class:`SCA_IController` - -.. class:: SCA_NANDController(SCA_IController) - - An NAND controller activates when all linked sensors are not active. - - There are no special python methods for this controller. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_NORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_NORController.rst deleted file mode 100644 index ee06cda19aa..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_NORController.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCA_NORController(SCA_IController) -================================== - -base class --- :class:`SCA_IController` - -.. class:: SCA_NORController(SCA_IController) - - An NOR controller activates only when all linked sensors are de-activated. - - There are no special python methods for this controller. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_ORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_ORController.rst deleted file mode 100644 index 874e706b3ab..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_ORController.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCA_ORController(SCA_IController) -================================= - -base class --- :class:`SCA_IController` - -.. class:: SCA_ORController(SCA_IController) - - An OR controller activates when any connected sensor activates. - - There are no special python methods for this controller. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PropertyActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PropertyActuator.rst deleted file mode 100644 index 149b2607077..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_PropertyActuator.rst +++ /dev/null @@ -1,26 +0,0 @@ -SCA_PropertyActuator(SCA_IActuator) -=================================== - -base class --- :class:`SCA_IActuator` - -.. class:: SCA_PropertyActuator(SCA_IActuator) - - Property Actuator - - .. attribute:: propName - - the property on which to operate. - - :type: string - - .. attribute:: value - - the value with which the actuator operates. - - :type: string - - .. attribute:: mode - - TODO - add constants to game logic dict!. - - :type: integer diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PropertySensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PropertySensor.rst deleted file mode 100644 index d9fd1cc313f..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_PropertySensor.rst +++ /dev/null @@ -1,38 +0,0 @@ -SCA_PropertySensor(SCA_ISensor) -=============================== - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_PropertySensor(SCA_ISensor) - - Activates when the game object property matches. - - .. attribute:: mode - - Type of check on the property. Can be one of :ref:`these constants <logic-property-sensor>` - - :type: integer. - - .. attribute:: propName - - the property the sensor operates. - - :type: string - - .. attribute:: value - - the value with which the sensor compares to the value of the property. - - :type: string - - .. attribute:: min - - the minimum value of the range used to evaluate the property when in interval mode. - - :type: string - - .. attribute:: max - - the maximum value of the range used to evaluate the property when in interval mode. - - :type: string diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonController.rst deleted file mode 100644 index a11c1398546..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_PythonController.rst +++ /dev/null @@ -1,51 +0,0 @@ -SCA_PythonController(SCA_IController) -===================================== - -base class --- :class:`SCA_IController` - -.. class:: SCA_PythonController(SCA_IController) - - A Python controller uses a Python script to activate it's actuators, - based on it's sensors. - - .. attribute:: owner - - The object the controller is attached to. - - :type: :class:`KX_GameObject` - - .. attribute:: script - - The value of this variable depends on the execution methid. - - * When 'Script' execution mode is set this value contains the entire python script as a single string (not the script name as you might expect) which can be modified to run different scripts. - * When 'Module' execution mode is set this value will contain a single line string - module name and function "module.func" or "package.modile.func" where the module names are python textblocks or external scripts. - - :type: string - - .. note:: - - Once this is set the script name given for warnings will remain unchanged. - - .. attribute:: mode - - the execution mode for this controller (read-only). - - * Script: 0, Execite the :data:`script` as a python code. - * Module: 1, Execite the :data:`script` as a module and function. - - :type: integer - - .. method:: activate(actuator) - - Activates an actuator attached to this controller. - - :arg actuator: The actuator to operate on. - :type actuator: actuator or the actuator name as a string - - .. method:: deactivate(actuator) - - Deactivates an actuator attached to this controller. - - :arg actuator: The actuator to operate on. - :type actuator: actuator or the actuator name as a string diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst deleted file mode 100644 index a8867ee7f96..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_PythonJoystick.rst +++ /dev/null @@ -1,74 +0,0 @@ -SCA_PythonJoystick(PyObjectPlus) -================================ - -base class --- :class:`PyObjectPlus` - -.. class:: SCA_PythonJoystick(PyObjectPlus) - - A Python interface to a joystick. - - .. attribute:: name - - The name assigned to the joystick by the operating system. (read-only) - - :type: string - - .. attribute:: activeButtons - - A list of active button values. (read-only) - - :type: list - - .. attribute:: axisValues - - The state of the joysticks axis as a list of values :data:`numAxis` long. (read-only). - - :type: list of ints. - - Each specifying the value of an axis between -1.0 and 1.0 - depending on how far the axis is pushed, 0 for nothing. - The first 2 values are used by most joysticks and gamepads for directional control. - 3rd and 4th values are only on some joysticks and can be used for arbitary controls. - - * left:[-1.0, 0.0, ...] - * right:[1.0, 0.0, ...] - * up:[0.0, -1.0, ...] - * down:[0.0, 1.0, ...] - - .. attribute:: hatValues - - The state of the joysticks hats as a list of values :data:`numHats` long. (read-only). - - :type: list of ints - - Each specifying the direction of the hat from 1 to 12, 0 when inactive. - - Hat directions are as follows... - - * 0:None - * 1:Up - * 2:Right - * 4:Down - * 8:Left - * 3:Up - Right - * 6:Down - Right - * 12:Down - Left - * 9:Up - Left - - .. attribute:: numAxis - - The number of axes for the joystick at this index. (read-only). - - :type: integer - - .. attribute:: numButtons - - The number of buttons for the joystick at this index. (read-only). - - :type: integer - - .. attribute:: numHats - - The number of hats for the joystick at this index. (read-only). - - :type: integer diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonKeyboard.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonKeyboard.rst deleted file mode 100644 index 59a3d99efc2..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_PythonKeyboard.rst +++ /dev/null @@ -1,34 +0,0 @@ -SCA_PythonKeyboard(PyObjectPlus) -================================ - -base class --- :class:`PyObjectPlus` - -.. class:: SCA_PythonKeyboard(PyObjectPlus) - - The current keyboard. - - .. attribute:: events - - A dictionary containing the status of each keyboard event or key. (read-only). - - :type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...} - - .. attribute:: active_events - - A dictionary containing the status of only the active keyboard events or keys. (read-only). - - :type: dictionary {:ref:`keycode<keyboard-keys>`::ref:`status<input-status>`, ...} - - - .. method:: getClipboard() - - Gets the clipboard text. - - :rtype: string - - .. method:: setClipboard(text) - - Sets the clipboard text. - - :arg text: New clipboard text - :type text: string diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_PythonMouse.rst b/doc/python_api/rst/bge_types/bge.types.SCA_PythonMouse.rst deleted file mode 100644 index 6088d785eeb..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_PythonMouse.rst +++ /dev/null @@ -1,32 +0,0 @@ -SCA_PythonMouse(PyObjectPlus) -============================= - -base class --- :class:`PyObjectPlus` - -.. class:: SCA_PythonMouse(PyObjectPlus) - - The current mouse. - - .. attribute:: events - - a dictionary containing the status of each mouse event. (read-only). - - :type: dictionary {:ref:`keycode<mouse-keys>`::ref:`status<input-status>`, ...} - - .. attribute:: active_events - - a dictionary containing the status of only the active mouse events. (read-only). - - :type: dictionary {:ref:`keycode<mouse-keys>`::ref:`status<input-status>`, ...} - - .. attribute:: position - - The normalized x and y position of the mouse cursor. - - :type: tuple (x, y) - - .. attribute:: visible - - The visibility of the mouse cursor. - - :type: boolean diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_RandomActuator.rst b/doc/python_api/rst/bge_types/bge.types.SCA_RandomActuator.rst deleted file mode 100644 index ef497d81643..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_RandomActuator.rst +++ /dev/null @@ -1,124 +0,0 @@ -SCA_RandomActuator(SCA_IActuator) -================================= - -base class --- :class:`SCA_IActuator` - -.. class:: SCA_RandomActuator(SCA_IActuator) - - Random Actuator - - .. attribute:: seed - - Seed of the random number generator. - - :type: integer. - - Equal seeds produce equal series. If the seed is 0, the generator will produce the same value on every call. - - .. attribute:: para1 - - the first parameter of the active distribution. - - :type: float, read-only. - - Refer to the documentation of the generator types for the meaning of this value. - - .. attribute:: para2 - - the second parameter of the active distribution. - - :type: float, read-only - - Refer to the documentation of the generator types for the meaning of this value. - - .. attribute:: distribution - - Distribution type. (read-only). Can be one of :ref:`these constants <logic-random-distributions>` - - :type: integer - - .. attribute:: propName - - the name of the property to set with the random value. - - :type: string - - If the generator and property types do not match, the assignment is ignored. - - .. method:: setBoolConst(value) - - Sets this generator to produce a constant boolean value. - - :arg value: The value to return. - :type value: boolean - - .. method:: setBoolUniform() - - Sets this generator to produce a uniform boolean distribution. - - The generator will generate True or False with 50% chance. - - .. method:: setBoolBernouilli(value) - - Sets this generator to produce a Bernouilli distribution. - - :arg value: Specifies the proportion of False values to produce. - - * 0.0: Always generate True - * 1.0: Always generate False - :type value: float - - .. method:: setIntConst(value) - - Sets this generator to always produce the given value. - - :arg value: the value this generator produces. - :type value: integer - - .. method:: setIntUniform(lower_bound, upper_bound) - - Sets this generator to produce a random value between the given lower and - upper bounds (inclusive). - - :type lower_bound: integer - :type upper_bound: integer - - .. method:: setIntPoisson(value) - - Generate a Poisson-distributed number. - - This performs a series of Bernouilli tests with parameter value. - It returns the number of tries needed to achieve succes. - - :type value: float - - .. method:: setFloatConst(value) - - Always generate the given value. - - :type value: float - - .. method:: setFloatUniform(lower_bound, upper_bound) - - Generates a random float between lower_bound and upper_bound with a - uniform distribution. - - :type lower_bound: float - :type upper_bound: float - - .. method:: setFloatNormal(mean, standard_deviation) - - Generates a random float from the given normal distribution. - - :arg mean: The mean (average) value of the generated numbers - :type mean: float - :arg standard_deviation: The standard deviation of the generated numbers. - :type standard_deviation: float - - .. method:: setFloatNegativeExponential(half_life) - - Generate negative-exponentially distributed numbers. - - The half-life 'time' is characterized by half_life. - - :type half_life: float diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_RandomSensor.rst b/doc/python_api/rst/bge_types/bge.types.SCA_RandomSensor.rst deleted file mode 100644 index aaa8b1084fe..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_RandomSensor.rst +++ /dev/null @@ -1,20 +0,0 @@ -SCA_RandomSensor(SCA_ISensor) -============================= - -base class --- :class:`SCA_ISensor` - -.. class:: SCA_RandomSensor(SCA_ISensor) - - This sensor activates randomly. - - .. attribute:: lastDraw - - The seed of the random number generator. - - :type: integer - - .. attribute:: seed - - The seed of the random number generator. - - :type: integer diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_XNORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_XNORController.rst deleted file mode 100644 index a46ac104307..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_XNORController.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCA_XNORController(SCA_IController) -=================================== - -base class --- :class:`SCA_IController` - -.. class:: SCA_XNORController(SCA_IController) - - An XNOR controller activates when all linked sensors are the same (activated or inative). - - There are no special python methods for this controller. diff --git a/doc/python_api/rst/bge_types/bge.types.SCA_XORController.rst b/doc/python_api/rst/bge_types/bge.types.SCA_XORController.rst deleted file mode 100644 index bc69df421ea..00000000000 --- a/doc/python_api/rst/bge_types/bge.types.SCA_XORController.rst +++ /dev/null @@ -1,10 +0,0 @@ -SCA_XORController(SCA_IController) -================================== - -base class --- :class:`SCA_IController` - -.. class:: SCA_XORController(SCA_IController) - - An XOR controller activates when there is the input is mixed, but not when all are on or off. - - There are no special python methods for this controller. diff --git a/doc/python_api/rst/change_log.rst b/doc/python_api/rst/change_log.rst index 21c7cf96135..905294d0f88 100644 --- a/doc/python_api/rst/change_log.rst +++ b/doc/python_api/rst/change_log.rst @@ -54,19 +54,6 @@ Removed * **network_render** -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.use_material_physics_fh` - -Removed -^^^^^^^ - -* **use_material_physics** - bpy.types.SplinePoints ---------------------- @@ -219,15 +206,6 @@ Renamed * **viscosity_omega** -> :class:`bpy.types.SPHFluidSettings.linear_viscosity` -bpy.types.ConstraintActuator ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ConstraintActuator.direction_axis_pos` -* :class:`bpy.types.ConstraintActuator.fh_force` - Removed ^^^^^^^ @@ -679,14 +657,6 @@ Removed * **use_branching** * **use_symmetric_branching** -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.show_mouse` - bpy.types.MaterialPhysics ------------------------- @@ -863,14 +833,6 @@ Added * :class:`bpy.types.SpaceTextEditor.use_match_case` -bpy.types.CameraActuator ------------------------- - -Added -^^^^^ - -* :class:`bpy.types.CameraActuator.damping` - bpy.types.Property ------------------ @@ -903,15 +865,6 @@ Added * :class:`bpy.types.Image.resolution` -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.use_glsl_color_management` - - 2.58 to 2.59 ============ @@ -1070,20 +1023,6 @@ Removed * **use_object_color** * **use_blend_shared** -Moved -^^^^^ - -* **hide** -> :class:`bpy.types.Material.game_settings.invisible` -* **use_collision** -> :class:`bpy.types.Material.game_settings.physics` -* **use_light** -> :class:`bpy.types.Material.game_settings.use_shadeless` -* **use_twoside** -> :class:`bpy.types.Material.game_settings.backface_culling` -* **use_bitmap_text** -> :class:`bpy.types.Material.game_settings.text` -* **blend_type** -> :class:`bpy.types.Material.game_settings.alpha_blend` -* **use_alpha_sort** -> :class:`bpy.types.Material.game_settings.alpha_blend` -* **use_billboard** -> :class:`bpy.types.Material.game_settings.face_orientation` -* **use_halo** -> :class:`bpy.types.Material.game_settings.face_orientation` -* **use_shadow_cast** -> :class:`bpy.types.Material.game_settings.face_orientation` - .. Automatically Generated, 2.59 -> r40804! bpy.types.RenderSettings @@ -1148,15 +1087,6 @@ Added * :class:`bpy.types.Armature.deform_method` -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.obstacle_radius` -* :class:`bpy.types.GameObjectSettings.use_obstacle_create` - bpy.types.BlendData ------------------- @@ -1360,14 +1290,6 @@ Added * :class:`bpy.types.MovieSequence.stream_index` -bpy.types.Material ------------------- - -Added -^^^^^ - -* :class:`bpy.types.Material.game_settings` - bpy.types.Object ---------------- @@ -1409,19 +1331,6 @@ Added * :class:`bpy.types.DopeSheet.show_datablock_filters` * :class:`bpy.types.DopeSheet.show_speakers` -bpy.types.ActionActuator ------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ActionActuator.apply_to_children` -* :class:`bpy.types.ActionActuator.layer` -* :class:`bpy.types.ActionActuator.layer_weight` -* :class:`bpy.types.ActionActuator.use_additive` -* :class:`bpy.types.ActionActuator.use_force` -* :class:`bpy.types.ActionActuator.use_local` - bpy.types.VertexGroup --------------------- @@ -1470,19 +1379,6 @@ Added * :class:`bpy.types.ParticleSettings.adaptive_subframes` * :class:`bpy.types.ParticleSettings.courant_target` -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.level_height` -* :class:`bpy.types.SceneGameData.obstacle_simulation` -* :class:`bpy.types.SceneGameData.recast_data` -* :class:`bpy.types.SceneGameData.restrict_animation_updates` -* :class:`bpy.types.SceneGameData.show_obstacle_simulation` - - 2.60 to 2.61 ============ @@ -2156,24 +2052,6 @@ Added * :class:`bpy.types.DomainFluidSettings.frame_offset` * :class:`bpy.types.DomainFluidSettings.simulation_rate` -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.exit_key` -* :class:`bpy.types.SceneGameData.samples` -* :class:`bpy.types.SceneGameData.use_desktop` - -bpy.types.Sensor ----------------- - -Added -^^^^^ - -* :class:`bpy.types.Sensor.controllers` - bpy.types.Scene --------------- @@ -2182,14 +2060,6 @@ Removed * **collada_export** -bpy.types.Controller --------------------- - -Added -^^^^^ - -* :class:`bpy.types.Controller.actuators` - bpy.types.SceneRenderLayer -------------------------- @@ -2498,14 +2368,6 @@ Added * :class:`bpy.types.ParticleSettings.use_rotations` -bpy.types.SceneGameData ------------------------ - -Renamed -^^^^^^^ - -* **dome_tesselation** -> :class:`bpy.types.SceneGameData.dome_tessellation` - bpy.types.RegionView3D ---------------------- @@ -2635,14 +2497,6 @@ Renamed * **location** -> :class:`bpy.types.TexMapping.translation` -bpy.types.ArmatureActuator --------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ArmatureActuator.influence` - bpy.types.ThemeTextEditor ------------------------- @@ -2780,17 +2634,6 @@ Added * :class:`bpy.types.ThemeView3D.bone_pose_active` * :class:`bpy.types.ThemeView3D.skin_root` -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.fall_speed` -* :class:`bpy.types.GameObjectSettings.jump_speed` -* :class:`bpy.types.GameObjectSettings.step_height` - - bpy.types.BlendData ------------------- @@ -3065,16 +2908,6 @@ Added * :class:`bpy.types.ParticleSettings.use_scale_dupli` -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.deactivation_angular_threshold` -* :class:`bpy.types.SceneGameData.deactivation_linear_threshold` -* :class:`bpy.types.SceneGameData.deactivation_time` - bpy.types.SoundSequence ----------------------- @@ -3519,14 +3352,6 @@ Added * :class:`bpy.types.GlowSequence.input_1` * :class:`bpy.types.GlowSequence.input_count` -bpy.types.MouseSensor ---------------------- - -Added -^^^^^ - -* :class:`bpy.types.MouseSensor.use_pulse` - bpy.types.MovieSequence ----------------------- @@ -4116,15 +3941,6 @@ Removed * **use_outflow** -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.collision_group` -* :class:`bpy.types.GameObjectSettings.collision_mask` - bpy.types.SpaceView3D --------------------- @@ -4660,15 +4476,6 @@ Function Arguments * :class:`bpy.types.Object.to_mesh` (scene, apply_modifiers, settings, calc_tessface), *was (scene, apply_modifiers, settings)* -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.raster_storage` -* :class:`bpy.types.SceneGameData.use_material_caching` - bpy.types.CyclesRenderSettings ------------------------------ @@ -4760,15 +4567,6 @@ Added * :class:`bpy.types.CompositorNodeTree.use_groupnode_buffer` -bpy.types.ObjectActuator ------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ObjectActuator.use_add_character_location` -* :class:`bpy.types.ObjectActuator.use_character_jump` - bpy.types.Bone -------------- @@ -5102,14 +4900,6 @@ Added * :class:`bpy.types.LoopColors.remove` -bpy.types.SceneGameData ------------------------ - -Renamed -^^^^^^^ - -* **restrict_animation_updates** -> :class:`bpy.types.SceneGameData.use_restrict_animation_updates` - bpy.types.NodeSocket -------------------- @@ -5943,14 +5733,6 @@ Added 2.68 to 2.69 ============ -bpy.types.ActionActuator ------------------------- - -Added -^^^^^ - -* :class:`bpy.types.ActionActuator.blend_mode` - bpy.types.ColorManagedViewSettings ---------------------------------- @@ -6180,14 +5962,6 @@ Added * :class:`bpy.types.RenderLayer.use_pass_subsurface_direct` * :class:`bpy.types.RenderLayer.use_pass_subsurface_indirect` -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.vsync` - bpy.types.SceneRenderLayer -------------------------- @@ -6344,14 +6118,6 @@ Removed * **raycasting_algorithm** -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.use_record_animation` - bpy.types.Armature ------------------ @@ -6963,14 +6729,6 @@ Removed 2.70 to 2.71 ============ -bpy.types.Actuator ------------------- - -Added -^^^^^ - -* :class:`bpy.types.Actuator.active` - bpy.types.BlendDataLineStyles ----------------------------- @@ -7010,14 +6768,6 @@ Added * :class:`bpy.types.TransformConstraint.to_min_z_rot` * :class:`bpy.types.TransformConstraint.to_min_z_scale` -bpy.types.Controller --------------------- - -Added -^^^^^ - -* :class:`bpy.types.Controller.active` - bpy.types.FCurve ---------------- @@ -7225,14 +6975,6 @@ Added * :class:`bpy.types.RenderSettings.bake` -bpy.types.Sensor ----------------- - -Added -^^^^^ - -* :class:`bpy.types.Sensor.active` - bpy.types.SequenceElements -------------------------- @@ -7343,15 +7085,6 @@ Function Arguments 2.71 to 2.72 ============ -bpy.types.EditObjectActuator ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.EditObjectActuator.track_axis` -* :class:`bpy.types.EditObjectActuator.up_axis` - bpy.types.BlendData ------------------- @@ -7643,17 +7376,6 @@ Added * :class:`bpy.types.RenderSettings.preview_start_resolution` * :class:`bpy.types.RenderSettings.use_render_cache` -bpy.types.MouseSensor ---------------------- - -Added -^^^^^ - -* :class:`bpy.types.MouseSensor.material` -* :class:`bpy.types.MouseSensor.property` -* :class:`bpy.types.MouseSensor.use_material` -* :class:`bpy.types.MouseSensor.use_x_ray` - bpy.types.SpaceUVEditor ----------------------- @@ -8009,14 +7731,6 @@ Added 2.73 to 2.74 ============ -bpy.types.SteeringActuator --------------------------- - -Added -^^^^^ - -* :class:`bpy.types.SteeringActuator.lock_z_velocity` - bpy.types.BackgroundImage ------------------------- @@ -8847,28 +8561,6 @@ Function Arguments * :class:`bpy.types.RenderSettings.frame_path` (frame, preview, view), *was (frame)* -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.scene_hysteresis_percentage` -* :class:`bpy.types.SceneGameData.use_scene_hysteresis` - -bpy.types.Sensor ----------------- - -Added -^^^^^ - -* :class:`bpy.types.Sensor.tick_skip` - -Removed -^^^^^^^ - -* **frequency** - bpy.types.EffectSequence ------------------------ @@ -9077,15 +8769,6 @@ Added * :class:`bpy.types.FileSelectParams.use_filter_blendid` * :class:`bpy.types.FileSelectParams.use_library_browsing` -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.angular_velocity_max` -* :class:`bpy.types.GameObjectSettings.angular_velocity_min` - bpy.types.ID ------------ @@ -9354,14 +9037,6 @@ Removed * **thumbnail_size** -bpy.types.GameObjectSettings ----------------------------- - -Added -^^^^^ - -* :class:`bpy.types.GameObjectSettings.jump_max` - bpy.types.ID ------------ @@ -10523,22 +10198,6 @@ Added * :class:`bpy.types.RenderSettings.use_stamp_memory` * :class:`bpy.types.RenderSettings.use_world_space_shading` -bpy.types.SceneGameData ------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameData.use_glsl_environment_lighting` - -bpy.types.SceneGameRecastData ------------------------------ - -Added -^^^^^ - -* :class:`bpy.types.SceneGameRecastData.partitioning` - bpy.types.TextSequence ---------------------- diff --git a/doc/python_api/rst/gpu.rst b/doc/python_api/rst/gpu.rst deleted file mode 100644 index cf639357a31..00000000000 --- a/doc/python_api/rst/gpu.rst +++ /dev/null @@ -1,700 +0,0 @@ -******************* -GPU functions (gpu) -******************* - -.. module:: gpu - -This module provides access to materials GLSL shaders. - -Submodules: - -.. toctree:: - :maxdepth: 1 - - gpu.offscreen.rst - - -Intro -===== - -Module to provide functions concerning the GPU implementation in Blender, in particular -the GLSL shaders that blender generates automatically to render materials in the 3D view -and in the game engine. - -.. warning:: - - The API provided by this module is subject to change. - The data exposed by the API are are closely related to Blender's internal GLSL code - and may change if the GLSL code is modified (e.g. new uniform type). - - -Constants -========= - -GLSL Data Type --------------- - -.. _data-type: - -Type of GLSL data. -For shader uniforms, the data type determines which ``glUniform`` function -variant to use to send the uniform value to the GPU. -For vertex attributes, the data type determines which ``glVertexAttrib`` function -variant to use to send the vertex attribute to the GPU. - -See export_shader_ - -.. data:: GPU_DATA_1I - - one integer - -.. data:: GPU_DATA_1F - - one float - -.. data:: GPU_DATA_2F - - two floats - -.. data:: GPU_DATA_3F - - three floats - -.. data:: GPU_DATA_4F - - four floats - -.. data:: GPU_DATA_9F - - matrix 3x3 in column-major order - -.. data:: GPU_DATA_16F - - matrix 4x4 in column-major order - -.. data:: GPU_DATA_4UB - - four unsigned byte - - -GLSL Uniform Types ------------------- - -.. _uniform-type: - -Constants that specify the type of uniform used in a GLSL shader. -The uniform type determines the data type, origin and method -of calculation used by Blender to compute the uniform value. - -The calculation of some of the uniforms is based on matrices available in the scene: - - .. _mat4_cam_to_world: - .. _mat4_world_to_cam: - - ``mat4_cam_to_world`` - Model matrix of the camera. OpenGL 4x4 matrix that converts - camera local coordinates to world coordinates. In blender this is obtained from the - 'matrix_world' attribute of the camera object. - - Some uniform will need the *mat4_world_to_cam* - matrix computed as the inverse of this matrix. - - .. _mat4_object_to_world: - .. _mat4_world_to_object: - - ``mat4_object_to_world`` - Model matrix of the object that is being rendered. OpenGL 4x4 matric that converts - object local coordinates to world coordinates. In blender this is obtained from the - 'matrix_world' attribute of the object. - - Some uniform will need the *mat4_world_to_object* matrix, computed as the inverse of this matrix. - - .. _mat4_lamp_to_world: - .. _mat4_world_to_lamp: - - ``mat4_lamp_to_world`` - Model matrix of the lamp lighting the object. OpenGL 4x4 matrix that converts lamp - local coordinates to world coordinates. In blender this is obtained from the - 'matrix_world' attribute of the lamp object. - - Some uniform will need the *mat4_world_to_lamp* matrix - computed as the inverse of this matrix. - - -.. note:: - - Any uniforms used for view projections or transformations (object, lamp matrices for eg), - can only be set once per frame. - - -GLSL Object Uniforms -^^^^^^^^^^^^^^^^^^^^ - -.. note:: - - - Object transformations and color must be set before drawing the object. - - There is at most one uniform of these types per shader. - -.. data:: GPU_DYNAMIC_OBJECT_VIEWMAT - - A matrix that converts world coordinates to camera coordinates (see mat4_world_to_cam_). - - :type: matrix4x4 - -.. data:: GPU_DYNAMIC_OBJECT_MAT - - A matrix that converts object coordinates to world coordinates (see mat4_object_to_world_). - - :type: matrix4x4 - -.. data:: GPU_DYNAMIC_OBJECT_VIEWIMAT - - The uniform is a 4x4 GL matrix that converts coordinates - in camera space to world coordinates (see mat4_cam_to_world_). - - :type: matrix4x4 - -.. data:: GPU_DYNAMIC_OBJECT_IMAT - - The uniform is a 4x4 GL matrix that converts world coodinates - to object coordinates (see mat4_world_to_object_). - - :type: matrix4x4 - -.. data:: GPU_DYNAMIC_OBJECT_COLOR - - An RGB color + alpha defined at object level. - Each values between 0.0 and 1.0. - - See :class:`bpy.types.Object.color`. - - :type: float4 - -.. data:: GPU_DYNAMIC_OBJECT_AUTOBUMPSCALE - - Multiplier for bump-map scaling. - - :type: float - - -GLSL Lamp Uniforms -^^^^^^^^^^^^^^^^^^ - -.. note:: - - There is one uniform of that type per lamp lighting the material. - -.. data:: GPU_DYNAMIC_LAMP_DYNVEC - - Represents the direction of light in camera space. - - Computed as: - mat4_world_to_cam_ * (-vec3_lamp_Z_axis) - - .. note:: - - - The lamp Z axis points to the opposite direction of light. - - The norm of the vector should be unit length. - - :type: float3 - -.. data:: GPU_DYNAMIC_LAMP_DYNCO - - Represents the position of the light in camera space. - - Computed as: - mat4_world_to_cam_ * vec3_lamp_pos - - :type: float3 - -.. data:: GPU_DYNAMIC_LAMP_DYNIMAT - - Matrix that converts vector in camera space to lamp space. - - Computed as: - mat4_world_to_lamp_ * mat4_cam_to_world_ - - :type: matrix4x4 - -.. data:: GPU_DYNAMIC_LAMP_DYNPERSMAT - - Matrix that converts a vector in camera space to shadow buffer depth space. - - Computed as: - mat4_perspective_to_depth_ * mat4_lamp_to_perspective_ * mat4_world_to_lamp_ * mat4_cam_to_world_. - - .. _mat4_perspective_to_depth: - - ``mat4_perspective_to_depth`` is a fixed matrix defined as follow:: - - 0.5 0.0 0.0 0.5 - 0.0 0.5 0.0 0.5 - 0.0 0.0 0.5 0.5 - 0.0 0.0 0.0 1.0 - - .. note:: - - - There is one uniform of that type per lamp casting shadow in the scene. - - :type: matrix4x4 - -.. data:: GPU_DYNAMIC_LAMP_DYNENERGY - - See :class:`bpy.types.Lamp.energy`. - - :type: float - -.. data:: GPU_DYNAMIC_LAMP_DYNCOL - - See :class:`bpy.types.Lamp.color`. - - :type: float3 - -.. data:: GPU_DYNAMIC_LAMP_DISTANCE - - See :class:`bpy.types.Lamp.distance`. - - :type: float - -.. data:: GPU_DYNAMIC_LAMP_ATT1 - - See - :class:`bpy.types.PointLamp.linear_attenuation`, - :class:`bpy.types.SpotLamp.linear_attenuation`. - - :type: float - -.. data:: GPU_DYNAMIC_LAMP_ATT2 - - See - :class:`bpy.types.PointLamp.quadratic_attenuation`, - :class:`bpy.types.SpotLamp.quadratic_attenuation`. - - :type: float - -.. data:: GPU_DYNAMIC_LAMP_SPOTSIZE - - See :class:`bpy.types.SpotLamp.spot_size`. - - :type: float - -.. data:: GPU_DYNAMIC_LAMP_SPOTBLEND - - See :class:`bpy.types.SpotLamp.spot_blend`. - - :type: float - -.. data:: GPU_DYNAMIC_LAMP_SPOTSCALE - - Represents the SpotLamp local scale. - - :type: float2 - - -GLSL Sampler Uniforms -^^^^^^^^^^^^^^^^^^^^^ - -.. data:: GPU_DYNAMIC_SAMPLER_2DBUFFER - - Represents an internal texture used for certain effect - (color band, etc). - - :type: integer - -.. data:: GPU_DYNAMIC_SAMPLER_2DIMAGE - - Represents a texture loaded from an image file. - - :type: integer - -.. data:: GPU_DYNAMIC_SAMPLER_2DSHADOW - - Represents a texture loaded from a shadow buffer file. - - :type: integer - - -GLSL Mist Uniforms -^^^^^^^^^^^^^^^^^^ - -.. data:: GPU_DYNAMIC_MIST_ENABLE: - - See :class:`bpy.types.WorldMistSettings.use_mist`. - - :type: float (0 or 1) - -.. data:: GPU_DYNAMIC_MIST_START - - See :class:`bpy.types.WorldMistSettings.start`. - - :type: float - - See :class:`bpy.types.WorldMistSettings.depth`. - -.. data:: GPU_DYNAMIC_MIST_DISTANCE - - :type: float - - See :class:`bpy.types.WorldMistSettings.intensity`. - -.. data:: GPU_DYNAMIC_MIST_INTENSITY - - :type: float - -.. data:: GPU_DYNAMIC_MIST_TYPE - - See :class:`bpy.types.WorldMistSettings.falloff`. - - :type: float (used as an index into the type) - -.. data:: GPU_DYNAMIC_MIST_COLOR - - -GLSL World Uniforms -^^^^^^^^^^^^^^^^^^^ - -.. data:: GPU_DYNAMIC_HORIZON_COLOR - - See :class:`bpy.types.World.horizon_color`. - - :type: float3 - -.. data:: GPU_DYNAMIC_AMBIENT_COLOR - - See :class:`bpy.types.World.ambient_color`. - - :type: float3 - - -GLSL Material Uniforms -^^^^^^^^^^^^^^^^^^^^^^ - -.. data:: GPU_DYNAMIC_MAT_DIFFRGB - - See :class:`bpy.types.Material.diffuse_color`. - - :type: float3 - -.. data:: GPU_DYNAMIC_MAT_REF - - See :class:`bpy.types.Material.diffuse_intensity`. - - :type: float - -.. data:: GPU_DYNAMIC_MAT_SPECRGB - - See :class:`bpy.types.Material.specular_color`. - - :type: float3 - -.. data:: GPU_DYNAMIC_MAT_SPEC - - See :class:`bpy.types.Material.specular_intensity`. - - :type: float - -.. data:: GPU_DYNAMIC_MAT_HARD - - See :class:`bpy.types.Material.specular_hardness`. - - :type: float - -.. data:: GPU_DYNAMIC_MAT_EMIT - - See :class:`bpy.types.Material.emit`. - - :type: float - -.. data:: GPU_DYNAMIC_MAT_AMB - - See :class:`bpy.types.Material.ambient`. - - :type: float - -.. data:: GPU_DYNAMIC_MAT_ALPHA - - See :class:`bpy.types.Material.alpha`. - - :type: float - - - -GLSL Attribute Type -------------------- - -.. _attribute-type: - -Type of the vertex attribute used in the GLSL shader. Determines the mesh custom data -layer that contains the vertex attribute. - -.. data:: CD_MTFACE - - Vertex attribute is a UV Map. Data type is vector of 2 float. - - There can be more than one attribute of that type, they are differenciated by name. - In blender, you can retrieve the attribute data with: - - .. code-block:: python - - mesh.uv_layers[attribute["name"]] - -.. data:: CD_MCOL - - Vertex attribute is color layer. Data type is vector 4 unsigned byte (RGBA). - - There can be more than one attribute of that type, they are differenciated by name. - In blender you can retrieve the attribute data with: - - .. code-block:: python - - mesh.vertex_colors[attribute["name"]] - -.. data:: CD_ORCO - - Vertex attribute is original coordinates. Data type is vector 3 float. - - There can be only 1 attribute of that type per shader. - In blender you can retrieve the attribute data with: - - .. code-block:: python - - mesh.vertices - -.. data:: CD_TANGENT - - Vertex attribute is the tangent vector. Data type is vector 4 float. - - There can be only 1 attribute of that type per shader. - There is currently no way to retrieve this attribute data via the RNA API but a standalone - C function to compute the tangent layer from the other layers can be obtained from - blender.org. - - -Functions -========= - -.. _export_shader: - -.. function:: export_shader(scene,material) - - Extracts the GLSL shader producing the visual effect of material in scene for the purpose of - reusing the shader in an external engine. - - This function is meant to be used in material exporter - so that the GLSL shader can be exported entirely. - - The return value is a dictionary containing the - shader source code and all associated data. - - :arg scene: the scene in which the material in rendered. - :type scene: :class:`bpy.types.Scene` - :arg material: the material that you want to export the GLSL shader - :type material: :class:`bpy.types.Material` - :return: the shader source code and all associated data in a dictionary - :rtype: dictionary - - The dictionary contains the following elements: - - - ``["fragment"]``: string - fragment shader source code. - - - ``["vertex"]``: string - vertex shader source code. - - - ``["uniforms"]``: sequence - list of uniforms used in fragment shader, can be empty list. Each element of the - sequence is a dictionary with the following elements: - - - ``["varname"]``: string - name of the uniform in the fragment shader. Always of the form 'unf<number>'. - - - ``["datatype"]``: integer - data type of the uniform variable. Can be one of the following: - - .. hlist:: - :columns: 2 - - - :data:`gpu.GPU_DATA_1I` : use ``glUniform1i`` - - :data:`gpu.GPU_DATA_1F` : use ``glUniform1fv`` - - :data:`gpu.GPU_DATA_2F` : use ``glUniform2fv`` - - :data:`gpu.GPU_DATA_3F` : use ``glUniform3fv`` - - :data:`gpu.GPU_DATA_4F` : use ``glUniform4fv`` - - :data:`gpu.GPU_DATA_9F` : use ``glUniformMatrix3fv`` - - :data:`gpu.GPU_DATA_16F` : use ``glUniformMatrix4fv`` - - - ``["type"]``: integer - type of uniform, determines the origin and method of calculation. See uniform-type_. - Depending on the type, more elements will be be present. - - - ``["lamp"]``: :class:`bpy.types.Object` - Reference to the lamp object from which the uniforms value are extracted. - Set for the following uniforms types: - - .. hlist:: - :columns: 2 - - - :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC` - - :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO` - - :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT` - - :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT` - - :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY` - - :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL` - - :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW` - - Notes: - - - The uniforms - :data:`gpu.GPU_DYNAMIC_LAMP_DYNVEC`, - :data:`gpu.GPU_DYNAMIC_LAMP_DYNCO`, - :data:`gpu.GPU_DYNAMIC_LAMP_DYNIMAT` and - :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT` - refer to the lamp object position and orientation, - both of can be derived from the object world matrix: - - .. code-block:: python - - obmat = uniform["lamp"].matrix_world - - where obmat is the mat4_lamp_to_world_ matrix of the lamp as a 2 dimensional array, - the lamp world location location is in ``obmat[3]``. - - - The uniform types - :data:`gpu.GPU_DYNAMIC_LAMP_DYNENERGY` and - :data:`gpu.GPU_DYNAMIC_LAMP_DYNCOL` - refer to the lamp data bloc that you get from: - - .. code-block:: python - - la = uniform["lamp"].data - - from which you get ``lamp.energy`` and ``lamp.color`` - - - Lamp duplication is not supported: if you have duplicated lamps in your scene - (i.e. lamp that are instantiated by dupligroup, etc), this element will only - give you a reference to the orignal lamp and you will not know which instance - of the lamp it is refering too. You can still handle that case in the exporter - by distributing the uniforms amongst the duplicated lamps. - - - ``["image"]``: :class:`bpy.types.Image` - Reference to the image databloc. - Set for uniform type - :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE`. - You can get the image data from: - - .. code-block:: python - - # full path to image file - uniform["image"].filepath - # image size as a 2-dimensional array of int - uniform["image"].size - - - ``["texnumber"]``: integer - Channel number to which the texture is bound when drawing the object. - Set for uniform types - :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`, - :data:`gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE` and - :data:`gpu.GPU_DYNAMIC_SAMPLER_2DSHADOW`. - - This is provided for information only: when reusing the shader outside blencer, - you are free to assign the textures to the channel of your choice and to pass - that number channel to the GPU in the uniform. - - - ``["texpixels"]``: byte array - texture data for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`. - Although the corresponding uniform is a 2D sampler, - the texture is always a 1D texture of n x 1 pixel. - The texture size n is provided in ["texsize"] element. - These texture are only used for computer generated texture (colorband, etc). - The texture data is provided so that you can make a real image out of it in the exporter. - - - ``["texsize"]``: integer - horizontal size of texture for uniform type :data:`gpu.GPU_DYNAMIC_SAMPLER_2DBUFFER`. - The texture data is in ["texpixels"]. - - - ``["attributes"]``: sequence - list of attributes used in vertex shader, can be empty. Blender doesn't use - standard attributes except for vertex position and normal. All other vertex - attributes must be passed using the generic ``glVertexAttrib`` functions. - The attribute data can be found in the derived mesh custom data using RNA. - Each element of the sequence is a dictionary containing the following elements: - - - ``["varname"]``: string - name of the uniform in the vertex shader. Always of the form 'att<number>'. - - - ``["datatype"]``: integer - data type of vertex attribute, can be one of the following: - - - :data:`gpu.GPU_DATA_2F`: use ``glVertexAttrib2fv`` - - :data:`gpu.GPU_DATA_3F`: use ``glVertexAttrib3fv`` - - :data:`gpu.GPU_DATA_4F`: use ``glVertexAttrib4fv`` - - :data:`gpu.GPU_DATA_4UB`: use ``glVertexAttrib4ubv`` - - - ``["number"]``: integer - Generic attribute number. This is provided for information only. - Blender doesn't use ``glBindAttribLocation`` to place generic attributes at specific location, - it lets the shader compiler place the attributes automatically and query the - placement with ``glGetAttribLocation``. - The result of this placement is returned in this element. - - When using this shader in a render engine, you should either use - ``glBindAttribLocation`` to force the attribute at this location or use - ``glGetAttribLocation`` to get the placement chosen by the compiler of your GPU. - - - ``["type"]``: integer - type of the mesh custom data from which the vertex attribute is loaded. - See attribute-type_. - - - ``["name"]``: string or integer - custom data layer name, used for attribute type :data:`gpu.CD_MTFACE` and :data:`gpu.CD_MCOL`. - - Example: - - .. code-block:: python - - import gpu - # get GLSL shader of material Mat.001 in scene Scene.001 - scene = bpy.data.scenes["Scene.001"] - material = bpy.data.materials["Mat.001"] - shader = gpu.export_shader(scene,material) - # scan the uniform list and find the images used in the shader - for uniform in shader["uniforms"]: - if uniform["type"] == gpu.GPU_DYNAMIC_SAMPLER_2DIMAGE: - print("uniform {0} is using image {1}".format(uniform["varname"], uniform["image"].filepath)) - # scan the attribute list and find the UV Map used in the shader - for attribute in shader["attributes"]: - if attribute["type"] == gpu.CD_MTFACE: - print("attribute {0} is using UV Map {1}".format(attribute["varname"], attribute["name"])) - - -Notes -===== - -.. _mat4_lamp_to_perspective: - -#. Calculation of the ``mat4_lamp_to_perspective`` matrix for a spot lamp. - - The following pseudo code shows how the ``mat4_lamp_to_perspective`` matrix is computed - in blender for uniforms of :data:`gpu.GPU_DYNAMIC_LAMP_DYNPERSMAT` type: - - .. code-block:: python - - # Get the lamp datablock with: - lamp = bpy.data.objects[uniform["lamp"]].data - - # Compute the projection matrix: - # You will need these lamp attributes: - # lamp.clipsta : near clip plane in world unit - # lamp.clipend : far clip plane in world unit - # lamp.spotsize : angle in degree of the spot light - - # The size of the projection plane is computed with the usual formula: - wsize = lamp.clista * tan(lamp.spotsize/2) - - # And the projection matrix: - mat4_lamp_to_perspective = glFrustum(-wsize, wsize, -wsize, wsize, lamp.clista, lamp.clipend) - -#. Creation of the shadow map for a spot lamp. - - The shadow map is the depth buffer of a render performed by placing the camera at the - spot light position. The size of the shadow map is given by the attribute ``lamp.bufsize``: - shadow map size in pixel, same size in both dimensions. diff --git a/doc/python_api/rst/info_api_reference.rst b/doc/python_api/rst/info_api_reference.rst index ab690a8ee06..5d5d38bf18b 100644 --- a/doc/python_api/rst/info_api_reference.rst +++ b/doc/python_api/rst/info_api_reference.rst @@ -15,7 +15,7 @@ Reference API Scope The reference API covers :mod:`bpy.types`, which stores types accessed via :mod:`bpy.context` - *The user context* or :mod:`bpy.data` - *Blend file data*. -Other modules such as :mod:`bge`, :mod:`bmesh` and :mod:`aud` are not using Blenders data API +Other modules such as :mod:`bmesh` and :mod:`aud` are not using Blenders data API so this document doesn't apply to those modules. diff --git a/doc/python_api/rst/info_quickstart.rst b/doc/python_api/rst/info_quickstart.rst index 7a899e040a6..bbedb3f4fd4 100644 --- a/doc/python_api/rst/info_quickstart.rst +++ b/doc/python_api/rst/info_quickstart.rst @@ -196,9 +196,9 @@ Example: # dictionaries can be assigned as long as they only use basic types. group = bpy.data.groups.new("MyTestGroup") - group["GameSettings"] = {"foo": 10, "bar": "spam", "baz": {}} + group["MySettings"] = {"foo": 10, "bar": "spam", "baz": {}} - del group["GameSettings"] + del group["MySettings"] Note that these properties can only be assigned basic Python types. diff --git a/doc/python_api/rst/info_tips_and_tricks.rst b/doc/python_api/rst/info_tips_and_tricks.rst index 57f3246269b..332716087a7 100644 --- a/doc/python_api/rst/info_tips_and_tricks.rst +++ b/doc/python_api/rst/info_tips_and_tricks.rst @@ -231,7 +231,7 @@ There are 2 ways around this: you could also copy the entire Python installation into Blenders sub-directory, replacing the one Blender comes with. This works as long as the Python versions match and the paths are created in the same relative locations. - Doing this has the advantage that you can redistribute this bundle to others with Blender and/or the game player, + Doing this has the advantage that you can redistribute this bundle to others with Blender including any extensions you rely on. @@ -280,11 +280,6 @@ The IPython prompt has auto-complete and some useful features that the standard Admittedly this highlights the lack of any Python debugging support built into Blender, but its still handy to know. -.. note:: - - This works in the game engine as well, it can be handy to inspect the state of a running game. - - Advanced ======== diff --git a/doc/python_api/rst_from_bmesh_opdefines.py b/doc/python_api/rst_from_bmesh_opdefines.py index 04cc2feee3e..c4e97d1f38b 100644 --- a/doc/python_api/rst_from_bmesh_opdefines.py +++ b/doc/python_api/rst_from_bmesh_opdefines.py @@ -31,6 +31,7 @@ # - campbell import os +import re CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(CURRENT_DIR, "..", "..")))) @@ -75,7 +76,10 @@ def main(): for l in fsrc: l = l[:-1] # weak but ok - if ("BMOpDefine" in l and l.split()[1] == "BMOpDefine") and "bmo_opdefines[]" not in l: + if ( + (("BMOpDefine" in l and l.split()[1] == "BMOpDefine") and "bmo_opdefines[]" not in l) or + ("static BMO_FlagSet " in l) + ): is_block = True block_ctx = [] blocks.append((comment_ctx, block_ctx)) @@ -92,9 +96,12 @@ def main(): if cpp_comment != -1: l = l[:cpp_comment] + # remove sentinel from enums + l = l.replace("{0, NULL}", "") + block_ctx.append(l) - if l.strip() == "};": + if l.strip().endswith("};"): is_block = False comment_ctx = None @@ -136,6 +143,9 @@ def main(): "BMO_OP_SLOT_SUBTYPE_PTR_MESH", "BMO_OP_SLOT_SUBTYPE_PTR_BMESH", + "BMO_OP_SLOT_SUBTYPE_INT_ENUM", + "BMO_OP_SLOT_SUBTYPE_INT_FLAG", + "BMO_OP_SLOT_SUBTYPE_ELEM_IS_SINGLE", "BM_VERT", @@ -160,6 +170,7 @@ def main(): for comment, b in blocks: # magic, translate into python b[0] = b[0].replace("static BMOpDefine ", "") + is_enum = False for i, l in enumerate(b): l = l.strip() @@ -178,11 +189,35 @@ def main(): # exec func. eg: bmo_rotate_edges_exec, if l.startswith("bmo_") and l.endswith("_exec,"): l = "None," + + # enums + if l.startswith("static BMO_FlagSet "): + is_enum = True + b[i] = l # for l in b: # print(l) + if is_enum: + text = "".join(b) + text = text.replace("static BMO_FlagSet ", "") + text = text.replace("[]", "") + text = text.strip(";") + text = text.replace("(", "[").replace(")", "]") + text = text.replace("\"", "'") + + k, v = text.split("=", 1) + + v = repr(re.findall(r"'([^']*)'", v)) + + k = k.strip() + v = v.strip() + + vars_dict[k] = v + + continue + text = "\n".join(b) global_namespace = { "__file__": "generated", @@ -225,6 +260,7 @@ def main(): # -- wash the comment comment_washed = [] + comment = [] if comment is None else comment for i, l in enumerate(comment): assert((l.strip() == "") or (l in {"/*", " *"}) or @@ -246,7 +282,9 @@ def main(): args_wash = [] for i in args_index: arg = args[i] - if len(arg) == 3: + if len(arg) == 4: + name, tp, tp_sub, enums = arg + elif len(arg) == 3: name, tp, tp_sub = arg elif len(arg) == 2: name, tp = arg @@ -282,7 +320,12 @@ def main(): if tp == BMO_OP_SLOT_FLT: tp_str = "float" elif tp == BMO_OP_SLOT_INT: - tp_str = "int" + if tp_sub == BMO_OP_SLOT_SUBTYPE_INT_ENUM: + tp_str = "enum in " + enums + ", default " + enums.split(",", 1)[0].strip("[") + elif tp_sub == BMO_OP_SLOT_SUBTYPE_INT_FLAG: + tp_str = "set of flags from " + enums + ", default {}" + else: + tp_str = "int" elif tp == BMO_OP_SLOT_BOOL: tp_str = "bool" elif tp == BMO_OP_SLOT_MAT: diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py index 0eb2ebefe32..edfa2c4a95b 100644 --- a/doc/python_api/sphinx_doc_gen.py +++ b/doc/python_api/sphinx_doc_gen.py @@ -135,22 +135,6 @@ def handle_args(): help="Path of the API docs (default=<script dir>)", required=False) - parser.add_argument("-T", "--sphinx-theme", - dest="sphinx_theme", - type=str, - default="classic", - help="Sphinx theme (default='classic'), " - "see: http://sphinx-doc.org/theming.html", - required=False) - - parser.add_argument("-N", "--sphinx-named-output", - dest="sphinx_named_output", - default=False, - action='store_true', - help="Add the theme name to the html dir name.\n" - "Example: \"sphinx-out_haiku\" (default=False)", - required=False) - parser.add_argument("-B", "--sphinx-build", dest="sphinx_build", default=False, @@ -231,14 +215,6 @@ else: EXCLUDE_INFO_DOCS = True EXCLUDE_MODULES = [ "aud", - "bge", - "bge.app" - "bge.constraints", - "bge.events", - "bge.logic", - "bge.render", - "bge.texture", - "bge.types", "bgl", "blf", "bmesh", @@ -259,7 +235,9 @@ else: "bpy.utils.previews", "bpy_extras", "gpu", - "gpu.offscreen", + "gpu.types", + "gpu.matrix", + "gpu.select", "idprop.types", "mathutils", "mathutils.bvhtree", @@ -334,13 +312,12 @@ except ImportError: # to avoid having to match Blender's source tree. EXTRA_SOURCE_FILES = ( "../../../release/scripts/templates_py/bmesh_simple.py", + "../../../release/scripts/templates_py/gizmo_operator.py", + "../../../release/scripts/templates_py/gizmo_operator_target.py", + "../../../release/scripts/templates_py/gizmo_simple.py", "../../../release/scripts/templates_py/operator_simple.py", "../../../release/scripts/templates_py/ui_panel_simple.py", "../../../release/scripts/templates_py/ui_previews_custom_icon.py", - "../examples/bge.constraints.py", - "../examples/bge.texture.1.py", - "../examples/bge.texture.2.py", - "../examples/bge.texture.py", "../examples/bmesh.ops.1.py", "../examples/bpy.app.translations.py", "../static/favicon.ico", @@ -374,6 +351,7 @@ INFO_DOCS = ( "Tips and Tricks: Hints to help you while writing scripts for Blender"), ("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"), + ("change_log.rst", "List of changes since last Blender release"), ) # only support for properties atm. @@ -451,15 +429,9 @@ BLENDER_ZIP_FILENAME = "%s.zip" % REFERENCE_NAME # -------------------------------SPHINX----------------------------------------- -if ARGS.sphinx_theme == "blender-org": - SPHINX_THEME_DIR = os.path.join(ARGS.output_dir, ARGS.sphinx_theme) - SPHINX_THEME_SVN_DIR = os.path.join(SCRIPT_DIR, ARGS.sphinx_theme) - SPHINX_IN = os.path.join(ARGS.output_dir, "sphinx-in") SPHINX_IN_TMP = SPHINX_IN + "-tmp" SPHINX_OUT = os.path.join(ARGS.output_dir, "sphinx-out") -if ARGS.sphinx_named_output: - SPHINX_OUT += "_%s" % ARGS.sphinx_theme # html build if ARGS.sphinx_build: @@ -530,22 +502,7 @@ def is_struct_seq(value): def undocumented_message(module_name, type_name, identifier): - return "Undocumented" - - """ - if str(type_name).startswith('<module'): - preloadtitle = '%s.%s' % (module_name, identifier) - else: - preloadtitle = '%s.%s.%s' % (module_name, type_name, identifier) - message = ("Undocumented (`contribute " - "<http://wiki.blender.org/index.php/" - "Dev:2.5/Py/API/Generating_API_Reference/Contribute" - "?action=edit" - "§ion=new" - "&preload=Dev:2.5/Py/API/Generating_API_Reference/Contribute/Howto-message" - "&preloadtitle=%s>`_)\n\n" % preloadtitle) - return message - """ + return "Undocumented `contribute <https://developer.blender.org/T51061>`" def range_str(val): @@ -1027,8 +984,6 @@ context_type_map = { "active_gpencil_brush": ("GPencilSculptBrush", False), "active_gpencil_frame": ("GreasePencilLayer", True), "active_gpencil_layer": ("GPencilLayer", True), - "active_gpencil_palette": ("GPencilPalette", True), - "active_gpencil_palettecolor": ("GPencilPaletteColor", True), "active_node": ("Node", False), "active_object": ("Object", False), "active_operator": ("Operator", False), @@ -1038,6 +993,7 @@ context_type_map = { "brush": ("Brush", False), "camera": ("Camera", False), "cloth": ("ClothModifier", False), + "collection": ("LayerCollection", False), "collision": ("CollisionModifier", False), "curve": ("Curve", False), "dynamic_paint": ("DynamicPaintModifier", False), @@ -1056,8 +1012,9 @@ context_type_map = { "gpencil_data": ("GreasePencel", False), "gpencil_data_owner": ("ID", False), "image_paint_object": ("Object", False), - "lamp": ("Lamp", False), + "light": ("Light", False), "lattice": ("Lattice", False), + "lightprobe": ("LightProbe", False), "line_style": ("FreestyleLineStyle", False), "material": ("Material", False), "material_slot": ("MaterialSlot", False), @@ -1100,6 +1057,7 @@ context_type_map = { "visible_pose_bones": ("PoseBone", True), "weight_paint_object": ("Object", False), "world": ("World", False), + "view_layer": ("ViewLayer", False), } @@ -1580,7 +1538,7 @@ def pyrna2sphinx(basepath): # operators def write_ops(): - API_BASEURL = "https://developer.blender.org/diffusion/B/browse/master/release/scripts " + API_BASEURL = "https://developer.blender.org/diffusion/B/browse/master/release/scripts" API_BASEURL_ADDON = "https://developer.blender.org/diffusion/BA" API_BASEURL_ADDON_CONTRIB = "https://developer.blender.org/diffusion/BAC" @@ -1649,22 +1607,17 @@ def write_sphinx_conf_py(basepath): fw("extensions = ['sphinx.ext.intersphinx']\n\n") fw("intersphinx_mapping = {'blender_manual': ('https://docs.blender.org/manual/en/dev/', None)}\n\n") fw("project = 'Blender'\n") - # fw("master_doc = 'index'\n") + fw("master_doc = 'index'\n") fw("copyright = u'Blender Foundation'\n") - fw("version = '%s - API'\n" % BLENDER_VERSION_DOTS) - fw("release = '%s - API'\n" % BLENDER_VERSION_DOTS) + fw("version = '%s'\n" % BLENDER_VERSION_DOTS) + fw("release = '%s'\n" % BLENDER_VERSION_DOTS) # Quiet file not in table-of-contents warnings. fw("exclude_patterns = [\n") fw(" 'include__bmesh.rst',\n") fw("]\n\n") - if ARGS.sphinx_theme != 'default': - fw("html_theme = '%s'\n" % ARGS.sphinx_theme) - - if ARGS.sphinx_theme == "blender-org": - fw("html_theme_path = ['../']\n") - + fw("html_theme = 'sphinx_rtd_theme'\n") # not helpful since the source is generated, adds to upload size. fw("html_copy_source = False\n") fw("html_show_sphinx = False\n") @@ -1711,7 +1664,7 @@ def write_rst_contents(basepath): ''' Write the rst file of the main page, needed for sphinx (index.html) ''' - filepath = os.path.join(basepath, "contents.rst") + filepath = os.path.join(basepath, "index.rst") file = open(filepath, "w", encoding="utf-8") fw = file.write @@ -1724,21 +1677,19 @@ def write_rst_contents(basepath): # fw("`A PDF version of this document is also available <%s>`_\n" % BLENDER_PDF_FILENAME) fw("This site can be downloaded for offline use `Download the full Documentation (zipped HTML files) <%s>`_\n" % BLENDER_ZIP_FILENAME) - fw("\n") if not EXCLUDE_INFO_DOCS: - fw(title_string("Blender/Python Documentation", "=", double=True)) - fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") + fw(" :maxdepth: 1\n") + fw(" :caption: Blender/Python Documentation\n\n") for info, info_desc in INFO_DOCS: - fw(" %s <%s>\n\n" % (info_desc, info)) + fw(" %s <%s>\n" % (info_desc, info)) fw("\n") - fw(title_string("Application Modules", "=", double=True)) fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") + fw(" :maxdepth: 1\n") + fw(" :caption: Application Modules\n\n") app_modules = ( "bpy.context", # note: not actually a module @@ -1758,11 +1709,12 @@ def write_rst_contents(basepath): for mod in app_modules: if mod not in EXCLUDE_MODULES: - fw(" %s\n\n" % mod) + fw(" %s\n" % mod) + fw("\n") - fw(title_string("Standalone Modules", "=", double=True)) fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") + fw(" :maxdepth: 1\n") + fw(" :caption: Standalone Modules\n\n") standalone_modules = ( # submodules are added in parent page @@ -1772,47 +1724,13 @@ def write_rst_contents(basepath): for mod in standalone_modules: if mod not in EXCLUDE_MODULES: - fw(" %s\n\n" % mod) + fw(" %s\n" % mod) + fw("\n") # special case, this 'bmesh.ops.rst' is extracted from C source if "bmesh.ops" not in EXCLUDE_MODULES: execfile(os.path.join(SCRIPT_DIR, "rst_from_bmesh_opdefines.py")) - # game engine - if "bge" not in EXCLUDE_MODULES: - fw(title_string("Game Engine Modules", "=", double=True)) - fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") - fw(" bge.types.rst\n\n") - fw(" bge.logic.rst\n\n") - fw(" bge.render.rst\n\n") - fw(" bge.texture.rst\n\n") - fw(" bge.events.rst\n\n") - fw(" bge.constraints.rst\n\n") - fw(" bge.app.rst\n\n") - - # rna generated change log - fw(title_string("API Info", "=", double=True)) - fw(".. toctree::\n") - fw(" :maxdepth: 1\n\n") - fw(" change_log.rst\n\n") - - fw("\n") - fw("\n") - fw(".. note:: The Blender Python API has areas which are still in development.\n") - fw(" \n") - fw(" The following areas are subject to change.\n") - fw(" * operator behavior, names and arguments\n") - fw(" * mesh creation and editing functions\n") - fw(" \n") - fw(" These parts of the API are relatively stable and are unlikely to change significantly\n") - fw(" * data API, access to attributes of Blender data such as mesh verts, material color,\n") - fw(" timeline frames and scene objects\n") - fw(" * user interface functions for defining buttons, creation of menus, headers, panels\n") - fw(" * render engine integration\n") - fw(" * modules: bgl, mathutils & game engine.\n") - fw("\n") - file.close() @@ -1906,7 +1824,10 @@ def write_rst_importable_modules(basepath): # C_modules "aud": "Audio System", "blf": "Font Drawing", - "gpu.offscreen": "GPU Off-Screen Buffer", + "gpu": "GPU Shader Module", + "gpu.types": "GPU Types", + "gpu.matrix": "GPU Matrix", + "gpu.select": "GPU Select", "bmesh": "BMesh Module", "bmesh.types": "BMesh Types", "bmesh.utils": "BMesh Utilities", @@ -1914,6 +1835,8 @@ def write_rst_importable_modules(basepath): "bpy.app": "Application Data", "bpy.app.handlers": "Application Handlers", "bpy.app.translations": "Application Translations", + # TODO(campbell) + # "bpy.app.icons": "Application Icons", "bpy.props": "Property Definitions", "idprop.types": "ID Property Access", "mathutils": "Math Types & Utilities", @@ -1946,36 +1869,18 @@ def copy_handwritten_rsts(basepath): # TODO put this docs in Blender's code and use import as per modules above handwritten_modules = [ - "bge.logic", - "bge.render", - "bge.texture", - "bge.events", - "bge.constraints", - "bge.app", "bgl", # "Blender OpenGl wrapper" - "gpu", # "GPU Shader Module" - "bmesh.ops", # generated by rst_from_bmesh_opdefines.py # includes... "include__bmesh", ] + for mod_name in handwritten_modules: if mod_name not in EXCLUDE_MODULES: # copy2 keeps time/date stamps shutil.copy2(os.path.join(RST_DIR, "%s.rst" % mod_name), basepath) - if "bge.types" not in EXCLUDE_MODULES: - shutil.copy2(os.path.join(RST_DIR, "bge.types.rst"), basepath) - - bge_types_dir = os.path.join(RST_DIR, "bge_types") - - for i in os.listdir(bge_types_dir): - if i.startswith("."): - # Avoid things like .svn dir... - continue - shutil.copy2(os.path.join(bge_types_dir, i), basepath) - # changelog shutil.copy2(os.path.join(RST_DIR, "change_log.rst"), basepath) @@ -2132,15 +2037,6 @@ def main(): ignore=shutil.ignore_patterns(*(".svn",)), copy_function=shutil.copy) - # eventually, copy the theme dir - if ARGS.sphinx_theme == "blender-org": - if os.path.exists(SPHINX_THEME_DIR): - shutil.rmtree(SPHINX_THEME_DIR, True) - shutil.copytree(SPHINX_THEME_SVN_DIR, - SPHINX_THEME_DIR, - ignore=shutil.ignore_patterns(*(".svn",)), - copy_function=shutil.copy) - # dump the api in rst files if os.path.exists(SPHINX_IN_TMP): shutil.rmtree(SPHINX_IN_TMP, True) @@ -2203,8 +2099,6 @@ def main(): shutil.copytree(SPHINX_OUT, REFERENCE_PATH, ignore=shutil.ignore_patterns(*ignores)) - shutil.copy(os.path.join(REFERENCE_PATH, "contents.html"), - os.path.join(REFERENCE_PATH, "index.html")) # zip REFERENCE_PATH basename = os.path.join(ARGS.output_dir, REFERENCE_NAME) diff --git a/doc/python_api/sphinx_doc_gen.sh b/doc/python_api/sphinx_doc_gen.sh index eba9e1ce5fa..4b7569f7d54 100755 --- a/doc/python_api/sphinx_doc_gen.sh +++ b/doc/python_api/sphinx_doc_gen.sh @@ -125,7 +125,6 @@ fi if $DO_UPLOAD ; then - cp $SPHINX_WORKDIR/sphinx-out/contents.html $SPHINX_WORKDIR/sphinx-out/index.html ssh $SSH_USER@blender.org 'rm -rf '$SSH_UPLOAD_FULL'/*' rsync --progress -ave "ssh -p 22" $SPHINX_WORKDIR/sphinx-out/* $SSH_HOST:$SSH_UPLOAD_FULL/ @@ -164,5 +163,5 @@ fi echo "" echo "Finished! view the docs from: " -if $DO_OUT_HTML ; then echo " html:" $SPHINX_WORKDIR/sphinx-out/contents.html ; fi +if $DO_OUT_HTML ; then echo " html:" $SPHINX_WORKDIR/sphinx-out/index.html ; fi if $DO_OUT_PDF ; then echo " pdf:" $SPHINX_WORKDIR/sphinx-out/blender_python_reference_$BLENDER_VERSION.pdf ; fi diff --git a/doc/python_api/sphinx_doc_update.py b/doc/python_api/sphinx_doc_update.py index af44137aca4..702151317b3 100755 --- a/doc/python_api/sphinx_doc_update.py +++ b/doc/python_api/sphinx_doc_update.py @@ -163,7 +163,6 @@ def main(): os.rename(zip_path, os.path.join(api_dir, "%s.zip" % zip_name)) # VII) Create symlinks and html redirects. - os.symlink("./contents.html", os.path.join(api_dir, "index.html")) if is_release: symlink = os.path.join(args.mirror_dir, "current") os.remove(symlink) |