Browse Source

Merge branch 'master' into 3.2

Rémi Verschelde 5 years ago
parent
commit
707237278e

+ 5 - 0
.travis.yml

@@ -1,3 +1,4 @@
+os: linux
 dist: bionic
 language: python
 
@@ -22,6 +23,10 @@ matrix:
 script:
   - bash ./format.sh
 
+  # Check for possible typos
+  - pip install codespell
+  - codespell -I codespell-ignore.txt {about,community,development,getting_started,tutorials}/**/*.rst
+
   - pip install -r requirements.txt
   # TODO: Add `-W` to turn warnings into errors.
   # This can only be done once all warnings have been fixed.

+ 12 - 14
_templates/layout.html

@@ -1,14 +1,12 @@
-{% extends "!layout.html" %}
-{% block linktags %}
-    <link rel="alternate" hreflang="en" href="https://docs.godotengine.org/en/" />
-    <link rel="alternate" hreflang="de" href="https://docs.godotengine.org/de/" />
-    <link rel="alternate" hreflang="es" href="https://docs.godotengine.org/es/" />
-    <link rel="alternate" hreflang="fr" href="https://docs.godotengine.org/fr/" />
-    <link rel="alternate" hreflang="ko" href="https://docs.godotengine.org/ko/" />
-    <link rel="alternate" hreflang="pl" href="https://docs.godotengine.org/pl/" />
-    <link rel="alternate" hreflang="pt-br" href="https://docs.godotengine.org/pt-br/" />
-    <link rel="alternate" hreflang="uk" href="https://docs.godotengine.org/uk/" />
-    <link rel="alternate" hreflang="zh-cn" href="https://docs.godotengine.org/zh-cn/" />
-    <link rel="alternate" hreflang="x-default" href="https://docs.godotengine.org/" />
-    {{ super() }}
-{% endblock %}
+{% extends "!layout.html" -%}
+{% block linktags -%}
+  {% if godot_inject_language_links -%}
+  {% for alternate_lang in godot_docs_supported_languages -%}
+  <link rel="alternate" hreflang="{{ alternate_lang }}" href="{{ godot_docs_basepath }}{{ alternate_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
+  {% endfor -%}
+  <link rel="alternate" hreflang="x-default" href="{{ godot_docs_basepath }}{{ godot_default_lang }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
+  
+  <link rel="canonical" href="{{ godot_docs_basepath }}{{ lang_attr }}/{{ godot_canonical_version }}/{{ pagename }}{{ godot_docs_suffix }}" />
+  {% endif -%}
+  {{ super() }}
+{% endblock -%}

+ 6 - 0
codespell-ignore.txt

@@ -0,0 +1,6 @@
+doubleclick
+dof
+lod
+que
+raison
+uint

+ 12 - 0
conf.py

@@ -49,7 +49,13 @@ if env_tags is not None:
         tags.add(tag.strip())  # noqa: F821
 
 # Language / i18n
+supported_languages = ['en', 'de', 'es', 'fr', 'fi', 'it', 'ja', 'ko', 'pl', 'pt-br', 'ru', 'uk', 'zh-cn']
 language = os.getenv("READTHEDOCS_LANGUAGE", "en")
+if not language in supported_languages:
+    print("Unknown language: " + language)
+    print("Supported languages: " + ", ".join(supported_languages))
+    print("This is an error or needs to be added to supported_languages in conf.py")
+
 is_i18n = tags.has("i18n")  # noqa: F821
 
 exclude_patterns = ["_build"]
@@ -94,6 +100,12 @@ html_context = {
     "github_repo": "godot-docs",  # Repo name
     "github_version": "master",  # Version
     "conf_py_path": "/",  # Path in the checkout to the docs root
+    "godot_inject_language_links": True,
+    "godot_docs_supported_languages": supported_languages,
+    "godot_docs_basepath": "https://docs.godotengine.org/",
+    "godot_docs_suffix": ".html",
+    "godot_default_lang": "en",
+    "godot_canonical_version": "stable",
 }
 
 html_logo = "img/docs_logo.png"

+ 8 - 3
development/compiling/compiling_for_osx.rst

@@ -39,9 +39,14 @@ If all goes well, the resulting binary executable will be placed in the
 runs without any dependencies. Executing it will bring up the project
 manager.
 
-To create an .app like in the official builds, you need to use the template
-located in ``misc/dist/osx_tools.app``. Typically, for an optimized editor
-binary built with ``scons p=osx target=release_debug``::
+.. note:: If you want to use separate editor settings for your own Godot builds
+          and official releases, you can enable
+          :ref:`doc_data_paths_self_contained_mode` by creating a file called
+          ``._sc_`` or ``_sc_`` in the ``bin/`` folder.
+
+To create an ``.app`` bundle like in the official builds, you need to use the
+template located in ``misc/dist/osx_tools.app``. Typically, for an optimized
+editor binary built with ``scons p=osx target=release_debug``::
 
     user@host:~/godot$ cp -r misc/dist/osx_tools.app ./Godot.app
     user@host:~/godot$ mkdir -p Godot.app/Contents/MacOS

+ 13 - 9
development/compiling/compiling_for_windows.rst

@@ -34,8 +34,8 @@ For compiling under Windows, the following is required:
                   mingw-w64-i686-python3-pip mingw-w64-i686-gcc \
                   mingw-w64-i686-yasm make
               
-              For each MSYS2 MinGW subsystem, you should then run
-              `pip install scons` in its shell.
+          For each MSYS2 MinGW subsystem, you should then run
+          `pip install scons` in its shell.
 
 .. seealso:: For a general overview of SCons usage for Godot, see
              :ref:`doc_introduction_to_the_buildsystem`.
@@ -109,19 +109,18 @@ You can specify a number of CPU threads to use to speed up the build::
 
     C:\godot> scons -j6 platform=windows
 
-In general, it is OK to have at least as many threads compiling Godot as
-you have cores in your CPU, if not one or two more. Feel free to add the
--j option to any SCons command you see below.
+In general, it is OK to have at least as many threads compiling Godot as you
+have cores in your CPU, if not one or two more. Feel free to add the ``-j``
+option to any SCons command you see below.
 
 .. note:: When compiling with multiple CPU threads, SCons may warn about
           pywin32 being missing. You can safely ignore this warning.
 
 If all goes well, the resulting binary executable will be placed in
 ``C:\godot\bin\`` with the name ``godot.windows.tools.32.exe`` or
-``godot.windows.tools.64.exe``.
-
-.. note:: By default, SCons will build a binary matching your CPU architecture,
-          but this can be overridden using ``bits=64`` or ``bits=32``.
+``godot.windows.tools.64.exe``. By default, SCons will build a binary matching
+your CPU architecture, but this can be overridden using ``bits=64`` or
+``bits=32``.
 
 This executable file contains the whole engine and runs without any
 dependencies. Running it will bring up the Project Manager.
@@ -135,6 +134,11 @@ dependencies. Running it will bring up the Project Manager.
           As link-time optimization is a memory-intensive process,
           this will require about 3 GB of available RAM while compiling.
 
+.. note:: If you want to use separate editor settings for your own Godot builds
+          and official releases, you can enable
+          :ref:`doc_data_paths_self_contained_mode` by creating a file called
+          ``._sc_`` or ``_sc_`` in the ``bin/`` folder.
+
 Development in Visual Studio or other IDEs
 ------------------------------------------
 

+ 5 - 0
development/compiling/compiling_for_x11.rst

@@ -123,6 +123,11 @@ manager.
           As link-time optimization is a memory-intensive process,
           this will require about 3 GB of available RAM while compiling.
 
+.. note:: If you want to use separate editor settings for your own Godot builds
+          and official releases, you can enable
+          :ref:`doc_data_paths_self_contained_mode` by creating a file called
+          ``._sc_`` or ``_sc_`` in the ``bin/`` folder.
+
 Building export templates
 -------------------------
 

+ 4 - 3
development/cpp/object_class.rst

@@ -182,9 +182,10 @@ call).
 
 .. code-block:: cpp
 
-    void _get_property_info(List<PropertyInfo> *r_props); // return list of properties
-    bool _get(const StringName &p_property, Variant &r_value) const; // return true if property was found
-    bool _set(const StringName &p_property, const Variant &p_value); // return true if property was found
+    protected:
+         void _get_property_list(List<PropertyInfo> *r_props) const;      // return list of properties
+         bool _get(const StringName &p_property, Variant &r_value) const; // return true if property was found
+         bool _set(const StringName &p_property, const Variant &p_value); // return true if property was found
 
 This is also a little less efficient since ``p_property`` must be
 compared against the desired names in serial order.

+ 2 - 2
getting_started/scripting/gdscript/gdscript_exports.rst

@@ -188,5 +188,5 @@ Setting exported variables from a tool script
 When changing an exported variable's value from a script in
 :ref:`doc_gdscript_tool_mode`, the value in the inspector won't be updated
 automatically. To update it, call
-:ref:`class_Object_method_property_list_changed_notify` after setting the
-exported variable's value.
+:ref:`property_list_changed_notify() <class_Object_method_property_list_changed_notify>`
+after setting the exported variable's value.

+ 0 - 4
robots.txt

@@ -1,7 +1,3 @@
 user-agent: *
-disallow: /*/3.2
-disallow: /*/3.1
-disallow: /*/3.0
-disallow: /*/2.1
 
 sitemap: https://docs.godotengine.org/sitemap.xml

+ 48 - 0
tutorials/3d/csg_tools.rst

@@ -11,6 +11,16 @@ Level prototyping is one of the main uses of CSG in Godot. This technique allows
 users to create simple versions of most common shapes by combining primitives.
 Interior environments can be created by using inverted primitives.
 
+.. note:: The CSG nodes in Godot are mainly intended for prototyping. There is
+          no built-in support for UV mapping or editing 3D polygons (though
+          extruded 2D polygons can be used with the CSGPolygon node).
+
+          If you're looking for an easy to use level design tool for a project,
+          you may want to use `Qodot <https://github.com/Shfty/qodot-plugin>`__
+          instead. It lets you design levels using
+          `TrenchBroom <https://kristianduske.com/trenchbroom/>`__ and import
+          them in Godot.
+
 .. image:: img/csg.gif
 
 Introduction to CSG nodes
@@ -235,3 +245,41 @@ this:
 You've successfully prototyped a room level with the CSG tools in Godot.
 CSG tools can be used for designing all kinds of levels, such as a maze
 or a city; explore its limitations when designing your game.
+
+Using prototype textures
+------------------------
+
+Godot's :ref:`doc_spatial_material` supports *triplanar mapping*, which can be
+used to automatically apply a texture to arbitrary objects without distortion.
+This is handy when using CSG as Godot doesn't support editing UV maps on CSG
+nodes yet. Triplanar mapping is relatively slow, which usually restricts its
+usage to organic surfaces like terrain. Still, when prototyping, it can be used
+to quickly apply textures to CSG-based levels.
+
+.. note:: If you need some textures for prototyping, Kenney made a
+          `set of CC0-licensed prototype textures <https://kenney.nl/assets/prototype-textures>`__.
+
+There are two ways to apply a material to a CSG node:
+
+- Applying it to a CSGCombiner node as a material override
+  (**Geometry > Material Override** in the Inspector). This will affect its
+  children automatically, but will make it impossible to change the material in
+  individual children.
+- Applying a material to individual nodes (**Material** in the Inspector). This
+  way, each CSG node can have its own appearance. Subtractive CSG nodes will
+  apply their material to the nodes they're "digging" into.
+
+To apply triplanar mapping to a CSG node, select it, go to the Inspector, click
+the **[empty]** text next to **Material Override** (or **Material** for
+individual CSG nodes). Choose **New SpatialMaterial**. Click the newly created
+material's icon to edit it. Unfold the **Albedo** section and load a texture
+into the **Texture** property. Now, unfold the **Uv1** section and check
+**Triplanar**. You can change the texture offset and scale on each axis by
+playing with the **Scale** and **Offset** properties just above. Higher values
+in the **Scale** property will cause the texture to repeat more often.
+
+.. tip:: You can copy a SpatialMaterial to reuse it across CSG nodes. To do so,
+         click the dropdown arrow next to a material property in the Inspector
+         and choose **Copy**. To paste it, select the node you'd like to apply
+         the material onto, click the dropdown arrow next to its material
+         property then choose **Paste**.

