Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 09/08/2016, à 12:26

julien51

Problème d'erreur de langage sur python 2.6

Bonjour,

Je vien vous voir j'ai un problème pour importer où exporter pour les fichier Nif sur blender version 2.49

Voici le message d’erreur.

SyntaxError: Non-ASCII character '\xc2' in file C:\Python26\Lib\nif_common.py on line 5, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details.

Et vue je connais rien sur ces encodage je voudrais savoir si quelqu'un pourrai m'aider svp merci à vous.

Cordialement.

Hors ligne

#2 Le 09/08/2016, à 12:49

pingouinux

Re : Problème d'erreur de langage sur python 2.6

Bonjour,
Le chemin du fichier n'a pas une syntaxe Linux.
Montre les 5 premières lignes du fichier en question.

Hors ligne

#3 Le 09/08/2016, à 16:12

julien51

Re : Problème d'erreur de langage sur python 2.6

Je préfère vous le passer par le téléchargement que vous l'ouvriez vous même sa sera plus simple parce que moi il y a trop d'écriture voici le lien:

nif_common.py -  9 KB

Hors ligne

#4 Le 09/08/2016, à 20:54

julien51

Re : Problème d'erreur de langage sur python 2.6

Quelqu'un pourrai m'aider svp merci

Hors ligne

#5 Le 10/08/2016, à 06:54

pingouinux

Re : Problème d'erreur de langage sur python 2.6

Je préfère vous le passer par le téléchargement que vous l'ouvriez vous même sa sera plus simple parce que moi il y a trop d'écriture

C'est sûr que c'est plus simple pour toi…

Essaye d'ajouter cette ligne en tête du fichier :

# -*- coding: utf-8 -*-

Hors ligne

#6 Le 10/08/2016, à 07:54

julien51

Re : Problème d'erreur de langage sur python 2.6

voila les première chose que j'ai c'est sa alors je met où la ligne que je doit rajouter

"""Helper functions for nif import and export scripts."""

# ***** BEGIN LICENSE BLOCK *****
# 
# Copyright © 2005-2015, NIF File Format Library and Tools contributors.
# All rights reserved.
# 
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 
#    * Redistributions of source code must retain the above copyright
#      notice, this list of conditions and the following disclaimer.
# 
#    * Redistributions in binary form must reproduce the above
#      copyright notice, this list of conditions and the following
#      disclaimer in the documentation and/or other materials provided
#      with the distribution.
# 
#    * Neither the name of the NIF File Format Library and Tools
#      project nor the names of its contributors may be used to endorse
#      or promote products derived from this software without specific
#      prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# ***** END LICENSE BLOCK *****

import bpy
import re

import pyffi
from pyffi.formats.nif import NifFormat
from io_scene_nif.utility.nif_logging import NifLog
from io_scene_nif.utility.nif_global import NifOp

class NifCommon:
    """Abstract base class for import and export. Contains utility functions
    that are commonly used in both import and export.
    """
    
    # dictionary of bones that belong to a certain armature
    # maps NIF armature name to list of NIF bone name
    dict_armatures = {}
    # dictionary of bones, maps Blender bone name to matrix that maps the
    # NIF bone matrix on the Blender bone matrix
    # B' = X * B, where B' is the Blender bone matrix, and B is the NIF bone matrix
    dict_bones_extra_matrix = {}

    # dictionary of bones, maps Blender bone name to matrix that maps the
    # NIF bone matrix on the Blender bone matrix
    # Recall from the import script
    #   B' = X * B,
    # where B' is the Blender bone matrix, and B is the NIF bone matrix,
    # both in armature space. So to restore the NIF matrices we need to do
    #   B = X^{-1} * B'
    # Hence, we will restore the X's, invert them, and store those inverses in the
    # following dictionary.
    dict_bones_extra_matrix_inv = {}

    # dictionary mapping bhkRigidBody objects to objects imported in Blender; 
    # we use this dictionary to set the physics constraints (ragdoll etc)
    dict_havok_objects = {}
    
    # dictionary of names, to map NIF blocks to correct Blender names
    dict_names = {}

    # dictionary of bones, maps Blender name to NIF block
    dict_blocks = {}
    
    # keeps track of names of exported blocks, to make sure they are unique
    dict_block_names = []

    # bone animation priorities (maps NiNode name to priority number);
    # priorities are set in import_kf_root and are stored into the name
    # of a NULL constraint (for lack of something better) in
    # import_armature
    dict_bone_priorities = {}

    # dictionary of materials, to reuse materials
    dict_materials = {}
    
    # dictionary of texture files, to reuse textures
    dict_textures = {}
    dict_mesh_uvlayers = []

    VERTEX_RESOLUTION = 1000
    NORMAL_RESOLUTION = 100

    EXTRA_SHADER_TEXTURES = [
        "EnvironmentMapIndex",
        "NormalMapIndex",
        "SpecularIntensityIndex",
        "EnvironmentIntensityIndex",
        "LightCubeMapIndex",
        "ShadowTextureIndex"]
    """Names (ordered by default index) of shader texture slots for
    Sid Meier's Railroads and similar games.
    """

