Skip to content

IDEA Improvement: Need Help to recursively import RDCs from a Folder and store each element into a Collection #128

@fpibbs

Description

@fpibbs

As written in the title and kindly need @eliemichel help, my script is almost ready but I have some troubles because it stores only the first element on the collection under its named from file.
Hope it can help:

import bpy
import os
import sys
import glob

directory_im = 'C:/Users/fcapp/Desktop/LowPoly2/'
files = glob.glob(directory_im + ".rdc")
for f in files:
head, tail = os.path.split(f)
collection_name = tail.replace('.rdc', '')
bpy.ops.import_rdc.google_maps(filepath=(f), filter_glob="
.rdc", max_blocks=-1)
myCol = bpy.data.collections.new(collection_name)
bpy.context.scene.collection.children.link(myCol)
for ob in bpy.context.selected_objects:
myCol.objects.link(ob)

image

Where am I wrong? Need to solve that...

Current Configuration:
Blender 2.91, Maps Model Importer 0.3.5, RenderDOC 1.10, Chrome X64 on Windows Pro 87.0.4280.141( 64 bit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionThis is not really an issue but a thread for the users to exchange about teh software

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions