glTF: remove 2.79 on upstream repository
Files are no more computed to remove 2.79 code here, so some little modification on files can be found
This commit is contained in:
parent
6d11965601
commit
1e5d8bd56d
|
@ -15,8 +15,8 @@
|
|||
bl_info = {
|
||||
'name': 'glTF 2.0 format',
|
||||
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
|
||||
"version": (1, 2, 20),
|
||||
'blender': (2, 81, 6),
|
||||
"version": (1, 2, 21),
|
||||
'blender': (2, 82, 7),
|
||||
'location': 'File > Import-Export',
|
||||
'description': 'Import-Export as glTF 2.0',
|
||||
'warning': '',
|
||||
|
@ -480,13 +480,8 @@ class ExportGLTF2_Base:
|
|||
|
||||
return gltf2_blender_export.save(context, export_settings)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def draw(self, context):
|
||||
pass
|
||||
pass # Is needed to get panels available
|
||||
|
||||
|
||||
class GLTF_PT_export_main(bpy.types.Panel):
|
||||
|
@ -947,4 +942,3 @@ def unregister():
|
|||
# remove from the export / import menu
|
||||
bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
|
||||
bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
|
||||
|
||||
|
|
|
@ -60,4 +60,3 @@ def get_target(property):
|
|||
"scale": "scale",
|
||||
"value": "weights"
|
||||
}.get(property)
|
||||
|
||||
|
|
|
@ -36,4 +36,3 @@ def get_rotation_modes(target_property: str) -> str:
|
|||
return True, ["AXIS_ANGLE"]
|
||||
else:
|
||||
return False, []
|
||||
|
||||
|
|
|
@ -91,4 +91,3 @@ def set_extras(blender_element, extras, exclude=[]):
|
|||
blender_element[custom_property] = value
|
||||
except TypeError as e:
|
||||
print('Error setting property %s to value of type %s' % (custom_property, type(value)))
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ def is_json_convertible(data):
|
|||
return True
|
||||
except:
|
||||
return False
|
||||
|
||||
|
|
|
@ -15,4 +15,3 @@
|
|||
|
||||
def get_gltf_node_name():
|
||||
return "glTF Settings"
|
||||
|
||||
|
|
|
@ -170,4 +170,3 @@ def transform_value(value: Vector, _: Matrix = Matrix.Identity(4)) -> Vector:
|
|||
def round_if_near(value: float, target: float) -> float:
|
||||
"""If value is very close to target, round to target."""
|
||||
return value if abs(value - target) > 2.0e-6 else target
|
||||
|
||||
|
|
|
@ -147,4 +147,3 @@ def __notify_end(context, elapsed):
|
|||
print_console('INFO', 'Finished glTF 2.0 export in {} s'.format(elapsed))
|
||||
context.window_manager.progress_end()
|
||||
print_newline()
|
||||
|
||||
|
|
|
@ -57,4 +57,3 @@ USE_NO_COLOR = 'gltf_use_no_color'
|
|||
|
||||
METALLIC_ROUGHNESS_IMAGE = "metallic_roughness_image"
|
||||
GROUP_INDEX = 'group_index'
|
||||
|
||||
|
|
|
@ -137,4 +137,3 @@ def __gather_extras(blender_object, export_settings):
|
|||
if export_settings[gltf2_blender_export_keys.EXTRAS]:
|
||||
return generate_extras(blender_object)
|
||||
return None
|
||||
|
||||
|
|
|
@ -45,4 +45,3 @@ def gather_accessor(buffer_view: gltf2_io_binary_data.BinaryData,
|
|||
sparse=None,
|
||||
type=type
|
||||
)
|
||||
|
||||
|
|
|
@ -119,4 +119,3 @@ def __gather_path(channels: typing.Tuple[bpy.types.FCurve],
|
|||
raise RuntimeError("Cannot export an animation with {} target".format(target))
|
||||
|
||||
return path
|
||||
|
||||
|
|
|
@ -370,4 +370,3 @@ def __gather_armature_object_channel_groups(blender_action: bpy.types.Action, bl
|
|||
groups += list(p.values())
|
||||
|
||||
return map(tuple, groups)
|
||||
|
||||
|
|
|
@ -388,4 +388,3 @@ def needs_baking(blender_object_if_armature: typing.Optional[bpy.types.Object],
|
|||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
|
|
@ -410,4 +410,3 @@ def __gather_output(channels: typing.Tuple[bpy.types.FCurve],
|
|||
sparse=None,
|
||||
type=data_type
|
||||
)
|
||||
|
||||
|
|
|
@ -245,4 +245,3 @@ def __get_blender_actions(blender_object: bpy.types.Object,
|
|||
blender_actions.sort(key = lambda a: a.name.lower())
|
||||
|
||||
return [(blender_action, blender_tracks[blender_action.name]) for blender_action in blender_actions]
|
||||
|
||||
|
|
|
@ -139,4 +139,3 @@ def skdrivervalues(func):
|
|||
else:
|
||||
return func.__skdrivervalues[args[0].name][args[1]]
|
||||
return wrapper_skdrivervalues
|
||||
|
||||
|
|
|
@ -119,4 +119,3 @@ def __gather_type(blender_camera, export_settings):
|
|||
elif blender_camera.type == 'ORTHO':
|
||||
return "orthographic"
|
||||
return None
|
||||
|
||||
|
|
|
@ -71,4 +71,3 @@ def get_sk_driver_values(blender_object, frame, fcurves):
|
|||
sk_values.append(blender_object.data.shape_keys.path_resolve(get_target_object_path(f.data_path)).value)
|
||||
|
||||
return tuple(sk_values)
|
||||
|
||||
|
|
|
@ -240,4 +240,3 @@ def __get_texname_from_slot(sockets_or_slots, export_settings):
|
|||
|
||||
elif isinstance(sockets_or_slots[0], bpy.types.MaterialTextureSlot):
|
||||
return sockets_or_slots[0].texture.image.name
|
||||
|
||||
|
|
|
@ -81,4 +81,3 @@ def gather_joint(blender_bone, export_settings):
|
|||
translation=translation,
|
||||
weights=None
|
||||
)
|
||||
|
||||
|
|
|
@ -42,4 +42,3 @@ def __gather_inner_cone_angle(blender_lamp, _) -> Optional[float]:
|
|||
|
||||
def __gather_outer_cone_angle(blender_lamp, _) -> Optional[float]:
|
||||
return blender_lamp.spot_size * 0.5
|
||||
|
||||
|
|
|
@ -133,4 +133,3 @@ def __get_cycles_emission_node(blender_lamp) -> Optional[bpy.types.ShaderNodeEmi
|
|||
continue
|
||||
return result[0].shader_node
|
||||
return None
|
||||
|
||||
|
|
|
@ -145,4 +145,3 @@ def __get_tex_from_socket(socket):
|
|||
if result[0].shader_node.image is None:
|
||||
return None
|
||||
return result[0]
|
||||
|
||||
|
|
|
@ -135,4 +135,3 @@ def __get_tex_from_socket(socket):
|
|||
if result[0].shader_node.image is None:
|
||||
return None
|
||||
return result[0]
|
||||
|
||||
|
|
|
@ -217,4 +217,3 @@ def __has_image_node_from_socket(socket):
|
|||
if not result:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
|
@ -173,4 +173,3 @@ def __has_image_node_from_socket(socket):
|
|||
if not result:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
|
|
@ -158,4 +158,3 @@ def __gather_weights(blender_mesh: bpy.types.Mesh,
|
|||
weights.append(blender_shape_key.value)
|
||||
|
||||
return weights
|
||||
|
||||
|
|
|
@ -410,4 +410,3 @@ def __get_correction_node(blender_object, export_settings):
|
|||
translation=None,
|
||||
weights=None
|
||||
)
|
||||
|
||||
|
|
|
@ -223,4 +223,3 @@ def __gather_skins(blender_primitive, export_settings):
|
|||
joint_id = 'JOINTS_' + str(bone_set_index)
|
||||
weight_id = 'WEIGHTS_' + str(bone_set_index)
|
||||
return attributes
|
||||
|
||||
|
|
|
@ -232,4 +232,3 @@ def __gather_targets(blender_primitive, blender_mesh, modifiers, export_settings
|
|||
morph_index += 1
|
||||
return targets
|
||||
return None
|
||||
|
||||
|
|
|
@ -100,4 +100,3 @@ def gather_sampler_from_texture_slot(blender_texture: bpy.types.TextureSlot, exp
|
|||
wrap_s=wrap,
|
||||
wrap_t=wrap
|
||||
)
|
||||
|
||||
|
|
|
@ -189,4 +189,3 @@ def get_bone_tree(blender_dummy, blender_object):
|
|||
list_ = list(set(bones))
|
||||
root_ = list(set(root_bones))
|
||||
return [blender_object.data.bones[b] for b in list_], children, [blender_object.pose.bones[b] for b in root_]
|
||||
|
||||
|
|
|
@ -106,4 +106,3 @@ def __get_tex_from_socket(socket):
|
|||
if not result:
|
||||
return None
|
||||
return result[0]
|
||||
|
||||
|
|
|
@ -141,4 +141,3 @@ def __get_tex_from_socket(socket):
|
|||
if result[0].shader_node.image is None:
|
||||
return None
|
||||
return result[0]
|
||||
|
||||
|
|
|
@ -75,10 +75,6 @@ def get_socket_or_texture_slot(blender_material: bpy.types.Material, name: str):
|
|||
inputs = sum([[input for input in node.inputs if input.name == name] for node in nodes], [])
|
||||
if inputs:
|
||||
return inputs[0]
|
||||
else:
|
||||
|
||||
|
||||
pass
|
||||
|
||||
return None
|
||||
|
||||
|
@ -222,4 +218,3 @@ def get_node(data_path):
|
|||
return None
|
||||
|
||||
return node_name[:(index)]
|
||||
|
||||
|
|
|
@ -328,4 +328,3 @@ def _path_to_uri(path):
|
|||
path = os.path.normpath(path)
|
||||
path = path.replace(os.sep, '/')
|
||||
return urllib.parse.quote(path)
|
||||
|
||||
|
|
|
@ -340,4 +340,3 @@ def _render_temp_scene(
|
|||
|
||||
with open(tmpfilename, "rb") as f:
|
||||
return f.read()
|
||||
|
||||
|
|
|
@ -99,4 +99,3 @@ def from_socket(start_socket: bpy.types.NodeSocket,
|
|||
return []
|
||||
|
||||
return __search_from_socket(start_socket, shader_node_filter, [])
|
||||
|
||||
|
|
|
@ -65,4 +65,3 @@ def min_components(l: list, data_type: gltf2_io_constants.DataType) -> list:
|
|||
for i, c in enumerate(components):
|
||||
result[i] = min(result[i], c)
|
||||
return result
|
||||
|
||||
|
|
|
@ -162,4 +162,3 @@ def copy_socket(mh, copy_from, copy_to):
|
|||
copy_to.default_value = copy_from.default_value
|
||||
for link in copy_from.links:
|
||||
mh.node_tree.links.new(copy_to, link.from_socket)
|
||||
|
||||
|
|
|
@ -53,4 +53,3 @@ def unlit(mh):
|
|||
color_socket=emission_node.inputs['Color'],
|
||||
alpha_socket=alpha_socket,
|
||||
)
|
||||
|
||||
|
|
|
@ -59,4 +59,3 @@ class BlenderAnimation():
|
|||
|
||||
for child in gltf.vnodes[vnode_id].children:
|
||||
BlenderAnimation.restore_animation(gltf, child, animation_name)
|
||||
|
||||
|
|
|
@ -197,4 +197,3 @@ class BlenderBoneAnim():
|
|||
|
||||
elif channel.target.path == "scale":
|
||||
BlenderBoneAnim.parse_scale_channel(gltf, vnode, obj, bone, channel, animation)
|
||||
|
||||
|
|
|
@ -112,4 +112,3 @@ class BlenderNodeAnim():
|
|||
group_name=group_name,
|
||||
interpolation=animation.samplers[channel.sampler].interpolation,
|
||||
)
|
||||
|
||||
|
|
|
@ -80,4 +80,3 @@ def make_fcurve(action, co, data_path, index=0, group_name=None, interpolation=N
|
|||
fcurve.update() # force updating tangents (this may change when tangent will be managed)
|
||||
|
||||
return fcurve
|
||||
|
||||
|
|
|
@ -88,4 +88,3 @@ class BlenderWeightAnim():
|
|||
group_name="ShapeKeys",
|
||||
interpolation=animation.samplers[channel.sampler].interpolation,
|
||||
)
|
||||
|
||||
|
|
|
@ -50,4 +50,3 @@ class BlenderCamera():
|
|||
|
||||
obj = bpy.data.objects.new(pycamera.name, cam)
|
||||
return obj
|
||||
|
||||
|
|
|
@ -191,4 +191,3 @@ class BlenderGlTF():
|
|||
|
||||
suffix = '.%03d' % cntr
|
||||
cntr += 1
|
||||
|
||||
|
|
|
@ -74,4 +74,3 @@ class BlenderImage():
|
|||
def _uri_to_path(uri):
|
||||
uri = urllib.parse.unquote(uri)
|
||||
return normpath(uri)
|
||||
|
||||
|
|
|
@ -90,4 +90,3 @@ class BlenderLight():
|
|||
spot.spot_blend = 1.0
|
||||
|
||||
return obj
|
||||
|
||||
|
|
|
@ -91,4 +91,3 @@ class BlenderMaterial():
|
|||
color = pbr.base_color_factor or [1, 1, 1, 1]
|
||||
|
||||
mat.diffuse_color = color
|
||||
|
||||
|
|
|
@ -157,4 +157,3 @@ class BlenderMesh():
|
|||
custom_normals = [v.normal for v in bme.verts]
|
||||
mesh.normals_split_custom_set_from_vertices(custom_normals)
|
||||
mesh.use_auto_smooth = True
|
||||
|
||||
|
|
|
@ -205,4 +205,3 @@ class BlenderNode():
|
|||
BlenderMesh.set_mesh(gltf, gltf.data.meshes[pynode.mesh], obj)
|
||||
|
||||
return obj
|
||||
|
||||
|
|
|
@ -487,4 +487,3 @@ def get_settings_group():
|
|||
gltf_node_group_input = gltf_node_group.nodes.new('NodeGroupInput')
|
||||
gltf_node_group_input.location = -200, 0
|
||||
return gltf_node_group
|
||||
|
||||
|
|
|
@ -350,4 +350,3 @@ class BlenderPrimitive():
|
|||
raise Exception('primitive mode unimplemented: %d' % mode)
|
||||
|
||||
return es, fs
|
||||
|
||||
|
|
|
@ -53,4 +53,3 @@ class BlenderSkin():
|
|||
obj = vnode.blender_object
|
||||
mod = obj.modifiers.new(name="Armature", type="ARMATURE")
|
||||
mod.object = arma.blender_object
|
||||
|
||||
|
|
|
@ -149,4 +149,3 @@ def wrap_name(wrap):
|
|||
if wrap == TextureWrap.MirroredRepeat: return 'MIRRORED_REPEAT'
|
||||
if wrap == TextureWrap.Repeat: return 'REPEAT'
|
||||
return 'UNKNOWN (%s)' % wrap
|
||||
|
||||
|
|
|
@ -358,4 +358,3 @@ def calc_bone_matrices(gltf):
|
|||
|
||||
|
||||
# TODO: add pass to rotate/resize bones so they look pretty
|
||||
|
||||
|
|
|
@ -13,4 +13,3 @@
|
|||
# limitations under the License.
|
||||
|
||||
from .imp import *
|
||||
|
||||
|
|
|
@ -1220,4 +1220,3 @@ def gltf_from_dict(s):
|
|||
|
||||
def gltf_to_dict(x):
|
||||
return to_class(Gltf, x)
|
||||
|
||||
|
|
|
@ -34,4 +34,3 @@ def color_linear_to_srgb(c):
|
|||
return 0.0 if c < 0.0 else c * 12.92
|
||||
else:
|
||||
return 1.055 * pow(c, 1.0 / 2.4) - 0.055
|
||||
|
||||
|
|
|
@ -144,4 +144,3 @@ GLTF_DATA_TYPE_VEC4 = "VEC4"
|
|||
GLTF_DATA_TYPE_MAT2 = "MAT2"
|
||||
GLTF_DATA_TYPE_MAT3 = "MAT3"
|
||||
GLTF_DATA_TYPE_MAT4 = "MAT4"
|
||||
|
||||
|
|
|
@ -124,4 +124,3 @@ class Log:
|
|||
self.hdlr.setFormatter(formatter)
|
||||
self.logger.addHandler(self.hdlr)
|
||||
self.logger.setLevel(int(loglevel))
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ class ChildOfRootExtension(Extension):
|
|||
"""
|
||||
self.path = path
|
||||
super().__init__(name, extension, required)
|
||||
|
||||
|
|
|
@ -74,4 +74,3 @@ class Light:
|
|||
self.extensions)
|
||||
result["extras"] = self.extras
|
||||
return result
|
||||
|
||||
|
|
|
@ -39,4 +39,3 @@ class BinaryData:
|
|||
@property
|
||||
def byte_length(self):
|
||||
return len(self.data)
|
||||
|
||||
|
|
|
@ -58,4 +58,3 @@ class Buffer:
|
|||
|
||||
def clear(self):
|
||||
self.__data = b""
|
||||
|
||||
|
|
|
@ -343,4 +343,3 @@ def __compress_primitive(primitive, dll, export_settings):
|
|||
dll.destroy_compressor(compressor)
|
||||
|
||||
return
|
||||
|
||||
|
|
|
@ -117,4 +117,3 @@ def save_gltf(gltf, export_settings, encoder, glb_buffer):
|
|||
file.close()
|
||||
|
||||
return True
|
||||
|
||||
|
|
|
@ -53,4 +53,3 @@ class ImageData:
|
|||
@property
|
||||
def byte_length(self):
|
||||
return len(self._data)
|
||||
|
||||
|
|
|
@ -20,4 +20,3 @@ def export_user_extensions(hook_name, export_settings, gltf2_object, *args):
|
|||
hook = getattr(extension, hook_name, None)
|
||||
if hook is not None:
|
||||
hook(gltf2_object, *args, export_settings)
|
||||
|
||||
|
|
|
@ -13,4 +13,3 @@
|
|||
# limitations under the License.
|
||||
|
||||
"""IO imp package."""
|
||||
|
||||
|
|
|
@ -174,4 +174,3 @@ class BinaryData():
|
|||
return data, image_name
|
||||
|
||||
return None, None
|
||||
|
||||
|
|
|
@ -202,4 +202,3 @@ class glTFImporter():
|
|||
except Exception:
|
||||
self.log.error("Couldn't read file: " + path)
|
||||
return None, None
|
||||
|
||||
|
|
Loading…
Reference in New Issue