Modération : merci à l'avenir d'utiliser les balises code (explications ici).

Dernière modification par cqfd93 (Le 10/08/2016, à 16:03)

Hors ligne

#7 Le 10/08/2016, à 08:09

pingouinux

Re : Problème d'erreur de langage sur python 2.6

julien51 #6 a écrit :

...alors je met où la ligne que je doit rajouter

pingouinux #5 a écrit :

...ajouter cette ligne en tête du fichier

Ce sera la première ligne.

Remarque : Pour montrer du texte, merci d'utiliser les balises-code : icône <>

Hors ligne

#8 Le 10/08/2016, à 08:12

julien51

Re : Problème d'erreur de langage sur python 2.6

sa me marque invalid syntax

Hors ligne

#9 Le 10/08/2016, à 08:39

pingouinux

Re : Problème d'erreur de langage sur python 2.6

Donne le résultat (entre balises-code) de

head -6 le_fichier_python_modifié | hd

ainsi que le message d'erreur complet (copier-coller).

Hors ligne

#10 Le 10/08/2016, à 08:49

julien51

Re : Problème d'erreur de langage sur python 2.6

head -6 le_fichier_python_modifié | hd

Je doit le trouver dans Nif_common?

Hors ligne

#11 Le 10/08/2016, à 09:04

pingouinux

Re : Problème d'erreur de langage sur python 2.6

Si tu as ajouté en tête du fichier la ligne que je t'ai indiquée en #5, tu dois bien savoir où se trouve ce fichier.

Hors ligne

#12 Le 10/08/2016, à 09:30

julien51

Re : Problème d'erreur de langage sur python 2.6

# -*- coding: utf-8 -*- j'ai mis en tête

mais j'ai pas head -6 le_fichier_python_modifié | hd dans le fichier

désoler c'est la première fois que je vois sa alors je connais rien vraiment désolé

Hors ligne

#13 Le 10/08/2016, à 09:57

pingouinux

Re : Problème d'erreur de langage sur python 2.6

julien51 #12 a écrit :

mais j'ai pas head -6 le_fichier_python_modifié | hd dans le fichier

C'est normal. Il faut taper cette commande dans un terminal (à condition que tu sois sous Linux, ce dont je ne suis pas certain, au vu du chemin du fichier en #1)

head -6 le_fichier_python_modifié | hd

le_fichier_python_modifié est évidemment à remplacer par le nom du fichier, éventuellement avec le chemin complet.

Hors ligne

#14 Le 10/08/2016, à 09:59

julien51

Re : Problème d'erreur de langage sur python 2.6

je suis pas sur Linux je fait comment?

Hors ligne

#15 Le 10/08/2016, à 10:12

pingouinux

Re : Problème d'erreur de langage sur python 2.6

Dans ce cas, donne le message d'erreur complet, qui est peut-être généré par un autre fichier..

Hors ligne

#16 Le 10/08/2016, à 10:18

julien51

Re : Problème d'erreur de langage sur python 2.6

le message d’erreur c'est sur blender quand je veux exporte où importer

C'est sa ce que tu me demande le message d'erreur sur la console de blender?

Hors ligne

#17 Le 10/08/2016, à 10:57

julien51

Re : Problème d'erreur de langage sur python 2.6

Stp aide moi à trouver ce problème je sais je suis pire que un d'un débutant c'est la première fois je vois sa mais je voudrais résoudre ce problème

Hors ligne

#18 Le 10/08/2016, à 11:07

pingouinux

Re : Problème d'erreur de langage sur python 2.6

Désolé, je ne connais pas blendersad

Hors ligne

#19 Le 10/08/2016, à 11:24

julien51

Re : Problème d'erreur de langage sur python 2.6

comment je vais faire si personne peux m'aider?

Hors ligne

#20 Le 10/08/2016, à 12:57

pingouinux

Re : Problème d'erreur de langage sur python 2.6

Si tu veux que quelqu'un puisse t'aider, commence par donner le retour COMPLET des messages d'erreur.

Hors ligne

#21 Le 10/08/2016, à 13:06

julien51

Re : Problème d'erreur de langage sur python 2.6

sa me marque que sa invalid syntax comme erreur

Hors ligne

#22 Le 10/08/2016, à 19:50

claudius01

Re : Problème d'erreur de langage sur python 2.6

Bonsoir,

julien51 a écrit :

je suis pas sur Linux je fait comment?
...
comment je vais faire si personne peux m'aider?

J'adore ... et tu es sur quelle plate-forme ?!...
Pourquoi alors avoir posté sur ce forum très orienté Linux ?..

( ͡° ͜ʖ ͡°)
( ͡⊙ ͜ʖ ͡⊙)
( ͡◉ ͜ʖ ͡◉)

Maintenant, désolé de ne pouvoir t'aider...

Hors ligne