예제 #1
0
def open_scene_folder(activeDoc):
    activeDocPath = activeDoc.GetDocumentPath()
    if not activeDocPath:
        c4d.gui.MessageDialog("Unable to locate the scene file. Please make sure your scene is saved.")
        return False

    activeDocName = activeDoc.GetDocumentName()

    fullPath = os.path.join(activeDocPath, activeDocName)

    if c4d.GeGetCurrentOS() is c4d.OPERATINGSYSTEM_OSX:
        sanitizePath = fullPath.replace(" ", "\ ")
        subprocess.Popen("open -R {0}".format(sanitizePath), shell=True)
    else:
        subprocess.Popen('Explorer /select, {0}'.format(fullPath), shell=True)
예제 #2
0
# -*- coding: utf-8 -*-

import c4d
import shapefile
import os

CONTAINER_ORIGIN = 1026473

# types pris en charge
TYPES = [
    shapefile.POINT, shapefile.POLYLINE, shapefile.POLYGON, shapefile.POINTZ,
    shapefile.MULTIPOINT
]

# pour savoir si on est sur windows pour le codage des chemins de fichiers
WIN = c4d.GeGetCurrentOS() == c4d.OPERATINGSYSTEM_WIN


def creerGeoTag(obj, doc, centre):
    geoTag = c4d.BaseTag(1026472)  # GeoTag
    origine = doc[CONTAINER_ORIGIN]
    if not origine:
        origine = centre
        doc[CONTAINER_ORIGIN] = origine
    geoTag[CONTAINER_ORIGIN] = centre

    obj.InsertTag(geoTag)
    return geoTag


class SHP4D(object):