Increase material count limit to 1000.

The texture limit used to be 1000, but when materials with multiple textures were introduced in 3.2.0, the limit was reduced to 100. Since there are model out there that already have more than 100 and fewer than 1000 textures/materials, we should maintain backwards compat.

Fixes #1877

PiperOrigin-RevId: 659901629
Change-Id: If0f6d0500d1d808bc3ec2d87d4a3faf24007da59
This commit is contained in:
Nimrod Gileadi
2024-08-06 04:20:07 -07:00
committed by Copybara-Service
parent 881b777ffd
commit 9db9df7380
4 changed files with 23 additions and 21 deletions
+9 -7
View File
@@ -13,23 +13,25 @@ General
3. Added sub-elements to the MJCF :ref:`material<asset-material>` element, to allow specification of multiple textures
for rendering (e.g., :ref:`occlusion-roughness-metallic<material-orm>`). Note that the MuJoCo renderer doesn't
support these new features, and they are made available for use with external renderers.
4. Increase texture and material limit back to 1000. 3.2.0 inadvertently reduced this limit to 100, breaking some
existing models (:github:issue:`1877`).
MJX
^^^
4. Added more fields to ``mjx.Model`` and ``mjx.Data`` for further compatibility with the corresponding MuJoCo structs.
5. Added support for :ref:`fixed tendons <tendon-fixed>`.
6. Added support for tendon length limits (``mjCNSTR_LIMIT_TENDON`` in :ref:`mjtConstraint`).
7. Added support for tendon equality constraints (``mjEQ_TENDON`` in :ref:`mjtEq`).
8. Added support for tendon actuator transmission (``mjTRN_TENDON`` in :ref:`mjtTrn`).
5. Added more fields to ``mjx.Model`` and ``mjx.Data`` for further compatibility with the corresponding MuJoCo structs.
6. Added support for :ref:`fixed tendons <tendon-fixed>`.
7. Added support for tendon length limits (``mjCNSTR_LIMIT_TENDON`` in :ref:`mjtConstraint`).
8. Added support for tendon equality constraints (``mjEQ_TENDON`` in :ref:`mjtEq`).
9. Added support for tendon actuator transmission (``mjTRN_TENDON`` in :ref:`mjtTrn`).
Python bindings
^^^^^^^^^^^^^^^
9. Added support for asset dictionary argument in ``mujoco.spec.from_file``, ``mujoco.spec.from_string`` and
10. Added support for asset dictionary argument in ``mujoco.spec.from_file``, ``mujoco.spec.from_string`` and
``mujoco.spec.compile``.
Bug fixes
^^^^^^^^^
10. Fixed a bug where implicit integrators did not take into account disabled actuators (:github:issue:`1838`).
11. Fixed a bug where implicit integrators did not take into account disabled actuators (:github:issue:`1838`).
Version 3.2.0 (Jul 15, 2024)
----------------------------
+2 -2
View File
@@ -22,8 +22,8 @@ extern "C" {
#endif
#define mjNAUX 10 // number of auxiliary buffers
#define mjMAXTEXTURE 100 // maximum number of textures
#define mjMAXMATERIAL 100 // maximum number of materials with textures
#define mjMAXTEXTURE 1000 // maximum number of textures
#define mjMAXMATERIAL 1000 // maximum number of materials with textures
//---------------------------------- primitive types (mjt) -----------------------------------------
+5 -5
View File
@@ -7967,7 +7967,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
name='mat_texid',
type=ArrayType(
inner_type=ValueType(name='int'),
extents=(1000,),
extents=(10000,),
),
doc='material texture ids (-1: no texture)',
),
@@ -7975,7 +7975,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
name='mat_texuniform',
type=ArrayType(
inner_type=ValueType(name='int'),
extents=(100,),
extents=(1000,),
),
doc='texture repetition for 2d mapping',
),
@@ -7983,7 +7983,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
name='mat_texrepeat',
type=ArrayType(
inner_type=ValueType(name='int'),
extents=(200,),
extents=(2000,),
),
doc='texture repetition for 2d mapping',
),
@@ -7996,7 +7996,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
name='textureType',
type=ArrayType(
inner_type=ValueType(name='int'),
extents=(100,),
extents=(1000,),
),
doc='type of texture (mjtTexture) (ntexture)',
),
@@ -8004,7 +8004,7 @@ STRUCTS: Mapping[str, StructDecl] = dict([
name='texture',
type=ArrayType(
inner_type=ValueType(name='unsigned int'),
extents=(100,),
extents=(1000,),
),
doc='texture names',
),
+7 -7
View File
@@ -54,8 +54,8 @@ public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJPLUGIN_H_ = true;
public const bool mjEXTERNC = true;
public const bool THIRD_PARTY_MUJOCO_MJRENDER_H_ = true;
public const int mjNAUX = 10;
public const int mjMAXTEXTURE = 100;
public const int mjMAXMATERIAL = 100;
public const int mjMAXTEXTURE = 1000;
public const int mjMAXMATERIAL = 1000;
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJSPEC_H_ = true;
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTHREAD_H_ = true;
public const int mjMAXTHREAD = 128;
@@ -5644,12 +5644,12 @@ public unsafe struct mjrContext_ {
public fixed uint auxFBO_r[10];
public fixed uint auxColor[10];
public fixed uint auxColor_r[10];
public fixed int mat_texid[1000];
public fixed int mat_texuniform[100];
public fixed int mat_texrepeat[200];
public fixed int mat_texid[10000];
public fixed int mat_texuniform[1000];
public fixed int mat_texrepeat[2000];
public int ntexture;
public fixed int textureType[100];
public fixed uint texture[100];
public fixed int textureType[1000];
public fixed uint texture[1000];
public uint basePlane;
public uint baseMesh;
public uint baseHField;