Skip to main content

defoldsdk

defold protbuff python

installling

pip install defoldsdk

usage :

all proto objects are under the namespace sdk

from  defoldsdk import sdk 

for i in sdk : 
    print(i)

x = sdk.Texture()

example load collection from string

from  defoldsdk import sdk 
from google.protobuf.json_format import MessageToJson
from google.protobuf.text_format import MessageToString, Parse

content = '''
name: "menu"
scale_along_z: 0
embedded_instances {
  id: "go"
  data: "components {\\n"
  "  id: \\"menu\\"\\n"
  "  component: \\"/examples/collection/proxy/menu.gui\\"\\n"
  "  position {\\n"
  "    x: 0.0\\n"
  "    y: 0.0\\n"
  "    z: 0.0\\n"
  "  }\\n"
  "  rotation {\\n"
  "    x: 0.0\\n"
  "    y: 0.0\\n"
  "    z: 0.0\\n"
  "    w: 1.0\\n"
  "  }\\n"
  "}\\n"
  ""
  position {
    x: 0.0
    y: 0.0
    z: 0.0
  }
  rotation {
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0
  }
  scale3 {
    x: 1.0
    y: 1.0
    z: 1.0
  }
}
'''


collection = sdk.CollectionDesc()
Parse(content.encode('utf-8'), collection)
print(MessageToString(collection))
print(MessageToJson(collection,preserving_proto_field_name=True))

output :

name: "menu"
scale_along_z: 0
embedded_instances {
  id: "go"
  data: "components {\n  id: \"menu\"\n  component: \"/examples/collection/proxy/menu.gui\"\n  position {\n    x: 0.0\n    y: 0.0\n    z: 0.0\n  }\n  rotation {\n    x: 0.0\n    y: 0.0\n    z: 0.0\n    w: 1.0\n  }\n}\n"
  position {
    x: 0.0
    y: 0.0
    z: 0.0
  }
  rotation {
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0
  }
  scale3 {
    x: 1.0
    y: 1.0
    z: 1.0
  }
}

{
  "name": "menu",
  "scale_along_z": 0,
  "embedded_instances": [
    {
      "id": "go",
      "data": "components {\n  id: \"menu\"\n  component: \"/examples/collection/proxy/menu.gui\"\n  position {\n    x: 0.0\n    y: 0.0\n    z: 0.0\n  }\n  rotation {\n    x: 0.0\n    y: 0.0\n    z: 0.0\n    w: 1.0\n  }\n}\n",
      "position": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0
      },
      "rotation": {
        "x": 0.0,
        "y": 0.0,
        "z": 0.0,
        "w": 1.0
      },
      "scale3": {
        "x": 1.0,
        "y": 1.0,
        "z": 1.0
      }
    }
  ]
}```

Metadata

Release files for defoldsdk 1.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for defoldsdk 1.3.7
File Size Uploaded
defoldsdk-1.3.7.tar.gz 29.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for defoldsdk 1.3.7
File Interpreter ABI Platform
defoldsdk-1.3.7-py3-none-any.whl Python 3 none any Details

Total release size: 76.0 kB

Release files / defoldsdk-1.3.7.tar.gz

Download URL defoldsdk-1.3.7.tar.gz
Size 29.0 kB
Tags Source
SHA-256 checksum
How to use checksums
219a758f207c53f889f27ef3dd847d7f32fb6f02573318f0084f7b2952e7ac51
BLAKE2b-256 checksum
How to use checksums
a40313f61579ff88cd25cccced2ad7602996b71af568a78d185d104b90406bbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / defoldsdk-1.3.7-py3-none-any.whl

Download URL defoldsdk-1.3.7-py3-none-any.whl
Size 47.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
98717a11e20350f131ba7d917faf930ec66b4e5a124c3d1f698aa32246f0ee70
BLAKE2b-256 checksum
How to use checksums
637cf4d86b783ae725c05a77acadedaa83dbaf5a9e80d09838daa5e0d08dbb84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

1.3.7 This release

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.9

2 release files

1.2.8

2 release files

1.2.7

2 release files

1.2.6

2 release files

1.2.5

2 release files

1.2.4

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.9

2 release files

1.1.8

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page