+ 2 - 2
tutorials/3d/fps_tutorial/part_two.rst

@@ -694,9 +694,9 @@ If the currently loaded/open scene is ``Testing_Area.tscn``, we'd be adding our
 .. warning:: As mentioned later below in the section on adding sounds, this method makes an assumption. This will be explained later
              in the section on adding sounds in :ref:`doc_fps_tutorial_part_three`
 
-Next we set the global transform of the clone to the ``Pistol_Aim_Point``'s global transform. The reason we do this is so the bullet is spawned at the end of the pistol.
+Next we set the global transform of the clone to the ``Pistol_Point``'s global transform. The reason we do this is so the bullet is spawned at the end of the pistol.
 
-You can see that ``Pistol_Aim_Point`` is positioned right at the end of the pistol by clicking the :ref:`AnimationPlayer <class_AnimationPlayer>` and
+You can see that ``Pistol_Point`` is positioned right at the end of the pistol by clicking the :ref:`AnimationPlayer <class_AnimationPlayer>` and
 scrolling through ``Pistol_fire``. You'll find the position is more or less at the end of the pistol when it fires.
 
 Next we scale it up by a factor of ``4`` because the bullet scene is a little too small by default.

+ 2 - 0
tutorials/io/data_paths.rst

@@ -79,6 +79,8 @@ the specification to change the editor (and project) data paths.
           the editor data paths will be located in subfolders in
           ``~/.var/app/org.godotengine.Godot/``.
 
+.. _doc_data_paths_self_contained_mode:
+
 Self-contained mode
 ~~~~~~~~~~~~~~~~~~~
 

+ 4 - 4
tutorials/viewports/using_viewport_as_texture.rst

@@ -17,7 +17,7 @@ of making a procedural planet like the one below:
 This tutorial assumes you are familiar with how to set up a basic scene including:
 a :ref:`Camera <class_Camera>`, a :ref:`light source <class_OmniLight>`, a
 :ref:`Mesh Instance <class_MeshInstance>` with a :ref:`Primitive Mesh <class_PrimitiveMesh>`,
-and applying a :ref:`Spatial Material <class_SpatialMaterial>` to the mesh. The focus will be on using
+and applying a :ref:`SpatialMaterial <class_SpatialMaterial>` to the mesh. The focus will be on using
 the :ref:`Viewport <class_Viewport>` to dynamically create textures that can be applied to the mesh.
 
 In this tutorial, we'll cover the following topics:
@@ -77,13 +77,13 @@ Applying the texture
 
 MeshInstance > GeometryInstance > Geometry > Material Override > ``New SpatialMaterial``:
 
-Now we go into the :ref:`Mesh Instance <class_MeshInstance>` and add a :ref:`Spatial Material <class_SpatialMaterial>`
+Now we go into the :ref:`Mesh Instance <class_MeshInstance>` and add a :ref:`SpatialMaterial <class_SpatialMaterial>`
 to it. No need for a special :ref:`Shader Material <class_ShaderMaterial>` (although that would be a good idea
 for more advanced effects, like the atmosphere in the example above).
 
 MeshInstance > GeometryInstance > Geometry > Material Override > ``click`` / ``Edit``:
 
-Open the newly created :ref:`Spatial Material <class_SpatialMaterial>` and scroll down to the "Albedo" section
+Open the newly created :ref:`SpatialMaterial <class_SpatialMaterial>` and scroll down to the "Albedo" section
 and click beside the "Texture" property to add an Albedo Texture. Here we will apply the texture we made.
 Choose "New ViewportTexture"
 
@@ -119,7 +119,7 @@ the sphere in a nice way? One solution is to use a function that repeats on the
 
 Not too bad. If you look around, you can see that the seam has now disappeared, but in its place, we
 have pinching at the poles. This pinching is due to the way Godot maps textures to spheres in its
-:ref:`Spatial Material <class_SpatialMaterial>`. It uses a projection technique called equirectangular
+:ref:`SpatialMaterial <class_SpatialMaterial>`. It uses a projection technique called equirectangular
 projection, which translates a spherical map onto a 2D plane.
 
 .. note:: If you are interested in a little extra information on the technique, we will be converting from